Oracle EBS SQL Trace日志收集的方法
- - CSDN博客推荐文章Raw Trace的收集方法. 打开Trace,Help > Diagnostics > Trace > Trace > Trace with Binds and Waits. Trace项代表的意思. 3.关闭Trace,Help > Diagnostics > Trace > Trace > No Trace.
1. 打开Trace,Help > Diagnostics > Trace > Trace > Trace with Binds and Waits
Trace项代表的意思
ALTER SESSION SET SQL_TRACE = TRUE;
2.执行业务功能
3.关闭Trace,Help > Diagnostics > Trace > Trace > No Trace
系统会弹出一个窗口,告诉你Trace文件所在的目录。
这个目录实际上是数据库系统参数表(v$parameter)中的 user_dump_dest的值,可以执行下边的SQL来找到Trace文件所在的目录
SELECT value FROM v$parameter WHERE name = 'user_dump_dest'; Output:/slot/ems7061/oracle/db/tech_st/11.2.0/admin/az1mu213_rws60145rems/diag/rdbms/az1mu213/az1mu213/trace
trace文件名后边的那个数字是Database Server PID,也可以从Help>About中找到。
之前我们收集的trace日志仍为Raw Trace,如果要做性能分析的话,往往要转换为TKPROF,TKPROF可以把Raw Trace转换为更易读的形式。
TKPROF Command $tkprof raw_trace_file.trc output_file explain=apps/apps sort=(exeela,fchela) sys=no Sample: TKPROF raw_trace.trc OUTPUTA.TKPROF EXPLAIN=scott/tiger SYS=NO SORT=(EXECPU,FCHCPU)
TKRPOF Sample Output
Tkprof: Release 9.2.0.1.0 - Production on Tue Dec 24 15:32:43 2002 Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved. Trace file: ORCL102_ora_3064.trc Sort options: default ******************************************************************************** count = number of times OCI procedure was executed cpu = cpu time in seconds executing elapsed = elapsed time in seconds executing disk = number of physical reads of buffers from disk query = number of buffers gotten for consistent read current = number of buffers gotten in current mode (usually for update) rows = number of rows processed by the fetch or execute call ******************************************************************************** select * from employee where emp_id = 3737 call count cpu elapsed disk query current rows ------- ------ -------- ---------- ---------- ---------- ---------- ---------- Parse 10 0.00 0.03 0 0 0 0 Execute 10 0.00 0.00 0 0 0 0 Fetch 20 0.34 0.35 72 4730 0 10 ------- ------ -------- ---------- ---------- ---------- ---------- ---------- total 40 0.34 0.39 72 4730 0 10 Misses in library cache during parse: 1 Optimizer goal: CHOOSE Parsing user id: 59 Rows Row Source Operation ------- --------------------------------------------------- 1 TABLE ACCESS FULL EMPLOYEE