Enable Tracing For A Particular Program
I am using the following LOGON trigger, in order to get the SQL TRACING enable for the session, which is currently running EXCEL.EXE Program.
But in this way, the SQL TRACING for other sessions were also enable, when they logon to the database using other program rather than EXCEL.
Because, we only need to enable the SQL TRACING, for the session which is running the EXCEL PROGRAM, not for other programs/sessions.
I am looking forward to an advice .
CREATE OR REPLACE TRIGGER testtrg
AFTER LOGON ON DATABASE
select username,sid,serial#,program,logon_time into v_username,v_sid,v_serial#,v_program,
v_time from v$session s
where sys_context('userenv','SESSIONID')=s.audsid and s.program='EXCEL.EXE';
if (v_program = 'EXCEL.EXE') then
'exec dbms_system.set_sql_trace_in_session(v_sid,v_serial#,true)' ;
Click Here to Expand Forum to Full Width