1. 程式人生 > >ocm考試之section0手動建庫

ocm考試之section0手動建庫

#Section0手動建庫

(1)確定例項名
export ORACLE_SID=test

(2)建立密碼檔案
orapwd file=orapwtest password=oracle

(3)建立pfile
cat init.ora|grep -v ^ #|grep -v $ > inittest.ora

vi inittest.ora

db_name=test
sga_target=350m
controlfiles=(xxx,xxx)
undo_management=auto

processes=150
db_block_size=8192
log_buffer=50000000
undo_tablespace=undotbs
background_dump_dest
croe_dump_dest
user_dump_dest

(4)建立spfile並啟動例項
sqlplus / as sysdba
create spfile from pfile;
startup nomount

(5)建庫語句

create database test
user sys identified by oracle
user system identified by oracle
logfile group 1 ('/u01/oradata/test/redo01.log') size 100m,
				group 2 ('/u01/oradata/test/redo02.log') size 100m,
				group 3 ('/u01/oradata/test/redo03.log') size 100m
maxlogfiles 5
maxlogmembers 5
maxloghistory 1
maxdatafiles 100
maxinstances 1
character set us7ascii
national character set al16utf16
datafile '/u01/oradata/test/system01.dbf' size 325m reuse 
	extent management local
sysaux datafile '/u01/oradata/test/sysaux01.dbf' size 325 reuse
default temporary tablespace tempts1
	tempfile '/u01/oradata/test/temp01.dbf' size 20m reuse
undo tablespace undotbs
	datafile '/u01/oradata/test/undotbs01.dbf' size 200m reuse autoentend on;

(6)執行指令碼
sqlplus / as sysdba
@?/rdbms/admin/catalog.sql
@?/rdbms/admin/catproc.sql
@?/rdbms/admin/catblock.sql
@?/rdbms/admin/catoctk.sql
@?/rdbms/admin/owminst.plb

sqlplus system/oracle
@?/rdbms/admin/pupbld.sql

#section0注意事項


(1)按題目要求設定"字符集"
(2)有5塊磁碟,建庫建在指定位置
(3)算好冷備時間,使資料庫處於open狀態
(4)沒有明確要求備份時,可以不備份
(5)將兩臺機器的主機名和IP寫入/etc/hosts

參考聯機文件
administrator's guid -> creating a oracle database -> manually creating a oracle database