手動建庫步驟 10g for linux

byfree發表於2012-05-07
1.設定SID
export ORACLE_SID=ocm
 
2.建立口令檔案
orapwd file=/u01/app/oracle/product/10.2.0/db_1/dbs/orapwocm password=sys
 
3.準備引數檔案init.ora
db_name=ocm
compatible=10.2.0
control_files=(/u01/app/oracle/oradata/control01.dbf,/u01/app/oracle/oradata/control02.dbf,/u01/app/oracle/oradata/control03.dbf)
sga_target=300M
db_block_size=8192
processes=300
undo_management=AUTO
background_dump_dest=/u01/app/oracle/admin/ocm/bdump
core_dump_dest=/u01/app/oracle/admin/ocm/cdump
user_dump_dest=/u01/app/oracle/admin/ocm/udump
準備好相應目錄
 
4.連線instance
sqlplus / as sysdba
 
5.建立SPFILE(推薦)
create spfile from pfile='/u01/app/oracle/product/10.2.0/db_1/dbs/init.ora';
shutdown;
exit
 
6.start instance
startup nomount
 
7.create database statement
CREATE DATABASE ocm
USER SYS IDENTIFIED BY sys
USER SYSTEM IDENTIFIED BY sys
LOGFILE GROUP 1 ('/u01/app/oracle/oradata/redo01.log') SIZE 50M,
GROUP 2 ('/u01/app/oracle/oradata/redo02.log') SIZE 50M,
GROUP 3 ('/u01/app/oracle/oradata/redo03.log') SIZE 50M
MAXLOGFILES 5
MAXLOGMEMBERS 5
MAXLOGHISTORY 1
MAXDATAFILES 100
MAXINSTANCES 1
CHARACTER SET ZHS16GBK
NATIONAL CHARACTER SET AL16UTF16
DATAFILE '/u01/app/oracle/oradata/system01.dbf' SIZE 325M REUSE
EXTENT MANAGEMENT LOCAL
SYSAUX DATAFILE '/u01/app/oracle/oradata/sysaux01.dbf' SIZE 325M REUSE
DEFAULT TABLESPACE tbs_1
DATAFILE '/u01/app/oracle/oradata/tbs01.dbf' SIZE 100M REUSE(官方文件缺此行)
DEFAULT TEMPORARY TABLESPACE tempts1
TEMPFILE '/u01/app/oracle/oradata/temp01.dbf'
SIZE 20M REUSE
UNDO TABLESPACE undotbs
DATAFILE '/u01/app/oracle/oradata/undotbs01.dbf'
SIZE 200M REUSE AUTOEXTEND ON MAXSIZE UNLIMITED;
 
8.建立其它表空間(如需要)
 
9.Run Scripts to Build Data Dictionary Views
connect / as sysdba
@?/rdbms/admin/catalog.sql
@?/rdbms/admin/catproc.sql
exit
 
10.Run Scripts to Install Additional Options (Optional)
 
11.Back Up the Database

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

相關文章