1. Set environment variables
[oracle@ocmsfsdb ~]$ export ORACLE_SID=mandb
[oracle@ocmsfsdb dbhome_1]$ export ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1
[oracle@ocmsfsdb fast_recovery_area]$ export PATH=$PATH:$ORACLE_HOME/bin
2. Create pfile in database default location i.e. $ORACLE_HOME/dbs
[oracle@ocmsfsdb dbs]$ cat initmandb.ora
db_name=mandb
control_files='/u01/app/oracle/oradata/mandb/control01.ctl','/u01/app/oracle/fast_recovery_area/mandb/control02.ctl'
memory_target=632291328
3. Create the directories required to store controlfiles:
[oracle@ocmsfsdb dbs]$ cd /u01/app/oracle/oradata/
[oracle@ocmsfsdb oradata]$ mkdir mandb
[oracle@ocmsfsdb oradata]$ chmod 750 mandb
[oracle@ocmsfsdb oradata]$ cd /u01/app/oracle/fast_recovery_area/
[oracle@ocmsfsdb fast_recovery_area]$ mkdir mandb
[oracle@ocmsfsdb fast_recovery_area]$ chmod 750 mandb
4. Connect to the instance:
[oracle@ocmsfsdb fast_recovery_area]$ sqlplus /nolog
SQL*Plus: Release 11.2.0.3.0 Production on Sun Oct 6 18:34:05 2013
Copyright (c) 1982, 2011, Oracle. All rights reserved.
SQL> connect /as sysdba
Connected to an idle instance.
SQL> create spfile from pfile;
File created.
SQL> startup nomount
ORACLE instance started.
Total System Global Area 631914496 bytes
Fixed Size 1346784 bytes
Variable Size 377488160 bytes
Database Buffers 247463936 bytes
Redo Buffers 5615616 bytes
5. Before issuing create database, create required directories to store datafiles, redo log files.
In my case I am storing all the log files and datafiles under /u01/app/oracle/oradata/mandb and the directory is already created in step#3 above.
6. Run create database, modify it as per your directory structure: This command can be found at
http://docs.oracle.com/cd/E11882_01/server.112/e25494/create.htm#i1008985
CREATE DATABASE mandb
USER SYS IDENTIFIED BY oracle
USER SYSTEM IDENTIFIED BY oracle
LOGFILE GROUP 1 ('/u01/app/oracle/oradata/mandb/redo01a.log','/u01/app/oracle/oradata/mandb/redo01b.log') SIZE 100M BLOCKSIZE 512,
GROUP 2 ('/u01/app/oracle/oradata/mandb/redo02a.log','/u01/app/oracle/oradata/mandb/redo02b.log') SIZE 100M BLOCKSIZE 512,
GROUP 3 ('/u01/app/oracle/oradata/mandb/redo03a.log','/u01/app/oracle/oradata/mandb/redo03b.log') SIZE 100M BLOCKSIZE 512
MAXLOGFILES 5
MAXLOGMEMBERS 5
MAXLOGHISTORY 1
MAXDATAFILES 100
CHARACTER SET AL32UTF8
NATIONAL CHARACTER SET AL16UTF16
EXTENT MANAGEMENT LOCAL
DATAFILE '/u01/app/oracle/oradata/mandb/system01.dbf' SIZE 325M REUSE
SYSAUX DATAFILE '/u01/app/oracle/oradata/mandb/sysaux01.dbf' SIZE 325M REUSE
DEFAULT TABLESPACE users
DATAFILE '/u01/app/oracle/oradata/mandb/users01.dbf'
SIZE 500M REUSE AUTOEXTEND ON MAXSIZE UNLIMITED
DEFAULT TEMPORARY TABLESPACE tempts1
TEMPFILE '/u01/app/oracle/oradata/mandb/temp01.dbf'
SIZE 20M REUSE
UNDO TABLESPACE undotbs
DATAFILE '/u01/app/oracle/oradata/mandb/undotbs01.dbf'
SIZE 200M REUSE AUTOEXTEND ON MAXSIZE UNLIMITED;
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
Database created.
Note: if passwords for sys and system are not specified then they will be set to default change_on_install and manager respectively.
SQL> select open_mode from v$database;
OPEN_MODE
--------------------
READ WRITE
7. Run scripts to build data dictionary views:
In SQL*Plus, connect to your Oracle Database instance with the SYSDBA
administrative privilege:
@?/rdbms/admin/catalog.sql
@?/rdbms/admin/catproc.sql
In SQL*Plus, connect to your Oracle Database instance as SYSTEM
user:
@?/sqlplus/admin/pupbld.sql
8. Add the entry for this database to /etc/oratab
The database creation manually is completed.