Monday, February 15, 2016

STEPS TO CREATE ORACLE DATABASE 10g MANUALLY ON LINUX

                 This article shows you steps to create a database manually on Linux.
Step 1:


First create all the necessary directories. Followings are my directories:

cd /u01
mkdir oradata  
cd oradata
mkdir TEST

cd /u01
mkdir admin
cd admin
mkdir TEST 
cd TEST
mkdir bdump
mkdir cdump 
mkdir udump

cd /u02
mkdir oradata  

cd oradata

mkdir TEST

cd /u03

mkdir oradata  

cd oradata

mkdir oradata  


cd /u04

mkdir oradata  

cd oradata

mkdir TEST

Step 2:

create orapassword file

cd $ORACLE_HOME/dbs
orapwd file=orapwTEST password=sys

Step 3:

Prepare the init file. Like this one [initTEST.ora ]


vi initTEST.ora 
db_domain=''
db_name=TEST
compatible='9.2.0.0.0'
background_dump_dest='/u01/admin/TEST/bdump'
core_dump_dest='/u01/admin/TEST/cdump'
user_dump_dest='/u01/admin/TEST/udump'
control_files='/u01/oradata/TEST/control01.ctl','/u02/oradata/TEST/control02.ctl','/u03/oradata/TEST/control03.ctl'
instance_name=TEST
db_block_size=8192
undo_management=AUTO
undo_tablespace=UNDOTBS

export ORACLE_SID=TEST
sqlplus /nolog

Step 4:
Now perform the following steps:

export ORACLE_SID=TEST
sqlplus /nolog

sql>connect sys as sysdba 
sys
startup nomount pfile='/u01/app/oracle/product/10.2.0/db_1/dbs/initTEST.ora' 

CREATE DATABASE TEST
LOGFILE GROUP 1 ('/u01/oradata/TEST/redo01.log') SIZE 50M, GROUP 2 ('/u02/oradata/TEST/redo02.log') SIZE 50M, GROUP 3 ('/u03/oradata/TEST/redo03.log') SIZE 50M,GROUP 4 ('/u04/oradata/TEST/redo04.log') SIZE 50M
MAXLOGFILES 5
MAXLOGMEMBERS 5
MAXLOGHISTORY 1
MAXDATAFILES 100
MAXINSTANCES 1
CHARACTER SET US7ASCII
NATIONAL CHARACTER SET AL16UTF16
DATAFILE '/u01/oradata/TEST/system01.dbf' SIZE 2G
SYSAUX DATAFILE '/u01/oradata/TEST/sysaux.dbf' SIZE 2G
UNDO TABLESPACE UNDOTBS DATAFILE  '/u01/oradata/TEST/undotbs.dbf' SIZE 2G REUSE AUTOEXTEND ON MAXSIZE UNLIMITED;

SQL> @?/rdbms/admin/catalog.sql
SQL> @?/rdbms/admin/catproc.sql

SQL> alter database default temporary tablespace temp ; 

SQL> create spfile from pfile='/u01/app/oracle/product/10.2.0/db_1/dbs/initTEST.ora' ;

SQL> select name , open_mode from v$database ;

NAME      OPEN_MODE
--------- ----------
TEST        READ WRITE


SQL> shu immediate ;

SQL> startup ;

Okay, now your database is ready to use.







No comments:

Post a Comment