Re: Can we trigger event for abnormal loss of connection to oracle databse?

From: <fitzjarrell_at_cox.net>
Date: Fri, 29 Aug 2008 09:43:46 -0700 (PDT)
Message-ID: <821945df-06a9-4a6e-9420-f0cdf1c8461d@j22g2000hsf.googlegroups.com>


Comments embedded.
On Aug 29, 10:28 am, Mark D Powell <Mark.Pow..._at_eds.com> wrote:
> On Aug 29, 10:50 am, sybra..._at_hccnet.nl wrote:
>
>
>
>
>
> > On Fri, 29 Aug 2008 06:56:36 -0700 (PDT), shilpa
>
> > <shilpa.uttar..._at_gmail.com> wrote:
>
> > >ORACLE Database :
>
> > >I want a trigger to get fired when my application’s connection to the
> > >database gets disconnected abnormally.
> > >I plan to monitor the Server Name and its status in the “ v$session“
> > >table.
> > >Can I write a trigger that gets fired when “ v$session“ table gets
> > >edited? How can I achieve it?
> > >Is there any other way to execute a stored procedure and perform some
> > >steps when a connection is lost to a database?
>
> > >Any comments/suggestions would be appreciated.
>
> > >Thanks..
>
> > audit connect will do the trick automagically.
> > It records the error status at every disconnect.
> > 0 for normal disconnect, non-zero for all others.
>
> > --
> > Sybrand Bakker
> > Senior Oracle DBA- Hide quoted text -
>
> > - Show quoted text -
>
> Question, isn't the command "audit session" rather than audit connect?
>

In 9.2.0 and later releases the AUDIT CONNECT statement is valid.

> In my past experience auditing sessions if the session terminated
> abnormally there was no disconnect entry in the audit trail.  I have
> not used the command since 8.1.7 but I am pretty sure this is still
> true on 9.2.  I do not know about with 10g+

Provided audit_trail is set to DB the DBA_AUDIT_SESSION view will provide the logoff_time and the returncode, which will be non-zero for abnormally terminated sessions. And this applies to databases from 9.2.0.x onwards.
.
>
> HTH -- Mark D Powell --- Hide quoted text -
>
> - Show quoted text -

David Fitzjarrell Received on Fri Aug 29 2008 - 11:43:46 CDT

Original text of this message