In this post we’ll walk through the stages of an Oracle database startup and a few important notes along the way.
At the simplest level there are three main stages of an Oracle startup.
NO MOUNT: The database instance is started. The spfile or parameter file is read; the database processes start; the memory footprint of the instance is allocated on the host. Recall that the database consists of the data files sitting on permanent storage. The instance is the collection of memory and processes that allow access to and manipulation of the database.
MOUNT: The database control files are opened.
OPEN: The data files are opened and users are allowed to connect to the database and begin transactions.
Normally the database passes through all three stages of startup rapidly. On rare occasions the DBA may need the startup to temporarily halt at NO MOUNT or MOUNT to conduct maintenance.
When you type STARTUP from the command line, Oracle looks in a default location for either the spfile or parameter file. On UNIX and Linux that is $ORACLE_HOME/dbs. The spfile or parameter file contains initialization parameters for your database.
Based on the initialization parameters, the database will allocate its memory footprint, and startup a number of background processes. At this point the database is said to be in NO MOUNT. The only reason a DBA would halt a startup at this point is if he / she needs to recreate the control files. Reasons for doing that are beyond the scope of this post.
To transition to MOUNT, the database control files are opened. At this point the V$ dynamic performance views are accessible (but not the static data dictionary). The redo logs are also opened. Common reasons for pausing a startup at MOUNT are to add, delete, or otherwise modify redo logs; to rename data files; and to put the database into or out of archive log mode.
To transition to OPEN, the data files are opened. The control files contain the location of all data files. They also contain the value of the System Change Number (SCN) when the database was closed. When opening the data files, Oracle makes sure the SCN in the control files matches the SCN in the header of every data file. If there is a mismatch, Oracle will raise an error saying the data file cannot be opened and needs recovery.
If the database was not shutdown cleanly, this is also the point at which Oracle will perform recovery using information in the redo logs to bring the data files to a consistent point.
When all data files are opened, if the database is in archive log mode then the archiver processes will be started.
So – how do you actually do a startup?
You need to be connected to the database as a user granted SYSDBA privilege. If you’re using command line SQL*Plus, you type STARTUP. You should see something along the lines of this:
If you wanted the database to startup but stop at NOMOUNT, you would use STARTUP NOMOUNT:
From there you would ALTER DATABASE MOUNT
And then you can go to fully open
STARTUP RESTRICT is the last option to mention. This gives the ability to fully open a database, but to only permit logins to users explicitly granted CREATE SESSION and RESTRICTED SESSION privileges. This permits a DBA to do maintenance that requires the database to be fully open but not have end users in the system.
To make the database available for all users requires an ALTER SYSTEM:
Recent Comments