• oracle11g手工建库步骤



    平台:Linux AS release 5,Oracle11.1.0.7
    db_name = SBDB

    1. 设置环境变量
    export ORACLE_BASE=/opt/oracle
    export ORACLE_HOME=/opt/oracle/product/11.1.0/db_1
    export ORACLE_SID=SBDB

    2. 建初始化参数文件
    vi $ORACLE_HOME/dbs/initSBDB.ora
    #以下为建库必需参数
    db_name=SBDB
    db_unique_name = SBDB
    db_block_size=8192
    memory_target=500M
    undo_tablespace=UNDOTBS1
    db_recovery_file_dest='/opt/oracle/flash_recovery_area'
    db_recovery_file_dest_size=2G
    diagnostic_dest='/opt/oracle'
    control_files=(/opt/oracle/oradata/SBDB/control1.ctl,/opt/oracle/oradata/SBDB/control2.ctl,/opt/oracle/oradata/SBDB/control3.ctl)
    open_cursors=500
    processes=300
    compatible ='11.1.0'
    remote_login_passwordfile='EXCLUSIVE'

    3. 建立密码文件
    $ $ORACLE_HOME/bin/orapwd file=$ORACLE_HOME/dbs/orapwSBDB password=ocmb123 force=y

    4. 建立需要的目录
    mkdir -p $ORACLE_BASE/flash_recovery_area
    mkdir -p $ORACLE_BASE/oradata/SBDB


    5. 建spfile后启动实例并开始建库
    $ sqlplus /nolog
    SQL> CONNECT SYS AS SYSDBA

    SQL> create spfile from pfile; (会自动读取pfile:$ORACLE_HOME/dbs/init$ORACLE_SID.ora)
    SQL> startup nomount
    SQL> create database SBDB CONTROLFILE REUSE
    MAXINSTANCES 8 MAXDATAFILES 100
    MAXLOGHISTORY 1 MAXLOGFILES 16 MAXLOGMEMBERS 5
    character set UTF8 national character set UTF8
    logfile group 1 ('/opt/oracle/oradata/SBDB/redo1.log') size 200M reuse,
    group 2 ('/opt/oracle/oradata/SBDB/redo2.log') size 200M reuse,
    group 3 ('/opt/oracle/oradata/SBDB/redo3.log') size 200M reuse
    datafile '/opt/oracle/oradata/SBDB/system.dbf' size 1024M reuse autoextend on next 100M maxsize unlimited extent management local
    sysaux datafile '/opt/oracle/oradata/SBDB/sysaux.dbf' size 1024M autoextend on next 100M maxsize unlimited
    default temporary tablespace temp tempfile '/opt/oracle/oradata/SBDB/temp01.dbf' size 100M reuse autoextend on next 10M maxsize unlimited
    undo tablespace undotbs1 datafile '/opt/oracle/oradata/SBDB/undotbs1.dbf' size 100M reuse autoextend on next 10M maxsize unlimited
    USER SYS IDENTIFIED BY "ocmb123" USER SYSTEM IDENTIFIED BY "ocmb123";

    6. 运行数据字典脚本,其中catalog和catproc是必需的,其它可选:
    SQL> spool /opt/oracle/oradata/cat_SBDB.log
    SQL> @?/rdbms/admin/catalog.sql (建数据字典视图)
    SQL> @?/rdbms/admin/catproc.sql (建存储过程包)
    SQL> @?/sqlplus/admin/pupbld.sql (Required for SQL*Plus. Enables SQL*Plus to disable commands by user.)
    SQL> spool off
    执行完后检查/orahome/cat.log看看有什么不可接受的错误没有。


    7. 最后修改为归档模式并重启
    SQL> shutdown immediate;
    SQL> connect /as sysdba
    SQL> startup mount
    SQL> alter database archivelog;
    SQL> alter database open;
    重新编译所有失效过程:
    SQL> execute utl_recomp.recomp_serial();

    8、建立和配置EM(可选):
    SQL> @?/sysman/admin/emdrep/sql/emreposcre /oracle/product/10.2 SYSMAN oracle TEMP ON;
    SQL> alter user SYSMAN identified by "sysman" account unlock;
    SQL> alter user DBSNMP identified by "dbsnmp" account unlock;
    SQL> host emca -config dbcontrol db -silent -DB_UNIQUE_NAME SBDB -PORT 1521 -EM_HOME /opt/oracle/product/10.2.0/db_1/bin -LISTENER LISTENER -SERVICE_NAME SBDB.LK -SYS_PWD "oracle" -SID SBDB -ORACLE_HOME /opt/oracle/product/10.2.0/db_1 -DBSNMP_PWD "dbsnmp" -HOST "172.19.201.188" -LISTENER_OH /opt/oracle/product/10.2.0/db_1 -LOG_FILE /opt/oracle/oradata/SBDB/emConfig.log -SYSMAN_PWD "sysman";

    到此建库完毕!

  • 相关阅读:
    jQuery 选择器
    使用JQuery获取对象的几种方式
    多层架构+MVC+EF+AUTOFAC+AUTOMAPPER
    ASP.NET 2.0服务器控件开发的基本概念(转载)
    系统构架设计应考虑的因素
    超级面试题
    架构的点滴
    程序员的职业素养---转载
    imovie的快速入门
    实用的设计模式【二】——类的组织
  • 原文地址:https://www.cnblogs.com/caibird2005/p/3596544.html
Copyright © 2020-2023  润新知