ITPub博客

首页 > Linux操作系统 > Linux操作系统 > oracle-手工建库脚本

oracle-手工建库脚本

原创 Linux操作系统 作者:skuary 时间:2011-05-09 10:23:43 0 删除 编辑

# User specific environment and startup programs

mkdir /backmem/oracle/admin/kasaur/udump

mkdir /backmem/oracle/admin/kasaur/bdump

mkdir /backmem/oracle/admin/kasaur/cdump
mkdir /backmem/oracle/admin/kasaur/adump

export ORACLE_BASE=/oramem/oracle
export ORACLE_HOME=/oramem/oracle/product/10.2.0
export ORACLE_SID=kasaur
ORACLE_TERM=ansi
ORA_NLS33=$ORACLE_HOME/ocommon/nls/admin/data
NLS_LANG=American_America.ZHS16GBK
NLS_DATE_FORMAT=YYYYMMDDHH24MISS
LD_LIBRARY_PATH=$ORACLE_HOME/lib:$ORACLE_HOME/sqlplus/lib:/usr/lib:/lib:$LD_LIBRARY_PATH
TMPDIR=/tmp
PATH=$PATH:$ORACLE_HOME/bin:/usr/local/bin
export ORACLE_BASE ORACLE_HOME ORACLE_SID ORACLE_TERM ORA_NLS33 NLS_LANG NLS_DATE_FORMAT LD_LIBRARY_PATH TMPDIR

pfile
*.aq_tm_processes=1
*.background_dump_dest='/backmem/oracle/admin/kasaur/bdump'
*.compatible='10.2.0.3.0'
*.control_file_record_keep_time=60
*.control_files='/backmem/oracle/oradata/kasaur/system/control01.ctl','/backmem/oracle/oradata/kasaur/system/control02.ctl','/backmem/oracle/oradata/kasaur/system/control03.ctl'
*.core_dump_dest='/backmem/oracle/admin/kasaur/cdump'
*.db_block_size=8192
*.db_cache_size=3221225472
*.db_domain=''
*.db_file_multiblock_read_count=16
*.db_name='kasaur'
*.db_writer_processes=2
*.dml_locks=6000
*.fast_start_mttr_target=300
*.global_names=FALSE
*.instance_name='kasaur'
*.java_pool_size=33554432
*.job_queue_processes=30
*.large_pool_size=67108864
*.log_archive_dest_1='LOCATION=/backmem/oracle/oradata/kasaur/arch'
*.open_cursors=500
*.pga_aggregate_target=536870912
*.processes=1000
*.query_rewrite_enabled='FALSE'
*.remote_login_passwordfile='EXCLUSIVE'
*.sga_max_size=4294967296
*.shared_pool_size=268435456
*.sort_area_size=524288
*.star_transformation_enabled='FALSE'
*.timed_statistics=TRUE
*.undo_management='AUTO'
*.undo_retention=10800
*.undo_tablespace='UNDOTBS1'
*.user_dump_dest='/backmem/oracle/admin/kasaur/udump'
*.utl_file_dir='/backmem/oracle/kasaur/utl'
*.log_buffer=1048576
*.db_recovery_file_dest='/backmem/oracle/oradata/kasaur/flash_recovery_area'
*.db_recovery_file_dest_size=2147483648

 

password file
orapwd password=oracle entries=5 force=y file=orapwkasaur

CONNECT SYS/CHANGE_ON_INSTALL AS SYSDBA
SET ECHO ON

STARTUP NOMOUNT PFILE="/backmem/oracle/pfile_kasaur.ora";
SPOOL /backmem/oracle/createdb.log
CREATE DATABASE "kasaur"
MAXINSTANCES 1
MAXLOGHISTORY 1
MAXLOGFILES 10
MAXLOGMEMBERS 2
MAXDATAFILES 1000
DATAFILE '/backmem/oracle/oradata/kasaur/system/SYSTEM01.DBF' SIZE 1024M REUSE AUTOEXTEND ON NEXT  10240K MAXSIZE UNLIMITED
SYSAUX DATAFILE '/backmem/oracle/oradata/kasaur/system/SYSAUX01.DBF' SIZE 1024M REUSE AUTOEXTEND ON NEXT  10240K MAXSIZE UNLIMITED
EXTENT MANAGEMENT LOCAL
DEFAULT TEMPORARY TABLESPACE TEMP TEMPFILE '/backmem/oracle/oradata/kasaur/system/TEMP01.DBF' SIZE 1024M REUSE AUTOEXTEND ON NEXT  640K MAXSIZE UNLIMITED
UNDO TABLESPACE "UNDOTBS1" DATAFILE '/backmem/oracle/oradata/kasaur/system/UNDOTBS01.DBF' SIZE 2048M REUSE AUTOEXTEND ON NEXT  5120K MAXSIZE UNLIMITED
CHARACTER SET ZHS16GBK
NATIONAL CHARACTER SET AL16UTF16
LOGFILE
group 1 ('/backmem/oracle/oradata/kasaur/system/redo11.log','/backmem/oracle/oradata/kasaur/system/redo12.log') size 100m,
group 2 ('/backmem/oracle/oradata/kasaur/system/redo21.log','/backmem/oracle/oradata/kasaur/system/redo22.log') size 100m,
group 3 ('/backmem/oracle/oradata/kasaur/system/redo31.log','/backmem/oracle/oradata/kasaur/system/redo32.log') size 100m;
SPOOL OFF
EXIT;


@$ORACLE_HOME/rdbms/admin/catalog.sql
@$ORACLE_HOME/rdbms/admin/catproc.sql
@$ORACLE_HOME/sqlplus/admin/pupbld.sql

如果是windows平台:

mkdir E:\oracle\product\10.2.0\admin\kasaur\pfile

mkdir E:\oracle\product\10.2.0\admin\kasaur\udump

mkdir E:\oracle\product\10.2.0\db_1\cfgtoollogs\dbca\kasaur

mkdir E:\oracle\product\10.2.0\db_1\database

mkdir E:\oracle\product\10.2.0\flash_recovery_area

mkdir E:\oracle\product\10.2.0\oradata\kasaur

ORADIM -NEW -SID kasaur
orapwd FILE=/opt/oracle/product/10.2.0/dbs/pwdkasaur.ORA PASSWORD=kasaur

oradim -new -sid kasaur -startmode auto -syspwd kasaur -pfile /opt/oracle/product/10.2.0/dbs/initkasaur.ora

ORADIM -NEW -SID kasaur -SYSPWD kasaur -STARTMODE M

创建参数文件
用参数文件启动数据库到nomount状态,然后创建数据库即可。

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/25618347/viewspace-713819/,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2011-03-31

  • 博文量
    88
  • 访问量
    316913