Manual Database Creation in Oracle 10g On Linux, AIX, Sun Solarise, UNIX



Simple manual database creation in 10g


In Oracle we can create database through manually and GUI(DBCA) as well but in normal case most of the DBA's prefer to create database with manual only. I had seen some DBA's they are generating the scripts through DBCA and executing manually that is also good at least they come to know what oracle doing internally before creating the database and what type scripts it is executing.  This is very important to know who are working as a DBA's.



 Step : 1

Create the environment file or .bash_profile

]$ vi test.env   or   .bash_profile

export  ORACLE_SID = test
export ORACLE_HOME = /oraeng/app/oracle/product/10.2.0
export ORACLE_BASE  = /oraeng/app/oracle/product
export  PATH = $ORACLE_HOME/bin:PATH:.

:wq!

  Step :2

Change or create the parameter file in $ORACLE_HOME/dbs


$ cd  $ORACLE_HOME/dbs
dbs $   cp init.ora  inittest.ora
dbs $  vi  inittest.ora

db_name = test
instance_name = test
shared_pool_size = 64m
control_files =  /disk1/oradata/test/control.ctl
core_dump_dest = /disk1/oradata/test/cdump
user_dump_dest = /disk1/oradata/test/bdump
background_dump_dest = /disk1/oradata/test/bdump

undo_tablespace = undotbs
undo_retention = 900(15m default) 7200
undo_management = auto

compatibility 10.2.0

:wq!



  Step :3

Create necessary directories

$ mkdir –p /disk1/oradata/test
$ cd   /disk1/oradata/test
Test $ mkdir bdump cdump udump


  Step :4

Create Database script

]$ vi create.sql
 
create database test
datafile ‘/disk1/oradata/test/system.dbf’ size 170m autoextend on
sysaux
datafile ‘/disk1/oradata/test/sysaux.dbf’ size 100m
default tablespace userdata
datafile ‘/disk1/oradata/test/userdata.dbf’ size 50m
default temporary tablespace temp
tempfile ‘/disk1/oradata/test/temp.dbf’ size 50m
undo tablespace undotbs
datafile ‘/disk1/oradata/test/undo.dbf’ size 50m
logfile
group 1(‘/disk1/oradata/test/redo1a.log’) size 4m,
group 2(‘/disk1/oradata/test/redo1b.log’) size 4m;

:wq!

Step :5

create run.sql script for all data dictionary views  procedures. packages and default users profiles

]$ vi run.sql

@$ORACLE_HOME/rdbms/admin/catalog.sql
@$ORACLE_HOME/rdbms/admin/catproc.sql
Connect system/manager
@$ORACLE_HOME/sqlplus/admin/pupbld.sql

:wq!


$ conn / as sysdba

>  startup nomount

>  @create.sql

>  @run.sql


VIEWS :   V$DATABASE    V$INSTANCE

Newer Post Older Post

Leave a Reply