读懂sql_trace

TKPROF: Release 11.2.0.1.0 - Development on 星期一 11月 3 21:39:41 2014

Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.

Trace file: c:\orcl_ora_4075.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
********************************************************************************

SQL ID: 4tk6t8tfsfqbf
Plan Hash: 0
alter session set sql_trace=true


call     count       cpu    elapsed       disk      query    current        rows
------- ------  -------- ---------- ---------- ---------- ----------  ----------
Parse        0      0.00       0.00          0          0          0           0
Execute      1      0.00       0.00          0          0          0           0
Fetch        0      0.00       0.00          0          0          0           0
------- ------  -------- ---------- ---------- ---------- ----------  ----------
total        1      0.00       0.00          0          0          0           0

Misses in library cache during parse: 0
Misses in library cache during execute: 1
Optimizer mode: ALL_ROWS
Parsing user id: SYS
********************************************************************************

select t.ename,m.dname from scott.EMP t,scott.dept m where t.deptno=m.deptno
and m.deptno=88

call     count       cpu    elapsed       disk      query    current        rows
------- ------  -------- ---------- ---------- ---------- ----------  ----------
Parse        1      0.00       0.00          0          0          0           0
Execute      1      0.00       0.00          0          0          0           0
Fetch        7      0.01       0.01          0         84          0          90
------- ------  -------- ---------- ---------- ---------- ----------  ----------
total        9      0.01       0.01          0         84          0          90

Misses in library cache during parse: 0--如果是软分析这里为0 硬分析为1
Optimizer mode: ALL_ROWS
Parsing user id: SYS

/*
cr=222957          -- 一致性读取数据库的块数  --相当于FETCH query的数目
pr=222186          -- 物理读取
pw=0               -- 物理写
time=100000562 us  -- 占用时间,单位:微妙 百万分之一秒
rows		--实际返回的行数

*/


Rows     Row Source Operation
-------  ---------------------------------------------------
     90  NESTED LOOPS  (cr=84 pr=0 pw=0 time=0 us cost=4 size=22 card=1)
      1   TABLE ACCESS BY INDEX ROWID DEPT (cr=2 pr=0 pw=0 time=0 us cost=1 size=13 card=1)
      1    INDEX UNIQUE SCAN PK_DEPT (cr=1 pr=0 pw=0 time=0 us cost=0 size=0 card=1)(object id 

73180)
     90   TABLE ACCESS FULL EMP (cr=82 pr=0 pw=0 time=0 us cost=3 size=9 card=1)

********************************************************************************

SQL ID: aam2chsgpj7mb
Plan Hash: 0
alter session set sql_trace=false


call     count       cpu    elapsed       disk      query    current        rows
------- ------  -------- ---------- ---------- ---------- ----------  ----------
Parse        1      0.00       0.00          0          0          0           0
Execute      1      0.00       0.00          0          0          0           0
Fetch        0      0.00       0.00          0          0          0           0
------- ------  -------- ---------- ---------- ---------- ----------  ----------
total        2      0.00       0.00          0          0          0           0

Misses in library cache during parse: 1
Optimizer mode: ALL_ROWS
Parsing user id: SYS



********************************************************************************

OVERALL TOTALS FOR ALL NON-RECURSIVE STATEMENTS

call     count       cpu    elapsed       disk      query    current        rows
------- ------  -------- ---------- ---------- ---------- ----------  ----------
Parse        2      0.00       0.00          0          0          0           0
Execute      3      0.00       0.00          0          0          0           0
Fetch        7      0.01       0.01          0         84          0          90
------- ------  -------- ---------- ---------- ---------- ----------  ----------
total       12      0.01       0.02          0         84          0          90

Misses in library cache during parse: 1
Misses in library cache during execute: 1


OVERALL TOTALS FOR ALL RECURSIVE STATEMENTS

call     count       cpu    elapsed       disk      query    current        rows
------- ------  -------- ---------- ---------- ---------- ----------  ----------
Parse        0      0.00       0.00          0          0          0           0
Execute      0      0.00       0.00          0          0          0           0
Fetch        0      0.00       0.00          0          0          0           0
------- ------  -------- ---------- ---------- ---------- ----------  ----------
total        0      0.00       0.00          0          0          0           0

Misses in library cache during parse: 0

    3  user  SQL statements in session.
    0  internal SQL statements in session.
    3  SQL statements in session.
********************************************************************************
Trace file: c:\orcl_ora_4075.trc
Trace file compatibility: 11.1.0.7
Sort options: default

       1  session in tracefile.
       3  user  SQL statements in trace file.
       0  internal SQL statements in trace file.
       3  SQL statements in trace file.
       3  unique SQL statements in trace file.
      57  lines in trace file.
      13  elapsed seconds in trace file.

  

posted @ 2014-11-03 22:00  许志伟  阅读(294)  评论(0编辑  收藏  举报