0% found this document useful (0 votes)
64 views2 pages

4.1DB Creation

The document provides steps to create an Oracle database named DEMO. It involves creating necessary directories, running a script to define the database configuration and objects, and executing additional scripts to complete initialization. Key steps include using the CREATE DATABASE command in a script to define tablespaces and files, starting up in nomount mode, running catalog and catproc scripts as SYS user, and building packages as SYSTEM user.

Uploaded by

niaam
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
64 views2 pages

4.1DB Creation

The document provides steps to create an Oracle database named DEMO. It involves creating necessary directories, running a script to define the database configuration and objects, and executing additional scripts to complete initialization. Key steps include using the CREATE DATABASE command in a script to define tablespaces and files, starting up in nomount mode, running catalog and catproc scripts as SYS user, and building packages as SYSTEM user.

Uploaded by

niaam
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 2

Create the necessary directories to place database files, redolog files, control files and the dump_dest

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.

The commands are as follows:


SQL> @$ORACLE_HOME/rdbms/admin/catalog. $q1 # as SYS
SQL> @$ORACLE_HOME/rdbms/admin/catproc. $q1 # as SYS
Then, connect as system/manager and execute pupbld.sql. The command is,
SQL> connect system/manager
SQL> @$ORACLE_HOME/sqlplus/admin/pupbld.sql # as SYSTEM user
For more information you can query these views:
 V$SGA
 V$INSTANCE
 V$DATABASE
 V$PROCESS
 V$SYSAUX_OCCUPANTS

You might also like