create or replace
trigger vg_trace_trigger
after logon on database
DECLARE
  lv_osuser    v$session.osuser%TYPE;
  lv_username  v$session.username%TYPE;
  lv_module    v$session.module%TYPE;
  lv_program   v$session.program%TYPE;
  lv_machine   v$session.machine%TYPE;
begin
     select osuser
          , username
          , module
          , program
          , machine
      INTO lv_osuser
         , lv_username
         , lv_module
         , lv_program
         , lv_machine
      FROM v$session
     WHERE audsid = userenv('SESSIONID');


  IF    UPPER(lv_program) like 'FIX%UPLOAD%'  
     OR lv_username in ('RABO_REPORTS')
     OR UPPER(lv_program) like 'VOL%ANALY%'  
  THEN
     execute immediate 'alter session  set events ''10046 trace name context forever, level 12''';     
  END IF;
end;
/

