tkprof

tkprof
1:

alter session set timed_statistics=true;--方便看时间
 alter session set sql_trace=true;

2:执行要测试的sql

3:关闭
alter session set sql_trace=true;


4:取得跟踪文件

 select c.value || '/' || d.instance_name ||
                   '_ora_' || a.spid || '.trc' trace
  from v$process a, v$session b, v$parameter c, v$instance d
 where a.addr = b.paddr
   and b.audsid = userenv('sessionid')
   and c.name = 'user_dump_dest'
/



在cmd下,执行tkprof

D:\Documents and Settings\yubao>tkprof E:\ORACLE\PRODUCT\10.2.0\ADMIN\ORCL\UDUMP\orcl_ora_5836.trc c:\tkprof.txt

TKPROF: Release 10.2.0.1.0 - Production on 星期六 7月 24 18:15:22 2010

Copyright (c) 1982, 2005, Oracle.  All rights reserved.


tkprof 的的参数是第四步取得的跟踪文件名,后面参数是输出文件


你可能感兴趣的:(java,oracle,sql,C++,c)