René Nyffenegger's collection of things on the web
René Nyffenegger on Oracle - Most wanted - Feedback
 

Logoff trigger [Oracle]

A logoff trigger fires when a session disconnects.
Here's a small example to demonstrate it. A record will be inserted into a table (logoff_tbl) when someone disconnects. The record consists of the username and when he disconnected.
create table logoff_tbl (
  who  varchar2(30),
  when date
);
create trigger trg_logoff
before logoff on database
begin
  insert into logoff_tbl values(sys_context('userenv','session_user'), sysdate);
end;
/
It is not executed, however, if
It's probably easier to use the audit session sql statement to see who logged off (and on) at what time.