To generate a trace in the current session:
10046 trace:
alter session set events '10046 trace name context forever, level 8';
(0r)
alter session set events '10046 trace name context forever, level 12';
Note: 12 will trace wait_events and bind variables
10053 trace:
alter session set events '10053 trace name context forever';
(or)
alter session set events '10053 trace name context forever, level 1' ;
Note: To generate a trace in your current session you will need privilege to set trace for yourself. In case the above commands doesn't work please check if you have privileges to set trace for yourself.
To generate a trace for a particular session:
10046 trace:
Ex: EXEC SYS.DBMS_SYSTEM.SET_EV(SID,SERIAL#,10046,8,'');
(or)
EXEC SYS.DBMS_SYSTEM.SET_EV(SID,SERIAL#,10046,12,'');
10053 trace:
Ex: EXEC SYS.DBMS_SYSTEM.SET_EV(SID,SERIAL#,10053,1,'');
Note: You can get the SID, SERIAL# from v$session
To turn-off trace in your current session that you have put trace on:
10046 trace:
alter session set events '10046 trace name context off';
10053 trace:
alter session set events '10053 trace name context off';
To turn-off trace for a particular session that you have put trace on:
10046 trace:
EXEC SYS.DBMS_SYSTEM.SET_EV(SID,SERIAL#,10046,0,'');
10053 trace:
EXEC SYS.DBMS_SYSTEM.SET_EV(SID,SERIAL#,10053,0,'');
Note: The SID, SERIAL# are the values of a particular session for which you have put the trace on.
References:
http://oradbatips.blogspot.com/2007/03/tip-38-tracing-session-with-10046-event.html
some commands have been taken from above link and some commands are that I have used at my work.
No comments:
Post a Comment