zoukankan      html  css  js  c++  java
  • Oracle10g 之手工创建数据库

    参照Oracle官方文档手工创建数据库

    Step 1: Decide on Your Instance Identifier (SID)
    #>export ORACLE_SID=pp

    Step 2: Establish the Database Administrator Authentication Method
    Create pwfile
    #>orapwd file=/usr/local/ora10g/oracle/product/10.2.0/db/dbs/orapwpp password=manager force=y
    Step 3: Create the Initialization Parameter File
    Content of init.ora
    ##############################################################################
    # Copyright (c) 1991, 2001, 2002 by Oracle Corporation
    ##############################################################################

    ###########################################
    # Archive
    ###########################################
    log_archive_dest_1='LOCATION=/var/oradata/arc_log'
    log_archive_format=%t_%s_%r.dbf

    ###########################################
    # Cache and I/O
    ###########################################
    db_block_size=8192
    db_file_multiblock_read_count=16

    ###########################################
    # Cursors and Library Cache
    ###########################################
    open_cursors=300

    ###########################################
    # Database Identification
    ###########################################
    db_domain="kk.xxb.cn"
    db_name=pp

    ###########################################
    # Diagnostics and Statistics
    ###########################################
    background_dump_dest=/usr/local/ora10g/admin/pp/bdump
    core_dump_dest=/usr/local/ora10g/admin/pp/cdump
    user_dump_dest=/usr/local/ora10g/admin/pp/udump

    ###########################################
    # File Configuration
    ###########################################
    control_files=("/var/oradata/pp/control01.ctl", "/var/oradata/pp/control02.ctl", "/var/or
    adata/pp/control03.ctl")
    db_recovery_file_dest=/var/oradata/flash_recovery_area
    db_recovery_file_dest_size=2147483648

    ###########################################
    # Job Queues
    ###########################################
    job_queue_processes=10

    ###########################################
    # Miscellaneous
    ###########################################
    compatible=10.2.0.1.0

    ###########################################
    # NLS
    ###########################################
    nls_language="SIMPLIFIED CHINESE"
    nls_territory="CHINA"

    ###########################################
    # Processes and Sessions
    ###########################################
    processes=150

    ###########################################
    # SGA Memory
    ###########################################
    sga_target=285212672
    ###########################################
    # Security and Auditing
    ###########################################
    audit_file_dest=/usr/local/ora10g/admin/pp/adump
    remote_login_passwordfile=EXCLUSIVE

    ###########################################
    # Shared Server
    ###########################################
    dispatchers="(PROTOCOL=TCP) (SERVICE=ppXDB)"

    ###########################################
    # Sort, Hash Joins, Bitmap Indexes
    ###########################################
    pga_aggregate_target=94371840

    ###########################################
    # System Managed Undo and Rollback Segments
    ###########################################
    undo_management=AUTO
    undo_tablespace=UNDOTBS

    Step 4: Connect to the Instance
    #>sqlplus /nolog
    sqlplus>conn / as sysdba
    Step 5: Create a Server Parameter File (Recommended)
    sqlplus>create spfile='/usr/local/ora10g/oracle/product/10.2.0/db/dbs/spfilepp.ora' from
                    pfile='/usr/local/ora10g/admin/pp/pfile/init.ora';
    Step 6: Start the Instance
    sqlplus>startup nomount
    Step 7: Issue the CREATE DATABASE Statement
    sqlplus>CREATE DATABASE pp
         USER SYS IDENTIFIED BY manager
         USER SYSTEM IDENTIFIED BY manager
         LOGFILE GROUP 1 ('/var/oradata/pp/redo01.log') SIZE 100M,
          GROUP 2 ('/var/oradata/pp/redo02.log') SIZE 100M,
          GROUP 3 ('/var/oradata/pp/redo03.log') SIZE 100M
         MAXLOGFILES 16
         MAXLOGMEMBERS 5
         MAXLOGHISTORY 1
         MAXDATAFILES 100
         MAXINSTANCES 5
         CHARACTER SET US7ASCII
         NATIONAL CHARACTER SET AL16UTF16
         DATAFILE '/var/oradata/pp/system01.dbf' SIZE 325M REUSE
         EXTENT MANAGEMENT LOCAL
         SYSAUX DATAFILE '/var/oradata/pp/sysaux01.dbf' SIZE 325M REUSE
         DEFAULT TABLESPACE USERS
            DATAFILE '/var/oradata/pp/users01.dbf'
            SIZE 200M REUSE AUTOEXTEND ON NEXT 50M MAXSIZE 1024M
         DEFAULT TEMPORARY TABLESPACE TEMP
            TEMPFILE '/var/oradata/pp/temp01.dbf'
            SIZE 100M REUSE
         UNDO TABLESPACE UNDOTBS
            DATAFILE '/var/oradata/pp/undotbs01.dbf'
            SIZE 200M REUSE AUTOEXTEND ON NEXT 50M MAXSIZE 1024M;
    optional operations
    sqlplus>alter system enable restricted session;
    sqlplus>select sid, program, serial#, username from v$session;
    sqlplus>alter database character set INTERNAL_CONVERT ZHS16GBK;
    sqlplus>alter database national character set INTERNAL_CONVERT AL16UTF16;
    sqlplus>alter user sys identified by "&&sysPassword";
    sqlplus>alter user system identified by "&&systemPassword";
    sqlplus>alter system disable restricted session;
    sqlplus>alter tablespace users force logging;
    Step 8: Create Additional Tablespaces
           
    sqlplus>-- create a tablespace for indexes, separate from user tablespace
    sqlplus>CREATE TABLESPACE indx LOGGING
           DATAFILE '/var/oradata/pp/indx01.dbf'
           SIZE 25M REUSE AUTOEXTEND ON NEXT 1280K MAXSIZE 1024M
           EXTENT MANAGEMENT LOCAL;
    Step 9: Run Scripts to Build Data Dictionary Views
    sqlplus>@/usr/local/ora10g/oracle/product/10.2.0/db/rdbms/admin/catalog.sql
    sqlplus>@/usr/local/ora10g/oracle/product/10.2.0/db/rdbms/admin/catproc.sql
    Step 10: Run Scripts to Install Additional Options (Optional)
    Step 11: Back Up the Database.

  • 相关阅读:
    Training: WWW-Robots
    Training: Stegano I
    Encodings: URL
    利用Nginx实现域名转发 不修改主机头
    C++删除目录和复制目录函数
    获取文件大小的函数
    日志打印函数
    拉起上级目录程序
    安卓TabHost页面
    有趣的人形时钟
  • 原文地址:https://www.cnblogs.com/princessd8251/p/2983035.html
Copyright © 2011-2022 走看看