給會話開跟蹤

fei890910發表於2016-09-23
SCOTT@ prod1>select sid from v$mystat where rownum=1;
       SID
----------
        61
SCOTT@ prod1>select  sid,serial# from v$session where sid=61;
       SID    SERIAL#
---------- ----------
        61       1779

SYS@ prod1>exec dbms_system.set_sql_trace_in_session(61,1779,true);
PL/SQL procedure successfully completed.
SYS@ prod1>exec dbms_system.set_sql_trace_in_session(61,1779,false);
PL/SQL procedure successfully completed.


SYS@ prod1>select value from v$diag_info where name = 'Default Trace File';
VALUE
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
/u01/app/oracle/diag/rdbms/prod/prod1/trace/prod1_ora_20239.trc


來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/29108064/viewspace-2125498/,如需轉載,請註明出處,否則將追究法律責任。

相關文章