Database Logoff Trigger as a Data Collector

Prior to Oracle8i Database, database triggers could only be created on tables and views and fired on DML events. In Oracle8i Database, Oracle extended its database trigger capability so that database triggers can be defined at the database or schema level and can fire on certain database and DDL events. The database events include STARTUP, SHUTDOWN, SERVERERROR, LOGON, and LOGOFF. The DDL events include CREATE, DROP, and ALTER.

The database trigger of interest here is the BEFORE LOGOFF trigger. It can be used to collect summarized session-level wait event data and CPU statistics from the V$SESSION_EVENT and V$SESSTAT views when sessions log off. Among the benefits, you can see all the events that belong ...

Get Oracle Wait Interface: A Practical Guide to Performance Diagnostics & Tuning now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.