Steps involved in creating a database manually.

Sunday, September 19, 2010 ·

1. Decide on the name of your instance
    -In windows => set ORACLE_SID=db1
    -In Linux      => export ORACLE_SID=db1

2. a) Create the Initialization parameter file (pfile)
         -Copy an existing pfile and make neccessary changes.

    b) Decide on which directory your new database is going to be on, and create the neccessary directories based on the pfile.


3. Create the new instance and the password file.
    -oradim -new -sid db0001 (required only on windows, since services should be created for Oracle to operate)
    -orapwd file=<path> password=xxx entries=XXX force=y

4. start the created instance
      -startup nomount pfile=<pfile destination>

5. Issue the create database statement.

CREATE DATABASE db1
   LOGFILE GROUP 1 'C:\db1\oradata\redo01.log' SIZE 30M,
                    GROUP 2 'C:\db1\oradata\redo02.log' SIZE 30M
             MAXLOGFILES 5
             MAXLOGMEMBERS 5
             MAXDATAFILES 100
             MAXINSTANCES 1
   CHARACTER SET US7ASCII
   NATIONAL CHARACTER SET AL16UTF16
   DATAFILE 'C:\db1\oradata\system01.dbf' SIZE 325M REUSE
   SYSAUX DATAFILE 'C:\db1\oradata\sysaux01.dbf' SIZE 325M REUSE
   DEFAULT TABLESPACE tbs1
            DATAFILE 'C:\db1\oradata\tbs01.dbf' SIZE 50M REUSE
   DEFAULT TEMPORARY TABLESPACE temp
            TEMPFILE 'C:\db1\oradata\temp01.dbf' SIZE 100M REUSE
   UNDO TABLESPACE undotbs
            DATAFILE 'C:\db1\oradata\undotbs01.dbf' SIZE 200M REUSE
            AUTOEXTEND ON
            MAXSIZE UNLIMITED;


6. Create the server parameter file (recommended)
    -create spfile=<location at database directory> from pfile=<location of pfile>

         Note: During database startup the default location where the parameter file is read is:
                  $ORACLE_HOME/dbs in Linux
                  %ORACLE_HOME%/database in windows.
                   That is the reason why server parameter file is created in this directory.



7. Run the relevent scripts after database creation
    -catalog.sql  --> to build the data dictionary views.
    -catproc.sql  --> to build pl/sql packages.

1 comments:

pradeep said...
September 20, 2010 at 3:24 AM  

nice work men..................

Search This Blog

About Me

I am an Oracle certified DBA and Apps DBA, totally loving my field of work. I have created this blog in order to save my studies in my field and share it with all.

View Asif Muhammad's profile on LinkedIn

Which is the most featurized database???

Followers

Site Traffic