oracle 10g手工建立案例(含指令碼)

shiyihai發表於2007-05-28
最近公司一專案用到了oracle的10g資料庫。雖然自己對10g有過很長時間的關注,不過都是基於理論,趁此在自己的pc機上建立了一個10g的環境。
如下是我手工建立的指令碼,供大家參考![@more@]

第一步:建立密碼檔案
C:Documents and Settingsshiyihai>orapwd file="H:ora10gdbsorapwdora10g.pwd" entries=10 password=sys

第二步:編輯初始化引數檔案,部分引數跟9i不一樣,並nomount啟動資料庫
初始化引數檔案init_10g.ora內容如下:
ora10g.__db_cache_size=100000000
ora10g.__java_pool_size=16777216
ora10g.__large_pool_size=16777216
ora10g.__shared_pool_size=50000000
ora10g.__streams_pool_size=0
*.audit_file_dest='H:adminora10gadump'
*.background_dump_dest='H:adminora10gbdump'
*.compatible='10.2.0.1.0'
*.control_files='H:oradataora10gCONTROL01.CTL','H:oradataora10gCONTROL02.CTL','H:oradataora10gCONTROL03.CTL'
*.core_dump_dest='H:adminora10gcdump'
*.db_block_size=8192
*.db_domain=''
*.db_file_multiblock_read_count=32
*.db_name='ora10g'
*.db_recovery_file_dest='h:flash_recovery_area'
*.db_recovery_file_dest_size=500000000
*.dispatchers='(PROTOCOL=TCP) (SERVICE=ora10gXDB)'
*.job_queue_processes=10
*.open_cursors=300
*.pga_aggregate_target=200000000
*.processes=550
*.remote_login_passwordfile='EXCLUSIVE'
*.sessions=610
*.sga_target=300000000
*.star_transformation_enabled='TRUE'
*.undo_management='AUTO'
*.undo_tablespace='UNDOTBS1'
*.user_dump_dest='H:adminora10gudump'

SQL> startup pfile='h:init_10g.ora' nomount
ORACLE 例程已經啟動。

Total System Global Area 301989888 bytes
Fixed Size 1248672 bytes
Variable Size 96469600 bytes
Database Buffers 201326592 bytes
Redo Buffers 2945024 bytes

注意:是啟動到nomount狀態下。

第三步:建立資料庫
create database ora10g
MAXINSTANCES 8
MAXLOGHISTORY 32
MAXLOGFILES 32
MAXLOGMEMBERS 3
MAXDATAFILES 2048
character set ZHS16GBK
NATIONAL CHARACTER SET AL16UTF16
DATAFILE 'H:oradataora10gsystem01.dbf' size 300M autoextend on next 64K maxsize unlimited
sysaux DATAFILE 'H:oradataora10gsysaux01.dbf' size 100M autoextend on next 64K maxsize unlimited
DEFAULT TEMPORARY TABLESPACE TEMP TEMPFILE 'H:oradataora10gtemp01.dbf' size 50M autoextend on MAXSIZE UNLIMITED EXTENT MANAGEMENT LOCAL UNIFORM SIZE 1024K
UNDO TABLESPACE UNDOTBS1 datafile 'H:oradataora10gundotbs01.dbf' SIZE 50M autoextend on next 64K maxsize unlimited
LOGFILE
GROUP 1 ('H:oradataora10gredo0101.dbf') SIZE 50M REUSE,
GROUP 2 ('H:oradataora10gredo0201.dbf') SIZE 50M REUSE,
GROUP 3 ('H:oradataora10gredo0301.dbf') SIZE 50M REUSE;

資料庫已建立。

SQL>

第四步:建立資料字典
SQL>@ ?/rdbms/admin/catalog.sql;
SQL>@ ?/rdbms/admin/catproc.sql;
SQL>@ ?/rdbms/admin/catblock.sql;
SQL>@ ?/rdbms/admin/catoctk.sql;
SQL> conn system/manager
已連線。
SQL> @ ?/sqlplus/admin/pupbld.sql;

第五步:建立spfile並重啟db
SQL> conn / as sysdba
已連線。
SQL> create spfile from pfile='h:init_10g.ora';

檔案已建立。

SQL> startup force;
ORACLE 例程已經啟動。

Total System Global Area 301989888 bytes
Fixed Size 1248672 bytes
Variable Size 96469600 bytes
Database Buffers 201326592 bytes
Redo Buffers 2945024 bytes
資料庫裝載完畢。
資料庫已經開啟。
SQL>

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/38542/viewspace-916552/,如需轉載,請註明出處,否則將追究法律責任。

相關文章