Oracle DBA, How To, Error, Cause and Action

Oracle Database Shutdown Process (1/4)

Oracle Database Shutdown Process (1/4) [You are here]
Oracle Database Shutdown Process (2/4)
Oracle Database Shutdown Process (3/4)
Oracle Database Shutdown Process (4/4)

Oracle database shutdown process is reverse process of Oracle database startup, therefore there are three steps.

1. Close
2. Unmount
3. Shutdown instance



Close
Oracle database writes all confirm (commit, Oracle have command call commit, this mean to confirm the changes) changes that still in SGA (memory) into the datafiles so that the changes is permanent and available for next database open. The uncommited changes (transactions) will be discarded. Therefore this process can take quite long to complete if you have database configured with big SGA and you have alot of changes need to be discarded or written into datafiles.
You may ask what happen if there is power failure and I have huge amount of unsaved changes stored in my huge SGA, will my data lose?
The answer is no, don't worry about that, Oracle is having each of the changes (Oracle using SCN to uniquely identify all transaction, SCN stand for System Change Number) stored in redo log files in your disk (which will be archived if you set it correctly). With that we will able to recover everything.

Unmount
During the unmount, Oracle is disassociate all files with the processes and memory.

Shutdown instance
Oracle clear the SGA and terminate all Oracle process. After this process you will no longer have Oracle database instance process running. Well you may still have Oracle Listener process running which is that is not part of this.


There are four types of shutdown command.

SHUTDOWN NORMAL (this is default type, if you key in command SHUTDOWN without mention any other word then Oracle will perform SHUTDOWN NORMAL)

Shutdown normal, Oracle will wait for all connected user to manually logout from
Oracle session then it will start performing shutdown. So if you have other connected session this command may seems like hang but actually your SHUTDOWN command is waiting the other user to logout before performing the shutdown. Once you issue this command there will be no new login is allowed.

1. We have 1 connected session.



2. Try to perform SHUTDOWN NORMAL



Notice that Shutdown is hanging waiting for all connected sessions to logout.

3. Logout session the connected session and then shutdown sequence is continue.



Oracle Database Shutdown Process (1/4) [You are here]
Oracle Database Shutdown Process (2/4)
Oracle Database Shutdown Process (3/4)
Oracle Database Shutdown Process (4/4)

No comments: