Shutdown Abort

Embed Size (px)

Citation preview

  • 8/2/2019 Shutdown Abort

    1/3

    Gave a thoughtShutdown Abort/StartupForce

    July 31, 2007akpraveenLeave a comment

    Whenever we have to shutdown a database, we would normally go by the golden rule The

    database shutdown has to consistent. So we shutdown the database with either shutdown

    or shutdown immediate commands. Because we know if the database is shutdown normal

    or immediate, it wont ask for recovery and would be in consistent state. So I just wondered

    what happens if I say shutdown abort at the SQL prompt. The answer would be you will

    have database shut down in an inconsistent state.

    So I just gave a try to identify what goes on in the background with the processes when we

    shutdown the database with different options.

    Shutdown:Whenever we say shutdown at the SQL prompt, the oracle process w ill wait for all the

    client connections to be closed before proceeding with the shutdown of the database. Once allthe connections are closed, ckpt process will fire a complete checkpoint in which all the

    headers of the data files are freezed and updated with latest SCN. After the checkpoint is

    done, pmon process will come into action by cleaning the process variables and releasing the

    associated memory. Later smon will close the pmon process thereby bringing down the

    database. It also performs the cleaning up of the pmon process releasing memory associated

    with it.

    So the database is shutdown normal without any inconsistencies.

    Shutdown Immediate:With shutdown immediate, in contrary to normal shutdown, the oracle process wont wait for

    all the client connection to be closed; instead it will kill all the client connections. Once theclient connections are closed, rest all processes continue to action as in with normal

    shutdown. Hence even when the database is shutdown using immediate option, the database

    is consistent.

    Attached is the snapshot of alert log file:

    Shutting down instance: further logons disabledShutting down instance (immediate)

    - This is where all the connections are closed and PMON is invoked.

    License high water mark = 10Wed Aug 10 22:26:44 2005ALTER DATABASE CLOSE NORMALWed Aug 10 22:26:44 2005

    - This is where PMON is closed and SMON is invoked.

    SMON: disabling TX recoverySMON: disabling cache recoveryWed Aug 10 22:26:44 2005Shutting down archive processesArchiving is disabledArchive process shutdown avoided: 0 active

    http://myracle.wordpress.com/2007/07/31/gave-a-thought-%e2%80%93-%e2%80%9cshutdown-abortstartup-force%e2%80%9d/http://myracle.wordpress.com/2007/07/31/gave-a-thought-%e2%80%93-%e2%80%9cshutdown-abortstartup-force%e2%80%9d/http://myracle.wordpress.com/2007/07/31/gave-a-thought-%e2%80%93-%e2%80%9cshutdown-abortstartup-force%e2%80%9d/http://myracle.wordpress.com/2007/07/31/gave-a-thought-%e2%80%93-%e2%80%9cshutdown-abortstartup-force%e2%80%9d/http://myracle.wordpress.com/2007/07/31/gave-a-thought-%e2%80%93-%e2%80%9cshutdown-abortstartup-force%e2%80%9d/http://myracle.wordpress.com/2007/07/31/gave-a-thought-%e2%80%93-%e2%80%9cshutdown-abortstartup-force%e2%80%9d/http://myracle.wordpress.com/2007/07/31/gave-a-thought-%e2%80%93-%e2%80%9cshutdown-abortstartup-force%e2%80%9d/http://myracle.wordpress.com/author/akpraveen/http://myracle.wordpress.com/author/akpraveen/http://myracle.wordpress.com/2007/07/31/gave-a-thought-%e2%80%93-%e2%80%9cshutdown-abortstartup-force%e2%80%9d/#respondhttp://myracle.wordpress.com/2007/07/31/gave-a-thought-%e2%80%93-%e2%80%9cshutdown-abortstartup-force%e2%80%9d/#respondhttp://myracle.wordpress.com/2007/07/31/gave-a-thought-%e2%80%93-%e2%80%9cshutdown-abortstartup-force%e2%80%9d/#respondhttp://myracle.wordpress.com/2007/07/31/gave-a-thought-%e2%80%93-%e2%80%9cshutdown-abortstartup-force%e2%80%9d/#respondhttp://myracle.wordpress.com/author/akpraveen/http://myracle.wordpress.com/2007/07/31/gave-a-thought-%e2%80%93-%e2%80%9cshutdown-abortstartup-force%e2%80%9d/
  • 8/2/2019 Shutdown Abort

    2/3

    Thread 1 closed at log sequence 1913Successful close of redo thread 1.Wed Aug 10 22:26:44 2005Completed: ALTER DATABASE CLOSE NORMALWed Aug 10 22:26:44 2005

    Shutdown Abort:So my real concern is with this option. What happens when the database is shutdown abort?

    Whenever the database is shutdown using abort option, the ckpt process is by passed, thereby

    closing the oracle bequeath process. This in turn invokes pmon process to clean up the

    process and releases any memory associated with it, thus bringing the database down.

    Eventually as the ckpt process is not fired against the database before shutdown, the database

    will be in inconsistent state. Oracle does not recommend using this option.

    Lets take a case study. Consider we have a database by name MIG10G.

    The processes pertaining to the database would be:

    $ ps ef|grep MIG10Goracle10 26996 1 0 14:25:55 ? 0:00 ora_p001_MIG10Goracle10 26998 1 0 14:25:56 ? 0:00 ora_p002_MIG10Goracle10 26992 26960 0 14:25:55 ? 0:02 oracleMIG10G(DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq)))oracle10 26974 1 0 14:25:50 ? 0:00 ora_psp0_MIG10Goracle10 26978 1 0 14:25:50 ? 0:00 ora_dbw0_MIG10Goracle10 26988 1 0 14:25:51 ? 0:01 ora_mmon_MIG10Goracle10 26990 1 0 14:25:51 ? 0:00 ora_mmnl_MIG10Goracle10 26994 1 0 14:25:55 ? 0:00 ora_p000_MIG10Goracle10 26980 1 0 14:25:51 ? 0:00 ora_lgwr_MIG10Goracle10 27018 27017 0 14:26:41 pts/9 0:00 grep MIG10G

    oracle10 26972 1 0 14:25:50 ? 0:00 ora_pmon_MIG10Goracle10 26986 1 0 14:25:51 ? 0:00 ora_reco_MIG10Goracle10 27000 1 0 14:25:57 ? 0:00 ora_qmnc_MIG10Goracle10 26976 1 0 14:25:50 ? 0:00 ora_mman_MIG10Goracle10 27014 1 0 14:26:12 ? 0:00 ora_q001_MIG10Goracle10 27007 1 0 14:26:07 ? 0:00 ora_q000_MIG10Goracle10 26982 1 0 14:25:51 ? 0:00 ora_ckpt_MIG10Goracle10 26984 1 0 14:25:51 ? 0:00 ora_smon_MIG10G

    When the database is shutdown using abort option, the oracle bequeath process with pid26992 is closed, thereby by passing the ckpt process and leaving the data file headers un-

    updated.

    This could be clearly seen in the alert log of the MIG10G database:

    Shutting down instance (abort)License high water mark = 4Instance terminated by USER, pid = 26992

    Startup Force:The startup force option internally shuts down the database and restarts it. So if you have a

    look at alert log of this, you will see that the database is shutdown using shutdown abort

    option and started normal. The database in this case would be in consistent state as it started

    up normal.

  • 8/2/2019 Shutdown Abort

    3/3

    Tue Jul 31 14:54:50 2007Shutting down instance (abort)License high water mark = 4Instance terminated by USER, pid = 27249Tue Jul 31 14:54:52 2007

    Starting ORACLE instance (normal)Tue Jul 31 14:54:52 2007

    Where pid 27249 is the oracle bequeath process id.

    $ ps ef|grep MIG10Goracle10 27249 26936 0 14:25:55 ? 0:02 oracleMIG10G(DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq)))

    Conclusion:Now we know that whenever the database is shut down using abort option, the database is in

    inconsistent state. This option should be used only in worst-case scenarios when you are notable to shutdown the database using normal/immediate options. Even if you shutdown the

    database with abort option, startup the database normal and again shut it down normal, in

    order to maintain its consistent state.

    *These are all my views, which I have added in the blog depending on the test cases that I

    have carried out. Any comments or suggestions on this write up would really help me in

    getting to know the things better.