conn ocp007/ocp007
SQL> select value from v$parameter where name in('user_dump_dest','timed_statistics');
VALUE
--------------------------------------------------------------------------------
TRUE
d:\oracle\admin\myDB\udump
SQL> select sid,serial#,username from v$session;
SID SERIAL# USERNAME
---------- ---------- --------------------
1 1
2 1
3 1
4 1
5 1
6 1
7 1
8 1
9 303
10 7 DBSNMP
12 471
SID SERIAL# USERNAME
---------- ---------- --------------------
14 187
20 141 OCP007
已选择13行。
conn sys/sys as sysdba
SQL> execute dbms_system.set_sql_trace_in_session(20,141,true);
PL/SQL 过程已成功完成。
SQL> select * from employees where employee_id between 10 and 100;
mydb_ora_5544.trc
D:\oracle\admin\myDB\udump>tkprof mydb_ora_5544.trc format.txt
TKPROF: Release 9.2.0.1.0 - Production on 星期一 5月 12 22:14:06 2008
Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
D:\oracle\admin\myDB\udump>
format.txt
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/95429/viewspace-265214/ ,如需转载,请注明出处,否则将追究法律责任。