Re: Is there a trigger on session end?

From: Peter Teoh <htmldeveloper_at_gmail.com>
Date: Sun, 2 Mar 2008 05:06:38 -0800 (PST)
Message-ID: <bc544eb8-7419-4889-809b-c9b7426d168f@s8g2000prg.googlegroups.com>


On Feb 29, 4:08 pm, DA Morgan <damor..._at_psoug.org> wrote:
> dean wrote:
> > 10g / Win
>
> > I have a trigger that calls a procedure when a user logs off session:
>
> > create or replace trigger LoggedOff
> > before logoff on database
> > call procLoggedOff
> > /
>
> > But this trigger is not called if my session ends unexpectedly - a
> > crash or if the app is killed by some means (simple crash, compiler
> > reset, CTRL-ALT_DEL, etc).
>
> > Is there a way to get Oracle to call a procedure when it determines
> > that a session has been killed or otherwise has died?
>
> > Thanks in advance for any advice.
>
> You can create a SYSTEM EVENT trigger to fire on AFTER SERVERERROR.
>
> Should work for what you want.
> --

Referring to this page:

http://www.psoug.org/reference/system_trigger.html

I saw:

 AFTER SERVERERROR (does not trap ...

  • ORA-01403: no data found (this is in the Oracle docs but does not seem to be correct)
  • ORA-01422: exact fetch returns more than requested number of rows
  • ORA-01423: error encountered while checking for extra rows in exact fetch
  • ORA-01034: ORACLE not available
  • ORA-04030: out of process memory when trying to allocate string bytes (string, string)

So u may have to take note that certain class of errors cannot be captured. Or is my interpretation wrong?

Thanks. Received on Sun Mar 02 2008 - 07:06:38 CST

Original text of this message