日期:2014-05-16  浏览次数:20559 次

OCM考试系列之手动建库
一、参数文件
参数文件可以从$ORACLE_HOME/dbs/init.ora拷贝
或者从Administrator's Guide=>Creating an Oracle Database=>Understanding Initialization Parameters拷贝

control_files              = '/oradata/mynewdb/control01.ctl'
db_name                    = mynewdb
db_block_size              = 8192
pga_aggregate_target       = 50M
processes                  = 150
undo_management            = AUTO
undo_tablespace            = undotbs
compatible                 = 10.2.0
sga_target                 = 150M


二、建库脚本可以从以下文档拷贝

Administrator's Guide=>Creating an Oracle Database

其中字符集可以从Globalization Support Guide=>Choosing a Character Set=>搜索WE8ISO
CREATE DATABASE mynewdb
   USER SYS IDENTIFIED BY oracle
   USER SYSTEM IDENTIFIED BY oracle
   LOGFILE GROUP 1 ('/oradata/mynewdb/redo01.log') SIZE 100M,
           GROUP 2 ('/oradata/mynewdb/redo02.log') SIZE 100M,
           GROUP 3 ('/oradata/mynewdb/redo03.log') SIZE 100M
   MAXLOGFILES 5
   MAXLOGMEMBERS 5
   MAXLOGHISTORY 1
   MAXDATAFILES 100
   MAXINSTANCES 1
   CHARACTER SET ZHS16GBK
   NATIONAL CHARACTER SET AL16UTF16
   DATAFILE '/oradata/mynewdb/system01.dbf' SIZE 325M REUSE
   EXTENT MANAGEMENT LOCAL
   SYSAUX DATAFILE '/oradata/mynewdb/sysaux01.dbf' SIZE 325M REUSE
   DEFAULT TEMPORARY TABLESPACE tempts1
      TEMPFILE '/oradata/mynewdb/temp01.dbf'
      SIZE 20M REUSE
   UNDO TABLESPACE undotbs
      DATAFILE '/oradata/mynewdb/undotbs01.dbf'
      SIZE 200M REUSE AUTOEXTEND ON MAXSIZE UNLIMITED;
     
进行数据字典刷新
SQL> @?/rdbms/admin/catalog.sql
SQL> @?/rdbms/admin/catproc.sql

三、进行密码文件创建
orapwd file=orapwmynewdb password=oracle entries=5

四、进行监听模板配置
Net Services Reference=>7 Listener Parameters (listener.ora)
LISTENER=
  (DESCRIPTION=
    (ADDRESS_LIST=
      (ADDRESS=(PROTOCOL=tcp)(HOST=172.16.4.200)(PORT=1621))
      (ADDRESS=(PROTOCOL=ipc)(KEY=extproc))))

SID_LIST_LISTENER=
  (SID_LIST=
    (SID_DESC=
      (GLOBAL_DBNAME=mynewdb)
      (ORACLE_HOME=/ora10g/oracle/product/10.2.0/db_1)
      (SID_NAME=mynewdb))
    (SID_DESC=
      (SID_NAME=plsextproc)
      (ORACLE_HOME=/ora10g/oracle/product/10.2.0/db_1)
      (PROGRAM=extproc)))
     
同样在Net Services Reference中搜索tnsnames.ora
mynewdb=
(DESCRIPTION=
  (ADDRESS=(PROTOCOL=tcp)(HOST=172.16.4.200)(PORT=1621))
  (CONNECT_DATA=
     (SERVICE_NAME=mynewdb)))
 &