Logon trigger : Database Trigger « Trigger « Oracle PL / SQL






Logon trigger

  
SQL>
SQL> set echo on
SQL>
SQL>
SQL> create or replace trigger logon_trigger
  2  after logon on database
  3  begin
  4    if ( user = 'YourName' ) then
  5      execute immediate
  6      'ALTER SESSION SET EVENTS ''10046 TRACE NAME CONTEXT FOREVER, LEVEL 4''';
  7    end if;
  8  end;
  9  /

Trigger created.

SQL>
SQL>
SQL> --

   
  








Related examples in the same category

1.Trigger for database startup event
2.Trigger to log the database shutdown
3.After logon database trigger
4.Log database logon to a table
5.Log a server error to a table
6.Log a server error with information on time, user name, database name
7.A system trigger(AFTER CREATE ON DATABASE) .
8.creating a logon/logoff auditing system using system-level triggers:
9.Save information about all errors in an after-servererror on database
10.Submit a job for altering user in an after-create-database trigger