When Oracle database is started, it goes through two different stages before it is finally opened for users/applications for queries or updates.
Below is the description of each stage and the commands that can be used to bring the database in these stages:
NOMOUNT
Command: STARTUP NOMOUNT
This is first step of opening the database.
Oracle will search for the parameter file with the name sp<sid>.ora (binary file) or init<sid>.ora (text based parameter file).
Oracle reads the spfile or pfile and an instance is created with the name specified in ORACLE_SID variable.
Instance consists of two things:
System Global Area or SGA, which is the memory allocated to Oracle Server as per the parameters defined in the initialization parameter file.
Background processes (SMON, PMON, DBWn, LGWn, CKPT etc.) which are mandatory for running a Oracle database.
MOUNT
Command: STARTUP MOUNT or
ALTER DATABASE MOUNT (If database is in NOMOUNT stage).
Oracle reads and writes the controlfile which are listed in the control_files parameter in the parameter file.
Oracle will give an error if any of the controlfile is missing.
OPEN
Command: STARTUP or
ALTER DATABASE OPEN (If database is in MOUNT stage).
This will ensure all the database files and redo log files that are listed in control file are present and have necessary read/write permissions.
OPEN READONLY
Command:
ALTER DATABASE OPEN READONLY used to open the database but the changes like updates, inserts or deletes would not be possible.
OPEN RESTRICTED
Command: STARTUP RESTRICTED
ALTER DATABASE OPEN RESTRICTED used to open the database for Administrators for patching or other database maintenance activities.
Comments
Post a Comment