Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> SESSION INFO VIA AUDITING + LOGON TRIGGERS

SESSION INFO VIA AUDITING + LOGON TRIGGERS

From: AMIT <kumar_929_at_yahoo.co.uk>
Date: 15 Mar 2004 06:43:08 -0800
Message-ID: <6f94b59f.0403150643.631015d8@posting.google.com>


Hi,

>>I am using the following logon trigger to store all the session
>>information into a table "client_info"
>>When ever the user logon , his session information stores in the
>>client_info table.

>>And when the session logoff its information will be deleted from
>>the table client_inf via Logoff trigger.
>>This is our requirement.

>>But the problem is that , The information will not be deleted from
>>the client info table , if the user logoff abnormally from the
>>database.

>>How to overcome this issue.
>>I am using auditing + logon and logoff trigger in order get the
>>session info.
>>
>>Any idea will be great.
>>
>>Regards
>>
>>KUMAR
>>
>>
>>
>>
>>CREATE OR REPLACE TRIGGER trg_client_info
>>AFTER LOGON ON DATABASE
>>
>> BEGIN
>>
>>execute immediate
>>
>>'INSERT INTO client_info(session_id,client_name,sid,
>>serial#,workstation,host_name,logon_time , description)
>>select a.sessionid,a.username , b.sid, b.serial#, a.os_username,
>>b.machine,b.logon_time,a.comment_text from user_Audit_trail a ,
>>V$session b
>>where a.sessionid = b.audsid
>>and a.username = b.username
>>and a.sessionid=userenv(''sessionid'')';
>>
>> commit;
>>
>> END;
>>/
>>
>>
>>
>>
>> CREATE OR REPLACE TRIGGER logoff_session
>> BEFORE LOGOFF ON DATABASE
>>
>> BEGIN
>>
>> DELETE from client_info where session_id = userenv('sessionid');
>>
>>commit;
>>
>> END;
>>/
>>
Received on Mon Mar 15 2004 - 08:43:08 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US