Oracle Database Startup and Shutdown Procedure

In this article, we are going to briefly describe the procedure for starting up and shutting down an oracle database. As a database administrator, startup and shutdown the database is a routine task and basic operation. Besides, a non-DBAs also have an understanding some basic database administrator activities. 

Let’s see the startup and shutdown modes. 

@ Oracle database Startup Procedure:

We can startup oracle database in three states / modes:

i. Nomount mode: In this state the control file, online redo log files and the database files are closed and are not accessible. During the nomount state, the oracle background processes are started and the oracle instance is available. Starting oracle database in nomount state to perform operations like creating a database, recreating control file. Besides, there are some types of Oracle recovery operations that require the database to be in nomount stage.

SQL> startup nomount;

ii. Mount mode: When the startup command enters the mount stage, it opens the control file and reads the control file. In this stage, oracle determines the location of the datafiles, but does not yet open them. Once the datafile locations have been identified, the database is ready to be opened. 
However, we have a clear idea about the oracle database startup and shutdown procedure. 
There are various stages that the database undergoes before a database is opened for use. In this article, you will learn about the oracle database startup and shutdown procedure. Startup oracle database in mount state to perform operations like backup, recovery of the system or undo datafile, change the database to archive log mode etc. 

SQL> Startup mount;

If you have already started the database instance with the startup nomount command, you might change it from the nomount to mount startup stage using the alter database command:

SQL> alter database mount;

iii. Open mode: This is the last startup step for an oracle database is the open mode. In this step, the datafiles and the online redo log files are open and are ready to use. Once it has accessed the database datafiles, Oracle makes sure that all of the database datafiles are consistent. A database maybe opened in read-only mode as well as in read write mode. The database mode status found by below query.

Sql>select open_mode from v$database;

Note: In the read-only mode, the database performs select query only but one cannot perform the dml operations.

Moreover, there are other options available like one can start the database in a restricted mode. This is used during maintenance activities, upgrades etc.

Opening the Oracle Database
To open the database, you can just use the startup command as seen in this example

SQL> startup

If the database is mounted, you can open it with the alter database open command as seen in this example:

SQL> alter database open;

Opening the Database in Restricted Mode

SQL> startup restrict;

@ Oracle database Shutdown Procedure

Oracle has three shutdown modes namely normal, immediate and abort.

i. Normal Shutdown: When a normal shutdown occurs, the database is closed in a normal manner, oracle will wait for all active users to disconnect their sessions, and all changes made in the database are flushed to the database datafiles. This makes database startup quicker because the database is in a consistent state. 

SQL> shutdown;

ii. Shutdown Immediate: When issue shutdown immediate mode this will prevent any new logins, rollback any uncommitted transactions and then bring down the database. Oracle will flush all the changes in memory out to the database datafiles too, just like a regular shutdown does.

SQL> shutdown immediate;

iii. Shutdown abort: A shutdown abort should not be your first shutdown method of choice, there may be times when you must force the database down. When issue shutdown abort, before the oracle database is shutdown, all user sessions will be terminated immediately and all uncomitted transactions will not be rolled back. 

SQL> shutdown abort;

Keep learning… Have a great day!!!

Post a Comment