This discussion is archived
2 Replies Latest reply: Nov 23, 2012 1:12 PM by rp0428 RSS

database triggers working methodology

kun_87 Newbie
Currently Being Moderated
HI All,
Does database triggers works even when the DB shut down is in progress??
If so, kindly let me know the reason.

Thanks in Advance.
  • 1. Re: database triggers working methodology
    PavanKumar Guru
    Currently Being Moderated
    Hi,

    refer to doc : http://docs.oracle.com/cd/B28359_01/appdev.111/b28370/triggers.htm#g1700078

    - Pavan Kumar N
  • 2. Re: database triggers working methodology
    rp0428 Guru
    Currently Being Moderated
    >
    Does database triggers works even when the DB shut down is in progress??
    If so, kindly let me know the reason.
    >
    Yes - for a normal shutdown. The reason is because for a normal shutdown Oracle waits for all active users to disconnect their sessions. Once all sessions are disconnected Oracle will shutdown the database. If a user is executing transactions any triggers that are part of those transactions will get executed.

    For an IMMEDIATE shutdown Oracle will rollback any active transactions and the ndisconnect the active users. Any active triggers actions will get rolled back also since triggers are part of the normal transaction processing of the database. Triggers, and their actions, live and die with the transaction that they are part of.

    For an ABORT shutdown Oracle just terminates the user sessions immediately and doesn't roll anything back.

    Here is one article that provides a basic explanation of the three types of 'shutdown': normal, immediate and abort.
    http://www.thegeekstuff.com/2009/01/oracle-database-startup-and-shutdown-procedure/

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points