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

一步一步学习oracle手工建库(beta版)

          ① 配置listener.ora

             参考文档b14213(Net service reference)
             141页 静态注册的那个example
             第139页 第一段

             案例:

think =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS=(PROTOCOL = tcp)(HOST= 192.168.227.128)(PORT= 1521)
     )
    )
  )

SID_LIST_think =
  (SID_LIST =
    (SID_DESC =
      (GLOBAL_DBNAME = orcl.oracle.com)
      (SID_NAME = orcl)
      (ORACLE_HOME = /u01/app/oracle/product/10.2.0/db_1)))

              注意事项:括号和空格要注意增补


          ② 配置tnsnames.ora

             参考文档b14213 123页example
             案例:

orcl =
  (DESCRIPTION =
    (ADDRESS=(PROTOCOL= tcp)(HOST= 192.168.227.128)(PORT= 1521))
    (CONNECT_DATA=(SERVICE_NAME= orcl.oracle.com))
 )


          ③ 配置createdb.sql脚本

             参考b14231 第77页
             案例:

CREATE DATABASE orcl 
USER SYS IDENTIFIED BY oracle 
USER SYSTEM IDENTIFIED BY oracle 
LOGFILE GROUP 1 ('/u01/app/oracle/oradata/orcl/redo01.log') SIZE 100M,
        GROUP 2 ('/u01/app/oracle/oradata/orcl/redo02.log') SIZE 100M,
        GROUP 3 ('/u01/app/oracle/oradata/orcl/redo03.log') SIZE 100M
MAXLOGFILES 5
MAXLOGMEMBERS 5
MAXLOGHISTORY 1
MAXDATAFILES 100
MAXINSTANCES 1
CHARACTER SET AL32UTF8	 
NATIONAL CHARACTER SET AL16UTF16
DATAFILE '/u01/app/oracle/oradata/orcl/system01.dbf' SIZE 600M REUSE
EXTENT MANAGEMENT LOCAL
SYSAUX DATAFILE '/u01/app/oracle/oradata/orcl/sysaux01.dbf' SIZE 450M REUSE
DEFAULT TABLESPACE users
DATAFILE '/u01/app/oracle/oradata/orcl/users01.dbf' size 50M REUSE 
DEFAULT TEMPORARY TABLESPACE temp
TEMPFILE '/u01/app/oracle/oradata/orcl/temp01.dbf'
SIZE 20M REUSE
UNDO TABLESPACE undotbs
DATAFILE '/u01/app/oracle/oradata/orcl/undotbs01.dbf'
SIZE 200M REUSE AUTOEXTEND ON MAXSIZE UNLIMITED;


          ④ 创建目录

[oracle@localhost admin]$ pwd
/u01/app/oracle/admin
[oracle@localhost admin]$ mkdir -p orcl/{a,b,c,u,dp}dump
[oracle@localhost flash_recovery_area]$ pwd
/u01/app/oracle/flash_recovery_area
[oracle@localhost admin]$ mkdir ORCL
[oracle@localhost dbs]$ pwd
/u01/app/oracle/product/10.2.0/db_1/dbs
[oracle@localhost dbs]$ ls                    
alert_orcl.log  hc_orcl.dat  hc_think.dat  initdw.ora  init.ora  snapcf_orcl.f


          ⑤ 创建密码文件

[oracle@localhost dbs]$ orapwd file=orapworcl password=oracle entries=5 


<