View
224
Download
0
Category
Preview:
Citation preview
Manual Database Creation in Linux Machine
Screen Shot 1: Before ecreating the database let us check the free space available in the disk,df –h depending up on the size we can select one drive and we can create the database there it self
Screen Shot 2: make directories for databse contents like control file,redolog files anything,here we are creating a database testdb for that we are creating a folder testdb and sub-folders as adump bdump cdump udump and oradata to keep the files separate
Screen Shot 3: before going for next process lets check the permissions of the directory testdb and change the permissions if needed
Screen Shot 4: the permissions can be changed by using the command chown –R oracle:dba testdb
Screen Shot 5: now select ll command to see the permissions , now the permissions of the directory testdb is set to oracle and dba group
Before going for further database creation lets see the process of database,
After creating thedatabase the first stage it will go to NOMOUNT stage by using only P-FILE
So we need to create pfile,as we don’t know the contents inside the p-file we are going to copy a file from previous database and we are can
modify the required contents
As spfile is in binary format we are using pfile
DATABASE NO MOUNT
SPFILE or PFILE
Screen Shot 6: for pfile we are searching for the already existed database ,spfile or pfile reside on $ORACLE_HOME/dbs location
Screen Shot 7: Here we ca see the spfile which is spfilegun.ora
Screen Shot 8:here we are copying the file to testdb/oradata/ location
Screen Shot 9 : now open the spfile by using the command vi spfilegun.ora
Screen Shot 10 : In another terminal open another file as vi inittestdb.ora it is nothing but pfile which we are going to create
Screen Shot 11 : copy the required content from spfile and paste it in pfile and do necessary modifications and save & quiet the file by using
the commands :wq!
Screen Shot 12 : Now we can check the pfile is there in /testdb/oradata
Screen Shot 13 : the creation of pfile work is over we have to create .sql file which contains script copy – paste the script and do necessary
modifications and :wq!
Screen Shot 14 : Before going for sql lets set ORACLE_SID=testdb as our database name is testdb
Screen Shot 15 :start sql by using !sq and start into nomount phase by using pfile, the command for this is shown below
startup nomount pfile=’inittestdb.ora’;
Screen Shot 16 : after pfile then execute @sampledb.sql , after few minnutes we can seea message as database created
After creating the database we need to run two scripts
catalog.sql and catproc.sql
which these two reside on ORACLE_HOME(oracle s/w location)
these scripts will take a few minutes to complete
after running the scripts we register this newly created databse in oratab (cat /etc/oratab)
Recommended