分类: LINUX
2009-08-25 17:47:43
1. 设置ORACLE_SID
# export ORACLE_SID=test
2. 创建相关目录
# mkdir –p
$ORACLE_BASE/admin/test/adump
# mkdir –p
$ORACLE_BASE/admin/test/bdump
# mkdir –p
$ORACLE_BASE/admin/test/cdump
# mkdir –p
$ORACLE_BASE/admin/test/udump
# mkdir –p
$ORACLE_BASE/admin/test/pfile
# mkdir –p $ORACLE_BASE/oradata/test/
3. 创建参数文件$ORACLE_HOME/dbs/inittest.ora
test.__db_cache_size=83886080
test.__java_pool_size=4194304
test.__large_pool_size=4194304
test.__shared_pool_size=71303168
test.__streams_pool_size=0
*.audit_file_dest='/u01/admin/test/adump'
*.background_dump_dest='/u01/admin/test/bdump'
*.compatible='
*.control_files='/u01/oradata/test/control01.ctl','/u01/oradata/test/control02.ctl','/u01/oradata/test/control03.ctl'
*.core_dump_dest='/u01/admin/test/cdump'
*.db_block_size=8192
*.db_domain=''
*.db_file_multiblock_read_count=16
*.db_name='test'
*.db_recovery_file_dest='/u01/flash_recovery_area'
*.db_recovery_file_dest_size=2147483648
*.dispatchers='(PROTOCOL=TCP)
(SERVICE=testXDB)'
*.job_queue_processes=10
*.log_archive_format='%t_%s_%r.dbf'
*.open_cursors=300
*.pga_aggregate_target=16777216
*.processes=150
*.remote_login_passwordfile='EXCLUSIVE'
*.sga_target=167772160
*.undo_management='AUTO'
*.undo_tablespace='UNDOTBS1'
*.user_dump_dest='/u01/admin/test/udump'
4. 创建密码文件
# orapwd file=$ORACLE_HOME/dbs/orapwtest password=admin entries=5 force=y
5. 创建oracle的建库脚本createdb.sql
create
database test
MAXINSTANCES
1
MAXLOGHISTORY
1
MAXLOGFILES
5
MAXLOGMEMBERS
5
MAXDATAFILES
100
DATAFILE
'/u01/oradata/test/system01.dbf'
size
sysaux
datafile
'/u01/oradata/test/sysaux01.dbf'
size
default
temporary tablespace TEMP tempfile
'/u01/oradata/test/temp01.dbf'
size
undo
tablespace UNDOTBS1 datafile
'/u01/oradata/test/undo01.dbf'
size
logfile
GROUP 1
('/u01/oradata/test/redo1.dbf') size
GROUP 2
('/u01/oradata/test/redo2.dbf') size
GROUP 3
('/u01/oradata/test/redo3.dbf') size
CHARACTER
SET ZHS16GBK
NATIONAL
CHARACTER SET AL16UTF16
;
SQL>alter
database nomount;
SQL>@
createdb.sql;
6. 数据库创建完成后,再创建ORACLE的数据字典
SQL> @
?/rdbms/admin/catalog.sql
SQL> @
?/rdbms/admin/catproc.sql
SQL> @
?/rdbms/admin/catexp.sql