Monday, November 29, 2021

Use session logon trigger to capture SQL statements executed in packaged applications

 create or replace trigger trg_logon_sql_trace

after logon on dmsuser.schema

begin

  -- optional set tracefile identifier to make files easier identifiable

  execute immediate 'ALTER SESSION SET TRACEFILE_IDENTIFIER =''dmsuser''';


  --  enable sql_trace for this session:

 dbms_session.set_sql_trace(sql_trace => TRUE);

  --  execute immediate 'ALTER SESSION SET SQL_TRACE=TRUE';

  --- execute immediate 'alter session set events ''10046 trace name context forever,level 12''';

end;

/


No comments:

Post a Comment