Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Automize SQL TRACE OPERATION
Hi,
Should I automize the process of SQL Tracing for a particular session of our choice?
Let’s say when there are several sessions, and we want to select the particular session for SQL TRACING, then the SQL tracing for that session enable via running a routine.
I used AFTER LOGON trigger for enabling SQL trace, but using this approach enable SQL TRACING all the sessions.
My Logon Trigger for enabling SQL Tracing:
create or replace trigger LOGON_SQL_TRACE
after logon on database
begin
execute immediate
'alter session set sql_trace=true';
end;
/
I want to use a perfect routine that first get the sid, serial# or username etc. from V$session, V$process or else, and then enable the SQL TRACING for the selected session.
Like SYS.DBMS.SYSTEM.SET_SQL_TRACE_IN_SESSION package is available for doing that or may be some others as well. But how should we use these packages or other SQL tracing commands in a routine, which we can use for, enable SQL Tracing implicitly. Any ideas will be great.
Bill Received on Mon Mar 08 2004 - 22:40:39 CST