vvsantos of Scripts Oracle Adm
1/25/2017 - 9:38 AM

Trigger trace

Trigger trace


create or replace trigger TRG_TRACE_AL_acc_user AFTER LOGON ON DATABASE
begin
    if sys_context( 'USERENV','SESSION_USER') = 'ACCOUNT_USER' then
              execute immediate 'alter session set tracefile_identifier=''ACCOUNT_USER''';
                  execute immediate 'alter session set optimizer_max_permutations=40000';
                  execute immediate 'alter session set events ''10046 trace name context forever, level 12''';
   end if;
end;
/
drop trigger TRG_TRACE_AL_acc_user