07
Feb
07

How to create a Database in Oracle 9i manually

Note: Instructions are for Windows XP

1. Create a SID for your new Database

set ORACLE_SID={SID};

Note: Where {SID} is any unique SID created by you.

2. Create suitable database directories within oracle directory.

make folders udump,cdump,bdump within admin/{SID} (optional for logs)
make folder {SID} within oradata

3. Create a initialization parameter file and name it as
init{SID}.ora. Drop this file in

%ORACLE_HOME%/database folder. Contents could look like this.
(Settings and paths will

vary)

# Cache and I/O
DB_BLOCK_SIZE=4096
DB_CACHE_SIZE=20971520

# Cursors and Library Cache
CURSOR_SHARING=SIMILAR
OPEN_CURSORS=300

# Diagnostics and Statistics
BACKGROUND_DUMP_DEST=/oracle/admin/{SID}/bdump
CORE_DUMP_DEST=/oracle/admin/{SID}/cdump
TIMED_STATISTICS=TRUE
USER_DUMP_DEST=/oracle/admin/{SID}/udump

# Control File Configuration
CONTROL_FILES=(“/oracle/oradata/{SID}/control01.ctl”,
“/oracle/oradata/{SID}/control02.ctl”,
” /oracle/oradata/{SID}/control03.ctl”)

# Archive
LOG_ARCHIVE_DEST=’/oracle/oradata/{SID}/archive’
LOG_ARCHIVE_FORMAT=%t_%s.dbf
LOG_ARCHIVE_START=TRUE

# Shared Server
# Uncomment and use first DISPATCHES parameter below when your listener is
# configured for SSL
# (listener.ora and sqlnet.ora)
# DISPATCHERS = “(PROTOCOL=TCPS)(SER=MODOSE)”,
# “(PROTOCOL=TCPS)(PRE=oracle.aurora.server.SGiopServer)”
DISPATCHERS =”(PROTOCOL=TCP)(SER=MODOSE)”,
“(PROTOCOL=TCP)(PRE=oracle.aurora.server.SGiopServer)”,
“(PROTOCOL=TCP)”

# Miscellaneous
COMPATIBLE=9.2.0
DB_NAME={SID}

# Distributed, Replication and Snapshot
DB_DOMAIN=us.oracle.com
REMOTE_LOGIN_PASSWORDFILE=EXCLUSIVE

# Network Registration
INSTANCE_NAME={SID}

# Pools
JAVA_POOL_SIZE=31457280
LARGE_POOL_SIZE=1048576
SHARED_POOL_SIZE=52428800

# Processes and Sessions
PROCESSES=150

# Redo Log and Recovery
FAST_START_MTTR_TARGET=300

# Resource Manager
RESOURCE_MANAGER_PLAN=SYSTEM_PLAN

# Sort, Hash Joins, Bitmap Indexes
SORT_AREA_SIZE=524288

# Automatic Undo Management
UNDO_MANAGEMENT=AUTO
UNDO_TABLESPACE=undotbs

4. Create a password file with name PWD{SID}.ora and place in
%ORACLE_HOME%/database folder.

Create the password file using the following command:

orapwd file={path\filename} password=oracle

5. Create an instance of this database

oradim -new – -sid {sid}

6. Start SQLPLUS using the following command

sqlplus /nolog

7. Connect to instance of database

connect / as sysdba

8. Startup the instance without mounting

startup nomount

9. Run create database SQL statement

CREATE DATABASE {sid}
USER SYS IDENTIFIED BY pz6r58
USER SYSTEM IDENTIFIED BY y1tz5p
LOGFILE GROUP 1 (‘/oracle/oradata/{sid}/redo01.log’) SIZE 100M,
GROUP 2 (‘/oracle/oradata/{sid}/redo02.log’) SIZE 100M,
GROUP 3 (‘/oracle/oradata/{sid}/redo03.log’) SIZE 100M
MAXLOGFILES 5
MAXLOGMEMBERS 5
MAXLOGHISTORY 1
MAXDATAFILES 100
MAXINSTANCES 1
CHARACTER SET US7ASCII
NATIONAL CHARACTER SET AL16UTF16
DATAFILE ‘/oracle/oradata/{sid}/system01.dbf’ SIZE 325M REUSE
EXTENT MANAGEMENT LOCAL
DEFAULT TEMPORARY TABLESPACE tempts1
TEMPFILE ‘/oracle/oradata/{sid}/temp01.dbf’
SIZE 20M REUSE
UNDO TABLESPACE undotbs
DATAFILE ‘/oracle/oradata/{sid}/undotbs01.dbf’
SIZE 200M REUSE AUTOEXTEND ON NEXT 5120K MAXSIZE UNLIMITED;


11 Responses to “How to create a Database in Oracle 9i manually”


  1. 1 bAphOmeT
    February 8, 2007 at 17:00

    you should have posted this a year back buddy. would’ve saved a load of time on my mini project. hehehe

  2. 2 Anonymous
    March 8, 2007 at 21:11

    Hi,

    Thanks a lot.
    I appreciate your effort.

    Regards,
    Shraddha

  3. 3 onkar
    October 10, 2007 at 16:49

    Nice code..plz give more
    Thank you…

  4. 4 Renuka
    February 11, 2008 at 20:22

    Hi ,

    thank you for u code.

    Regards
    Renuka

  5. February 12, 2008 at 05:28

    @Renuka

    You are welcome

  6. June 24, 2008 at 11:24

    i it good to hv this article on net it helps me alot

  7. June 24, 2008 at 11:44

    @Ankit

    I will make sure it stays that way.

  8. April 2, 2009 at 23:14

    This Article was good to create new DB to me in my PC.

    Thanks Keep to post like this important articles.

    Regards

    Ramya

    ORACLE PLSQL
    ramyaselvi16@gmail.com

  9. 10 ashish
    April 27, 2009 at 22:14

    This has really helped a lot .

    This you so much for all this good work.

  10. 11 Akshi
    June 3, 2009 at 10:05

    Thaaaaaaaaaaaaaaaaank
    uuuuuuuuuu
    verrrrrrrrrrry
    muchhhhhhh


Leave a Reply




Blog Stats

  • 38,331 pings

Pages

 

February 2007
M T W T F S S
« Jan   Mar »
 1234
567891011
12131415161718
19202122232425
262728