Forgot your password?    
+ Reply to Thread
Results 1 to 1 of 1

Thread: Create a Database Manually using Create Database Script

  1. #1
    Expert Oracle Administrator
    Join Date
    Oct 2011
    Location
    New Delhi, India
    Posts
    427

    Create a Database Manually using Create Database Script

    Following is the Process to Create a database Manually with minimum requirements the minimum number of datafiles.

    Here , we are creating a Database with 4 Tablespaces (SYSTEM,SYSAUX,UNDO and TEMP) each having one datafile.
    Also we are running only the mandatory scripts - catalog.sql and catproc.sql .
    We are not running scripts for additional Database Feature Requirements.

    1) Create the Initialization Parameter file for the Database
    in the $ORACLE_HOME/dbs directory

    [ora11g@dbaquest dbs]$ vi inittestdb.ora

    a) Make sure that the db_name is set to the database you want to create :
    *.db_name='testdb'

    b) Ensure that one or more of the following parameters are set to the values of the new database you intend to create :

    control_files='../control01.ctl','../control02.ctl'
    background_dump_dest
    user_dump_dest
    audit_file_dest
    log_archive_dest_1
    db_recovery_file_dest

    If its and 11g Database , then :

    diagnostic_dest

    2) Create the respective directories , for the locations as specified by the init parameters :

    control_files
    background_dump_dest
    user_dump_dest
    audit_file_dest
    log_archive_dest_1
    db_recovery_file_dest

    eg : In my case ,

    to create the directory for the audit_dump_dest , I provided :
    [ora11g@dbalounge dbs]$ mkdir -p /u01/oracle/ora11g/admin/adump

    to create the directory for the control_files , I provided :
    [ora11g@dbalounge dbs]$ mkdir -p /u01/oracle/ora11g/oradata/testdb

    3) Set the ORACLE_SID to the Instance name of the new database
    [ora11g@dbalounge dbs]$ export ORACLE_SID=testdb

    Also , make sure that the ORACLE_HOME is right
    Ensure that the PATH environment variable is set properly

    4) Create the Database

    [ora11g@dbalounge dbs]$ sqlplus

    SQL*Plus: Release 11.2.0.1.0 Production on Sun Dec 25 15:53:08 2011

    Copyright (c) 1982, 2009, Oracle. All rights reserved.

    Enter user-name: / as sysdba
    Connected to an idle instance.

    SQL> startup nomount;
    ORACLE instance started.

    Total System Global Area 313159680 bytes
    Fixed Size 2212936 bytes
    Variable Size 234884024 bytes
    Database Buffers 71303168 bytes
    Redo Buffers 4759552 bytes

    SQL> create database testdb
    logfile group 1 ('/u01/oracle/ora11g/oradata/testdb/redo1.log') size 10M,
    group 2 ('/u01/oracle/ora11g/oradata/testdb/redo2.log') size 10M,
    group 3 ('/u01/oracle/ora11g/oradata/testdb/redo3.log') size 10M
    character set WE8ISO8859P1
    national character set utf8
    datafile ''/u01/oracle/ora11g/oradata/testdb/system_01.dbf'
    size 100M autoextend on
    next 50M maxsize unlimited
    extent management local
    sysaux datafile ''/u01/oracle/ora11g/oradata/testdb/sysaux_01.dbf'
    size 20M autoextend on
    next 10M maxsize unlimited
    undo tablespace undotbs1
    datafile ''/u01/oracle/ora11g/oradata/testdb/undotbs1_01.dbf' size 10M
    default temporary tablespace temp
    tempfile '/u01/oracle/ora11g/oradata/testdb/temp_01.dbf' size 10M; 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17

    Database created.

    SQL>
    SQL> select name , open_mode from v$database;

    NAME OPEN_MODE
    --------- --------------------
    TESTDB READ WRITE

    5) Run the scripts for creation of the Data Dictionary and Package Creation

    [ora11g@dbalounge dbs]$ cd $ORACLE_HOME/rdbms/admin
    [ora11g@dbalounge dbs]$ sqlplus

    SQL*Plus: Release 11.2.0.1.0 Production on Sun Dec 25 15:57:35 2011

    Copyright (c) 1982, 2009, Oracle. All rights reserved.

    Enter user-name: / as sysdba

    Connected to:
    Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options

    SQL> @catalog.sql
    ...

    SQL> @catproc.sql
    ....

+ Reply to Thread

Similar Threads

  1. Create single instance standby database for RAC Database
    By devesh_ocp in forum DataGuard Setup and Management
    Replies: 0
    Last Post: 04-26-2012, 11:27 AM
  2. Create Database Template Using DBCA.
    By ajaychandi in forum Database Installation,Upgrades,Migration,Patching and Cloning
    Replies: 0
    Last Post: 04-18-2012, 05:49 PM
  3. Replies: 0
    Last Post: 01-10-2012, 06:22 PM
  4. Replies: 0
    Last Post: 01-01-2012, 01:33 PM
  5. Create Database Script
    By Hemant in forum Database Scripts
    Replies: 0
    Last Post: 12-25-2011, 03:10 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

DBA Lounge (P) Ltd. deals in Oracle Technologies on Consulting, Resourcing, Corporate Training


Online and corporate training available on Oracle Database 11g, Oracle 11g Real Application Cluster (RAC), Oracle Applications 11i/R12, Oracle Fusion Middleware 11g, Oracle Identity Management-OIM, Oracle Internet Directory 11g-OID, Oracle Business Intelligence Enterprise Edition-OBIEE, Oracle Golden Gate, Oracle Access Management-OAM, Oracle Internet Directory-ODS, Oracle Identity Analytics Architecture-OIA Statistics