Monday, August 13, 2012

Oracle Shutdown Stages:

There are 4 Oracle shutdown stages.

1. Shutdown Normal
2. Shutdown Immediate
3. Shutdown Transaction
4. Shutdown Abort

Shutdown Normal:
A normal shutdown of an Oracle database is actually rarely used. This is because the normal shutdown waits for everyone to complete their work and then logoff in an orderly fashion. When a normal shutdown occurs, the database is closed in a normal manner, and all changes made in the database are flushed to the database datafiles.  This is known as a “clean shutdown”.

Here is an example of the use of the normal shutdown command.

SQL> shutdown

Shutdown Immediate:
Perhaps the best way to initially shutdown the database is the shutdown immediate command. This command will prevent any new logins, then rollback any uncommitted transactions, and then bring down the database. In the process of bringing down the database, Oracle will flush all the changes in memory out to the database datafiles too, just like a regular shutdown does. This makes database startup quicker.

Here is an example of shutting down a database with the shutdown immediate command:

SQL> shutdown immediate

Shutdown Transaction:
At this shutdown stage,
-No new connections are allowed, nor are new transactions allowed to be started, after the statement is issued.
-After all transactions have completed, any client still connected to the instance is disconnected.

Here is an example using the shutdown abort command:

SQL> shutdown transaction

Shutdown Abort:
The shutdown abort command is pretty much a guaranteed way to get your database to shutdown. It’s a “hard crash” of the database, and this can result in a longer time to start the database back up.
A shutdown abort should not be your first shutdown method of choice, there may be times when you must force the database down.
At this stage,
-No new connections are allowed, nor are new transactions allowed to be started, after the statement is issued.
-Current client SQL statements being processed by Oracle Database are immediately terminated.
-Uncommitted transactions are not rolled back.
-Oracle Database does not wait for users currently connected to the database to disconnect. The database implicitly disconnects all connected users.
-The next startup of the database will require instance recovery procedures.

Here is an example using the shutdown abort command:

SQL> shutdown abort

No comments:

Post a Comment