Pages

Saturday, March 4, 2017

Starting up an Oracle Database Instance

When starting the database instance, we need to select the state in which it starts.
  1. NOMOUNT
  2. MOUNT
  3. OPEN

1. NOMOUNT: An instance is typically started only in NOMOUNT mode during database creation, during re-creation of control files, or during certain backup and recovery scenarios.


Starting an instance includes the following tasks:
  • Searching $ORACLE_HOME/dbs for a file of a particular name in this sequence:
    • Search for spfile<SID>.ora.
    • If spfile<SID>.ora is not found, search for spfile.ora.
    • If spfile.ora is not found, search for init<SID>.ora.
  • Allocating the SGA
  • Starting the background processes
  • Opening the alert_<SID>.log file and the trace files


2. MOUNT: To perform specific maintenance operations, we start an instance and mount a database, but do not open the database.

The database must be mounted but must not be opened during the following tasks:
  • Renaming data files (Data files for an offline tablespace can be renamed when the database is open.)
  • Enabling and disabling online redo log file archiving options
  • Performing full database recovery
Mounting a database includes the following tasks:
  • Associating a database with a previously started instance
  • Locating and opening all of the control files specified in the parameter file
  • Reading the control files to obtain the names and statuses of the data files and online redo log files (However, no checks are performed to verify the existence of the data files and online redo log files at this time.)
Now, if we fire the command startup mount or startup open, it will generate an error as follows:



Now, we need to fire ALTER DATABASE MOUNT sql as follows:


3. OPEN: A normal database operation means that an instance is started and the database is mounted and opened. With a normal database operation, any valid user can connect to the database and
perform typical data access operations.

Opening the database includes the following tasks:
  • Opening the data files
  • Opening the online redo log files
During this final stage, the Oracle server verifies that all data files and online redo log files can be opened, and checks the consistency of the database. If necessary, the System Monitor (SMON) background process initiates instance recovery.

RESTRICT: We can start up a database instance in restricted mode so that it is available to users with administrative privileges only.



We can verify whether database is in restricted mode:



In we do not wish to perform any other administrative tasks, we simply fire STARTUP in sqlplus to start database. This will start the instance, mount database and open it as shown below:


Thank you. :)


No comments:

Post a Comment