4.1DB Creation
4.1DB Creation
directories.
$ cd /disk1/oradata
$ mkdir DEMO
$ cd DEMO
$ mkdir bdump cdump udump (Create directories as specified
in init<ORACLE_STD>.ora)
$ cd /disk2/oradata
$ mkdir DEMO
$ cd
Execute the Create Database command, which is defined in the following lines (i.e., script written in a file
‘cr8demo.sq1’, using “vi” and then execute it). Now, if you want to create DEMO database then issue,
$ vi cr8demo.sq1
CREATE DATABASE demo
DATAFILE ‘/disk1/oradata/DEMO/system01.dbf ‘ SIZE 170M
SYSAUX DATAFILE ‘/disk1/oradata/DEMO/ssaux01.dbf ‘ SIZE 50M
UNDO TABLESPACE undotbs
DATAFILE ‘/disk1/oradata/DEMO/undotba01.dbf’ SIZE 20M
DEFAULT TEMPORARY TABLESPACE temp
TEMPFILE ‘/disk1/oradata/DEMO/temp01.dbf ‘ SIZE 10M
DEFAULT TABLESPACE user_data
DATAFILE ‘/disk1/oradata/DEMO/user_data1.dbf ‘ SIZE 20M
LOGFILE GROUP 1 ( ‘ /disk1/oradata/DEMO/redologla.log’,
‘/disk2/oradata/DEMO/redolog1b.log’, SIZE 4M
GROUP 2 ( ‘/disk1/oradata/DEMO/redolog2a.log’,
‘/disk2/oradata/DEMO/redolog2b.log’,) SIZE 4M
CONTROLFILE REUSE;
:wq
Note: Defining the controlfile clause is optional, because we will be specifying it in init.ora file. Moreover
“REUSE” is used only if the respective file is already existing and with same size. At $ prompt issue the
command sqlplus/nolog command, which will take you to “SQL>” prompt.
$ sqlplus /NOLOG
SQL> CONNECT / AS SYSDBA
SQL> STARTUP NOMOUNT
SQL> @cr8demo.sql
When you execute this statement, Oracle performs the following operations:
Creates the controlfile(s) for the database
Creates the redolog files for the database
Creates the SYSTEM Tablespace and the system roll back segment.
Creates the SYSAUX Tablespace
Creates Default Parmanent Tablespace USER_DATA
Creates UNDO Tablespace and default Temporary Tablespace TEMP
Creates the data dictionary.
Creates user SYS and SYSTEM
Mounts and Opens the database for use
After the above statement is processed, the CATPROC and CATALOG scripts are to be executed, as user
“SYS”, which are present in $ORACLE_HOME/rdbms/admin directory.