Creating database in oracle

In oracle, database creation can be done in two ways. We can create database automatically along with the installation and the other way is to create the database Manually. Automatic creation is the easiest way.Because all  files and folders  are maintained under the ORACLE_HOME directory,But for administrating all the things  as a adminstrator most of the people  prefer to create database by manaually.Let me explain, how to create the database manaully.

Here are  the steps to create database manually,

1)Create a folder with the name of database name.

2)Create five folder under the database folder as pfile, bdump, udump,cdump, control.

3)Create a file name called init.ora in the pfile folder.

4) Create init.ora file using the following paramter and  also don’t forget to save along with its extension.

db_name=<INSTANCE_NAME>
compatible=10.2.0
background_dump_dest='<drive>:\<foldername>\bdump\’
core_dump_dest='<drive>:\<foldername>\cdump\’
user_dump_dest='<drive>:\<foldername>’
control_files='<drive>:\<foldername>\control.ctl’
remote_login_passwordfile= exclusive
sga_target=700m

5)Connect to the sql prompt using sqlplus.

SQL> Conn sys/sys as sysdba.

6)Before creating the database.Intilize the memory using the pfile at no mount stage using

SQL>startup pfile='<drive>:\<foldername>\pfile\init<dbname>.ora’ nomount.

7)And then Create the database using this statements.Edit the statement according to your creation diretory.
CREATE DATABASE   <SID>
    maxdatafiles  1021
    maxinstances  1
    maxlogfiles   8
    maxlogmembers 4
    CHARACTER SET WE8ISO8859P15
    NATIONAL CHARACTER SET UTF8
    DATAFILE ‘<drive>:\oradata\<SID>\system01.dbf’ SIZE 2000M
    REUSE
    AUTOEXTEND ON
   NEXT 10240K
   MAXSIZE UNLIMITED
   EXTENT MANAGEMENT LOCAL
   SYSAUX DATAFILE ‘<drive>:\oradata\<SID>\sysaux01.dbf’ SIZE 120M
   REUSE
  AUTOEXTEND ON
  NEXT  10240K
  MAXSIZE UNLIMITED
  LOGFILE GROUP 1 (‘<drive>:\oradata\<SID>\redo01.log’) SIZE 100M,
        GROUP 2 (‘<drive>:\oradata\<SID>\redo02.log’) SIZE 100M,
        GROUP 3 (‘<drive>:\oradata\<SID>\redo03.log’) SIZE 100M;

It will automatically comes to the open state once when the creation gets completed.Check with the below query to conform it.

SQL> Select open_mode from v$database.

It show that the database is in read-write mode.

I hope it will be more useful to create database manaually .

Advertisements

About PARTHASARATHY.G
I am working as an Associate DBA in fugo consulting.

One Response to Creating database in oracle

  1. vishal goyal says:

    thanx for explaining it’s really very helpful

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: