STEPS TO CREATE ORACLE DATABASE MANUALLY ON LINUX

This article shows you steps to create a database manually on Linux.
Steps:
1.Decide your SID
2.Create pfile using dummy file i.e init.ora
3.Create required no.of directories
4.Start database in nomount state
5.Create database script and execute it
6.Execute the Following Scripts
@$ORACLE_HOME/rdbms/admin/catalog.sql
@$ORACLE_HOME/rdbms/admin/catproc.sql
@$ORACLE_HOME/sqlplus/admin/pupbld.sql
Step:1 SID =crms
Step 2:
su – oracle
cd $ORACLE_HOME/dbs
cp init.ora initcrms.ora
vi initcrms.ora
——————————————-
db_name=’CRMS’
audit_file_dest=’/u02/app/oracle/admin/crms/adump’
db_recovery_file_dest=’/u02/app/oracle/fast_recovery_area’
db_recovery_file_dest_size=2G
diagnostic_dest=’/u01/app/oracle’
control_files = (/u02/app/oracle/crms/control01.ctl)
————————————————————————————–
Step:3
First create all the necessary directories. Followings are my directories:
mkdir -p /u02/app/oracle/admin/crms/adump
chown -R oracle:oinstall /u02/app/oracle/admin/crms/adump
chmod -R 775 /u02/app/oracle/admin/crms/adump
mkdir -p /u02/app/crms
chown -R oracle:oinstall /u02/app/crms
chmod -R 775 /u02/app/crms
mkdir -p /u02/app/oracle/fast_recovery_area/
chown -R oracle:oinstall /u02/app/oracle/fast_recovery_area/
chmod -R 775 /u02/app/oracle/fast_recovery_area/
mkdir -p /u02/app/oracle
chmod -R 775 /u02/app/oracle
chown -R oracle:oinstall /u02/app/oracle
Step:4
export ORACLE_SID=crms
sqlplus / as sysdba
startup mount
Error:memory target not supported
soln: root# mount -t tmpfs shmfs -o size=2g /dev/shm
SQL>startup nomount
SQL>define_editor=vi
SQL>ed dbscript.sql
—————-
Step:5
create database crms
datafile ‘/u02/app/oracle/crms/system01.dbf’ size 10m autoextend on
sysaux datafile ‘/u02/app/oracle/crms/sysaux01.dbf’ size 10m autoextend on
default tablespace crms_ts
datafile ‘/u02/app/oracle/crms/crms_ts01.dbf’ size 10m autoextend on
undo tablespace undotbs1
datafile ‘/u02/app/oracle/crms/undotbs1.dbf’ size 10m autoextend on
default temporary tablespace temp_ts
tempfile ‘/u02/app/oracle/crms/temp_ts01.dbf’ size 10m autoextend on
logfile
group 1 (‘/u02/app/oracle/crms/redo01.log’) size 4m,
group 2 (‘/u02/app/oracle/crms/redo02.log’) size 4m
controlfile reuse;
———————-
save the above file using :wq
SQL>@dbscript.sql
Database Created
Step:6
SQL>ed run.sql
———————-
SQL> @$ORACLE_HOME/rdbms/admin/catalog.sql
SQL> @$ORACLE_HOME/rdbms/admin/catproc.sql
conn system/manager
SQL> @$ORACLE_HOME/sqlplus/admin/pubbld.sql
——————–
Save it and execute it : wq
SQL>@run.sql
SQL> select name from v$database;
NAME
———
CRMS
$ cat /etc/oratab (Add manually db name )

Okay, now your database is ready to use.

Note:

catalog.sql ,will create default views,synonyms,indexes,sequences etc.

catproc.sql, will create the default procedures and functions

pubbld.sql, will create the default profiles.

Advertisements
Leave a comment

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

%d bloggers like this: