Create System Login and Logout Structures

The create_signon_trigger.sql must run in the SYSTEM account to build triggers with access to all user logins and logouts. This script is rerunnable by searching and deleting preexisting objects in the database. It then builds a connection_log table and row-level trigger to automatically populate the surrogate primary key, the package with a procedure for connecting and disconnecting, and two system-level triggers to capture login and logout events.

The create_signon_trigger.sql program follows:

-- This is found in create_signon_trigger.sql on the enclosed CD. DECLARE -- Define an exception. wrong_schema EXCEPTION; PRAGMA EXCEPTION_INIT(wrong_schema,-20001); -- Define a return variable. retval VARCHAR2(1 ...

Get Oracle Database 10g Express Edition PHP Web Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.