指令碼建立Oracle的資料庫

simplewp發表於2012-09-21

oracle建立資料庫可以採取dbca,也可採取手動指令碼建立;版本:oracle10.2.1,手動指令碼建立資料庫的方法總結如下:

注意:相關目錄必須先建立,將相關的目錄改為自己的目錄即可;

Step 1: Decide on Your Instance Identifier (SID)
 
Step 2: Establish the Database Administrator Authentication Method
 
Step 3: Create the Initialization Parameter File and admin directory
            db_block_size=8192
            db_file_multiblock_read_count=16
            open_cursors=300
            db_domain=""
            db_name=orcl
            background_dump_dest=/u01/app/oracle/admin/orcl/bdump
            core_dump_dest=/u01/app/oracle/admin/orcl/cdump
            user_dump_dest=/u01/app/oracle/admin/orcl/udump
            control_files=("/u01/app/oracle/oradata/orcl/control01.ctl", 
                           "/u01/app/oracle/oradata/orcl/control02.ctl", 
                           "/u01/app/oracle/oradata/orcl/control03.ctl")
            db_recovery_file_dest=/u01/app/oracle/flash_recovery_area
            db_recovery_file_dest_size=2147483648
            compatible=10.2.0.1.0
            processes=150
            sga_target=283115520
            audit_file_dest=/u01/app/oracle/admin/orcl/adump
            remote_login_passwordfile=EXCLUSIVE
            pga_aggregate_target=94371840
            undo_management=AUTO
            undo_tablespace=UNDOTBS1
 
   Step 4: Start the Instance 
    STARTUP NOMOUNT
 
   Step 5: Issue the CREATE DATABASE Statement
 
     CREATE DATABASE "orcl"
       MAXINSTANCES 8
       MAXLOGHISTORY 1
       MAXLOGFILES 16
       MAXLOGMEMBERS 3
       MAXDATAFILES 100
       DATAFILE '/u01/app/oracle/oradata/orcl/system01.dbf' SIZE 300M
       EXTENT MANAGEMENT LOCAL
       SYSAUX DATAFILE '/u01/app/oracle/oradata/orcl/sysaux01.dbf' SIZE 120M 
       SMALLFILE DEFAULT TEMPORARY TABLESPACE TEMP TEMPFILE '/u01/app/oracle/oradata/orcl/temp01.dbf' SIZE 20M 
       SMALLFILE UNDO TABLESPACE "UNDOTBS1" DATAFILE '/u01/app/oracle/oradata/orcl/undotbs01.dbf' SIZE 200M 
       CHARACTER SET WE8ISO8859P1
       NATIONAL CHARACTER SET AL16UTF16
       LOGFILE GROUP 1 ('/u01/app/oracle/oradata/orcl/redo01.log') SIZE 51200K,
               GROUP 2 ('/u01/app/oracle/oradata/orcl/redo02.log') SIZE 51200K,
               GROUP 3 ('/u01/app/oracle/oradata/orcl/redo03.log') SIZE 51200K
      USER SYS IDENTIFIED BY "oracle" USER SYSTEM IDENTIFIED BY "oracle";
 
    Step 6: Run Scripts to Build Data Dictionary Views
       CONNECT SYS/password AS SYSDBA
       @$ORACLE_HOME/rdbms/admin/catalog.sql
       @$ORACLE_HOME/rdbms/admin/catproc.sql
 

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

相關文章