SQL> show parameter timed_statistics
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
timed_statistics boolean TRUE
SQL> show parameter max_dump_file_size
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
max_dump_file_size string UNLIMITED
SQL> show parameter user_dump_dest
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
user_dump_dest string /home/oracle/oracle/product/10
.2.0/db_1/admin/pm/udump
SQL>
SQL> alter session set sql_trace true;
Session altered.
获取产生的trc的文件名
SQL> select spid,s.sid,s.serial#,p.username,p.program
2 from v$process p, v$session s
3 where p.addr=s.paddr
4 and s.sid=(select sid from v$mystat where rownum=1);
SPID SID SERIAL# USERNAME
------------ ---------- ---------- ---------------
PROGRAM
------------------------------------------------
3467 159 3 oracle
oracle@linren (TNS V1-V3)
tkprof pm_ora_12368.trc rich1.txt explain=user/passwd record=record1.sql
SID=140,SERIAL#=1527
SQL> exec dbms_monitor.session_trace_enable(140,1527,true,false);
PL/SQL procedure successfully completed.
SQL> exec dbms_monitor.session_trace_disable(140,1527);
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/7301064/viewspace-442645/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/7301064/viewspace-442645/