Create Database Manually

Create database Manually in a few steps
1- Create Pfile

[oracle@11gdb02 dbs]$ cat initorcl.ora
db_name='orcl'
compatible='11.2.0'
diagnostic_dest='/u02/app'
audit_file_dest='/u02/app/diag/adump'
sga_target=300M
processes=100
undo_tablespace='UNDOTBS1'
control_files=('/u02/app/orcl/control01.ctl')
2- Create Password file
[oracle@11gdb02 dbs]$orapwd file=$ORACLE_HOME/dbs/orapworcl password=oracle entries=10

3- Create Database Script

[oracle@11gdb02 dbs]$ cat create_orcl.sql
create database orcl
logfile
group 1('/u02/app/orcl/log1.log') size 5m,
GROUP 2('/u02/app/orcl/log2.log') size 5m
character set AL32UTF8
NATIONAL CHARACTER SET AL16UTF16
datafile '/u02/app/orcl/system.dbf' size 500M
sysaux
datafile '/u02/app/orcl/sysaux.dbf' size 500M
default tablespace users
datafile '/u02/app/orcl/users.dbf' size 5m
undo tablespace UNDOTBS1
datafile '/u02/app/orcl/UNDOTBS01.dbf' size 5m
default temporary tablespace temp
tempfile '/u02/app/orcl/temp01.dbf' size 5m;
[oracle@11gdb02 dbs]$


4- Start the database instance in no mount mode.
SQL> startup nomount
ORACLE instance started.

Total System Global Area 313860096 bytes
Fixed Size 1336232 bytes
Variable Size 104860760 bytes
Database Buffers 201326592 bytes
Redo Buffers 6336512 bytes

5- run the create_orcl.sql to create database.

SQL> @/u02/app/oracle/product/11.2.0/db_1/dbs/create_orcl.sql
Database created.

6- run the below script

SQL> @$ORACLE_HOME/rdbms/admin/catalog.sql 
SQL> @$ORACLE_HOME/rdbms/admin/catproc.sql 
conn system/manager 
SQL>@$ORACLE_HOME/sqlplus/admin/pupbld.sql

7 – Check Database status

SQL> select open_mode from v$database;
OPEN_MODE
--------------------
READ WRITE
SQL>
Advertisements

About Sher khan

Senior Oracle DBA, Oracle 10g , Oracle 11g OCE ,Oracle 12C and Oracle 11g OPN certified Specialist, OCP Certified in Oracle 9i,10g , 11g and 12C. I am working in Oracle technology since 2004. Currently working in U.A.E Email: sher487@hotmail.com
This entry was posted in Uncategorized. Bookmark the permalink.

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