oracle tkprof工具详解(二)
execu number of buffers for current read during execute
exerow number of rows processed during execute
exemis number of library cache misses during execute
fchcnt number of times fetch was called
fchcpu cpu time spent fetching
fchela elapsed time fetching
fchdsk number of disk reads during fetch
fchqry number of buffers for consistent read during fetch
fchcu number of buffers for current read during fetch
fchrow number of rows fetched
userid userid of user that parsed the cursor
sys:在进行sql运行的时候,或出现递归查询,设置sys为no则忽略这些recursive sql,设置为yes则在执行计划中包括这些recursive sql
aggregate:对sql的运行情况进行统计
waits:显示wait event的概要信息
insert:把执行计划都生成一个sql文件,使用这个sql可以创建sql的整个过程。
record:创建一个包含客户端发出的所有sql的脚本文件,并不包括recursive sql,
可以通过该参数查看客户端程序是怎么运行的,整个运行sql的过程顺序是什么样的。
四)tkprof工具使用案例:
案例一:
eg:
[html]
[oracle@oracle-one trace]$ tkprof RHYS_ora_3191.trc sql_explain.txt sys=no explain=scott/root aggregate=yes record=sql_path.txt waits=yes
TKPROF: Release 11.2.0.4.0 - Development on Thu Sep 26 22:37:26 2013
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
[oracle@oracle-one trace]$
[oracle@oracle-one trace]$ more sql_explain.txt
TKPROF: Release 11.2.0.4.0 - Development on Thu Sep 26 22:37:26 2013
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
Trace file: RHYS_ora_3191.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 mo
de (usually for update)
rows = number of rows processed by the fetch or execute call
********************************************************************************
The following statement encountered a error during parse:
select * from rhys.amy_dept
PARSE #1399268
Error encountered: ORA-00942
********************************************************************************
SQL ID: 9m7787camwh4m Plan Hash: 0
begin :id := sys.dbms_transaction.local_transaction_id; end;
call count cpu elapsed disk query current rows
------- ------ -------- ---------- ---------- ---------- ---------- ----------
Parse 5 0.00 0.00 0 0 0 0
Execute 6 0.00 0.00 0 0 0 6
Fetch 0 0.00 0.00 0 0 0 0
------- ------ -------- ---------- ---------- ---------- ---------- ----------
total 11 0.00 0.00 0 0 0 6
Misses in library cache during parse: 0
Optimizer mode: ALL_ROWS
Parsing user id: 83 (SCOTT)
********************************************************************************
SQL ID: cf06fwacdmgfk Plan Hash: 1388734953
select 'x'
from
dual
call count cpu elapsed disk query current rows
------- ------ -------- ---------- ---------- ---------- ---------- ----------
Parse 3 0.00 0.00 0 0 0 0
Execute 3 0.00 0.00 0 0 0 0
Fetch 3 0.00 0.00 0 0 0 3
------- ------ -------- ---------- ---------- ---------- ---------- ----------
total 9 0.00 0.00 0 0 0 3
Misses in library cache during parse: 1
Optimizer mode: ALL_ROWS
Parsing user id: 83 (SCOTT)
Number of plan statistics captured: 3
Rows (1st) Rows (avg) Rows (max) Row Source Operation
----------