ITPub博客

首页 > 数据库 > Oracle > 抛开dbca,手动建库步骤

抛开dbca,手动建库步骤

原创 Oracle 作者:zhcunique 时间:2021-02-25 08:12:59 0 删除 编辑
  1. 创建相关目录

    cd $ORACLE_BASE

    mkdir -p admin/SID_NAME/adump

    mkdir -p oradata/SID_NAME

  2. 创建口令文件

    cd $ORACLE_BASE/dbs

    orapwd file=orapwSID_NAME password=oracle entries=30

  3. 复用及修改参数文件

    cat init.ora|grep -v ^$|grep -v ^#>initSID_NAME.ora

    vi initSID_NAME.ora修改相应配置信息,最终效果如下:

    ======================================================================

    db_name='SID_NAME'

    memory_target=2048m

    processes=1500

    audit_file_dest='$ORACLE_BASE/admin/SID_NAME/adump'

    audit_trail='db'

    db_block_size=8192

    db_domain=''

    db_recovery_file_dest='$ORACLE_BASE/fast_recovery_area'

    db_recovery_file_dest_size=5G

    diagnostic_dest='$ORACLE_BASE'

    dispatchers='(PROTOCOL=TCP)(SERVICE=ORCLXDB)'

    open_cursors=500

    remote_login_passwordfile='EXCLUSIVE'

    undo_tablespace='UNDOTBS1'

    control_files=($ORACLE_BASE/oradata/SID_NAME/control01.ctl,$ORACLE_BASE/oradata/SID_NAME/control02.ctl)

    compatible='11.2.0'

    ======================================================================

  4. 创建建库脚本vi createmydb.sql

    CREATE DATABASE SID_NAME 

    USER SYS IDENTIFIED BY oracle
       USER SYSTEM IDENTIFIED BY oracle
       LOGFILE GROUP 1 ('/oradata/SID_NAME/redo01.log') SIZE 100M,
               GROUP 2 ('/oradata/SID_NAME/redo02.log') SIZE 100M,
               GROUP 3 ('/oradata/SID_NAME/redo03.log') SIZE 100M
       MAXLOGFILES 50
       MAXLOGMEMBERS 5
       MAXLOGHISTORY 1
       MAXDATAFILES 100
       MAXINSTANCES 1
       CHARACTER SET ZHS16GBK
       NATIONAL CHARACTER SET AL16UTF16
       DATAFILE '/oradata/SID_NAME/system01.dbf' SIZE 325M REUSE
       EXTENT MANAGEMENT LOCAL
       SYSAUX DATAFILE '/oradata/SID_NAME/sysaux01.dbf' SIZE 325M REUSE
       DEFAULT TEMPORARY TABLESPACE tempts1
          TEMPFILE '/oradata/SID_NAME/temp01.dbf'
          SIZE 20M REUSE
       UNDO TABLESPACE undotbs1
          DATAFILE '/oradata/SID_NAME/undotbs01.dbf'
          SIZE 200M REUSE AUTOEXTEND ON MAXSIZE UNLIMITED

  5. 创建SPFILE,启动数据库,执行建库脚本

    export ORACLE_SID=SID_NAME

    sqlplus / as sysdba

    create spfile from pfile

    startup nomount

    @$pwd/createmydb.sql

  6. 执行必选预置脚本

    @?/rdbms/admin/catalog.sql

    @?/rdbms/admin/catproc.sql

    conn system/oracle

    @?/rdbms/admin/pupbld.sql

  7. 建库完成

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/69994536/viewspace-2759187/,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2021-02-04

  • 博文量
    63
  • 访问量
    460010