一步一步学习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 


          ⑥ 配置pfile

[oracle@localhost dbs]$ cp -p init.ora  initorcl.ora
[oracle@localhost dbs]$ grep -v '^#' initorcl.ora  | grep -v '^$' > initorcl.ora.test 
[oracle@localhost dbs]$ mv initorcl.ora.test  initorcl.ora

             案例:

db_name= orcl
db_domain= oracle.com
db_files = 100
db_file_multiblock_read_count = 128 
processes = 1000 
parallel_max_servers = 40
open_cursors= 400 
global_names = false 
control_files = '/u01/app/oracle/oradata/orcl/control01.ctl','/u01/app/oracle/oradata/orcl/control02.ctl','/u01/app/oracle/oradata/orcl/control03.ctl'
sga_target = 900m
sga_max_size = 900m
pga_aggregate_target= 450M
db_recovery_file_dest = '/u01/app/oracle/flash_recovery_area'
db_recovery_file_dest_size = 2G
undo_tablespace= undotbs
undo_management= auto
undo_retention = 900
log_archive_dest_10='location=use_db_recovery_file_dest' 


          ⑦ 

     sqlplus /nolog
     conn / as sysdba
     create spfile from pfile;
     startup
     @createdb.sql


          ⑧ 运行4个包

     @?/rdbms/admin/catalog.sql
     @?/rdbms/admin/catproc.sql
     @?/rdbms/admin/dbmspool.sql
     connect system/oracle
     @?/sqlplus/admin/pupbld.sql


    小结:

           mysql一条create database xx就可以创建一个数据库,但oracle则不行。以上步骤只是个测试版,后续还会把更完善的步骤、和创建过程中相关错误呈上。

你可能感兴趣的:(一步一步学习oracle手工建库(beta版))