Re: Can we trigger event for abnormal loss of connection to oracle databse?
Date: Fri, 29 Aug 2008 12:29:46 -0700 (PDT)
Message-ID: <9f4e0c89-d590-46d9-9c71-b9c80070d80f@m3g2000hsc.googlegroups.com>
On Aug 29, 12:43 pm, "fitzjarr..._at_cox.net" <orat..._at_msn.com> wrote:
> 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- Hide quoted text -
>
> - Show quoted text -
Thanks Dave. -- Mark -- Received on Fri Aug 29 2008 - 14:29:46 CDT