How to create Oracle database manually:

In this article, I will show you the detailed steps on how to create Oracle database manually. I think you all know how to create Oracle database through DBCA GUI and Silent Method. If you do not know then please go through the articles DBCA GUI Method and DBCA Silent Method.

Manual Database Creation Steps:

Step 1) Login to the server where you want to create oracle database manually as an Oracle user and set the environment variable for the database you want to create:

export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=/u01/app/oracle/product/19.3.0/dbhome_1
export PATH=$ORACLE_HOME/bin:$PATH
export LD_LIBRARY_PATH=$ORACLE_HOME/lib
export ORACLE_SID=test

How to create Oracle database manually:
Step 2) Update /etc/oratab file for the SID and existing oracle home:
How to create Oracle database manually:
Step 3) Prepare the pfile for the test database and add the following :

db_name=test
control_files=’/u01/app/oracle/oradata/test/c1.ctl’,’/u01/app/oracle/oradata/test/c2.ctl’
undo_tablespace=’UNDOTBS1′

How to create Oracle database manually:
Step 4) Create the below directory where database files will be stored:

mkdir -p /u01/app/oracle/oradata/test

How to create Oracle database manually:
Step 5) Start the database instance:

sqlplus / as sysdba
startup nomount

How to create Oracle database manually:
Step 6) Prepare a script to create the database:

vi /home/oracle/dbcreate.sql

create database test
datafile ‘/u01/app/oracle/oradata/test/system_01.dbf’ size 500m
sysaux datafile ‘/u01/app/oracle/oradata/test/sysaux_01.dbf’ size 500m
logfile group 1 ‘/u01/app/oracle/oradata/test/redo01.log’ size 200m,
group 2 ‘/u01/app/oracle/oradata/test/redo02.log’ size 200m
undo tablespace UNDOTBS1
datafile ‘/u01/app/oracle/oradata/test/undotbs01_01.dbf’ size 100m
default temporary tablespace TEMP
tempfile ‘/u01/app/oracle/oradata/test/temp_01.dbf’ size 100m;
:wq!

How to create Oracle database manually:
Step 7) Run the script to create the database and check the status once done:

sqlplus / as sysdba
SQL>@/home/oracle/dbcreate.sql
SQL>select name,open_mode from v$database;

create Oracle database manually
Step 8) Create a script to run the below Post Database Creation Scripts:

vi /home/oracle/postdbcreate.sql

@$ORACLE_HOME/rdbms/admin/catalog.sql
@$ORACLE_HOME/rdbms/admin/catproc.sql

:wq!

How to create Oracle database manually:
Step 9) Run the post-database creation script and you will get the below once it is completed. I think this article helped me to create oracle database manually.

sqlplus / as sysdba
SQL>@/home/oracle/postdbcreate.sql

How to create Oracle database manually:

You can follow the oracle document for your reference Creating a Database with the CREATE DATABASE Statement.

Leave a Reply