Saturday, 29 January 2011

Creating Database manually

Note: This article is biased towards Windows

Step 1: Specifying the Instance's SID
I:\app\WELCOME\product\11.1.0>set ORACLE_SID=PREETI

Step 2: Creating the initialization parameter file.

db_name='PREETI'
memory_target=1G
processes = 150
#audit_file_dest='<ORACLE_BASE>/admin/orcl/adump'
#audit_trail ='db'
db_block_size=8192
#db_domain=''
#db_recovery_file_dest='<ORACLE_BASE>/flash_recovery_area'
#db_recovery_file_dest_size=2G
diagnostic_dest='I:\app\WELCOME\oradata\PREETI'
#dispatchers='(PROTOCOL=TCP) (SERVICE=ORCLXDB)'
open_cursors=300 
remote_login_passwordfile='EXCLUSIVE'
undo_tablespace='UNDOTBS1'
os_authent_prefix=''
undo_management=auto
undo_tablespace=undotbs1
undo_retention=900
control_files = (I:\app\WELCOME\oradata\PREETI\control\control1.ctl,
                 I:\app\WELCOME\oradata\PREETI\control\control2.ctl)
compatible ='11.1.0'

Step 3: Starting the Instance

I:\app\WELCOME\product\11.1.0\db_1>sqlplus / as sysdba

SQL*Plus: Release 11.1.0.6.0 - Production on Sat Jan 29 20:45:06 2011

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

Connected to an idle instance.
SQL> startup nomount pfile=I:\app\WELCOME\product\11.1.0\db_1\dbs\initPREETI.ora

ORACLE instance started.

Total System Global Area  644468736 bytes
Fixed Size                  1335108 bytes
Variable Size             176160956 bytes
Database Buffers          461373440 bytes
Redo Buffers                5599232 bytes

Step 4: Database Creation
SQL>   create database PREETI
 logfile    group 1 ('I:\app\WELCOME\oradata\PREETI\redo\redo1a.log', 
                            'I:\app\WELCOME\oradata\PREETI\redo\redo1b.log') size 10M,
              group 2 ('I:\app\WELCOME\oradata\PREETI\redo\redo2a.log',
                            'I:\app\WELCOME\oradata\PREETI\redo\redo2b.log') size 10M
 national character set utf8
 datafile                'I:\app\WELCOME\oradata\PREETI\datafiles\system.dbf'
           size 50M
           autoextend on
           next 10M
           maxsize UNLIMITED
 undo tablespace undotbs1
          datafile       'I:\app\WELCOME\oradata\PREETI\datafiles\undotbs1.dbf'
          size 10M
 default temporary tablespace temp
          tempfile       'I:\app\WELCOME\oradata\PREETI\datafiles\temp.dbf'
          size 10M
 sysaux datafile      'I:\app\WELCOME\oradata\PREETI\datafiles\sysaux.dbf'
          size 10M
          autoextend on
          next 10M
          maxsize UNLIMITED;

Database created.

Step 5: Completing the Database Creation
SQL> @?/rdbms/admin/catalog.sql
PL/SQL procedure successfully completed.
SQL> @?/rdbms/admin/catproc.sql
SQL> @?/rdbms/admin/pupbld.sql

Errors while creating the Database:
ORA-01092: ORACLE instance terminated. Disconnection forced
Solution: the alert log should be checked for the errors occurred during the database creation and act accordingly.

No comments:

Post a Comment