设为首页 收藏本站
查看: 674|回复: 0

[经验分享] 浅谈Oracle SQL trace-ylw6006

[复制链接]

尚未签到

发表于 2018-9-21 13:16:37 | 显示全部楼层 |阅读模式
  [oracle@dg53 udump]$ cat /home/oracle/trace02.log (tkprof处理后将看不到绑定变量信息)

  TKPROF:>  Copyright (c) 1982, 2005, Oracle.  All rights reserved.
  Trace file: dg53_ora_18857_hr_trace02.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
  ********************************************************************************
  alter session set events '10046 trace name context forever,level 12'
  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
  Optimizer mode: ALL_ROWS

  Parsing user>  Elapsed times include waiting on following events:
  Event waited on                             Times   Max. Wait  Total Waited
  ----------------------------------------   Waited  ----------  ------------
  SQL*Net message to client                       1        0.00          0.00
  SQL*Net message from client                     1        0.00          0.00
  ********************************************************************************
  select salary
  from
  employees where employee_id=:id
  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        2      0.00       0.01          1          2          0           1
  ------- ------  -------- ---------- ---------- ---------- ----------  ----------
  total        4      0.00       0.01          1          2          0           1
  Misses in library cache during parse: 0
  Optimizer mode: ALL_ROWS

  Parsing user>  Rows     Row Source Operation
  -------  ---------------------------------------------------
  1  TABLE ACCESS BY INDEX ROWID EMPLOYEES (cr=2 pr=1 pw=0 time=16216 us)

  1   INDEX UNIQUE SCAN EMP_EMP_ID_PK (cr=1 pr=0 pw=0 time=128 us)(object>  Rows     Execution Plan
  -------  ---------------------------------------------------
  0  SELECT STATEMENT   MODE: ALL_ROWS
  1   TABLE ACCESS   MODE: ANALYZED (BY INDEX ROWID) OF 'EMPLOYEES'
  (TABLE)
  1    INDEX   MODE: ANALYZED (UNIQUE SCAN) OF 'EMP_EMP_ID_PK' (INDEX
  (UNIQUE))
  Elapsed times include waiting on following events:
  Event waited on                             Times   Max. Wait  Total Waited
  ----------------------------------------   Waited  ----------  ------------
  SQL*Net message to client                       2        0.00          0.00
  db file sequential read                         1        0.01          0.01
  SQL*Net message from client                     2        0.00          0.00
  ********************************************************************************
  alter session set events '10046 trace name context off'
  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: 0
  Optimizer mode: ALL_ROWS

  Parsing user>  ********************************************************************************
  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        2      0.00       0.01          1          2          0           1
  ------- ------  -------- ---------- ---------- ---------- ----------  ----------
  total        7      0.00       0.01          1          2          0           1
  Misses in library cache during parse: 0
  Elapsed times include waiting on following events:
  Event waited on                             Times   Max. Wait  Total Waited
  ----------------------------------------   Waited  ----------  ------------
  SQL*Net message to client                       5        0.00          0.00
  SQL*Net message from client                     5       10.32         15.71
  db file sequential read                         1        0.01          0.01
  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.
  1  statement EXPLAINed in this session.
  ********************************************************************************
  Trace file: dg53_ora_18857_hr_trace02.trc
  Trace file compatibility: 10.01.00
  Sort options: default
  0  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.
  1  SQL statements EXPLAINed using schema:
  HR.prof$plan_table
  Default table was used.
  Table was created.
  Table was dropped.
  46  lines in trace file.
  15  elapsed seconds in trace file.
  [oracle@dg53 udump]$ head -30 dg53_ora_18857_hr_trace02.trc
  /u01/app/oracle/admin/orcl10g/udump/dg53_ora_18857_hr_trace02.trc
  *** TRACE DUMP CONTINUED FROM FILE
  /u01/app/oracle/admin/orcl10g/udump/dg53_ora_18857_hr_trace02.trc ***
  *** 2012-06-08 14:28:26.627
  =====================
  PARSING IN CURSOR #2 len=68 dep=0 uid=55 oct=42 lid=55 tim=1307750885378875
  hv=2804619552 ad='2349fc80'
  alter session set events '10046 trace name context forever,level 12'
  END OF STMT
  EXEC #2:c=0,e=107,p=0,cr=0,cu=0,mis=0,r=0,dep=0,og=1,tim=1307750885378870

  WAIT #2: nam='SQL*Net message to client' ela= 2 driver>  obj#=-1 tim=1307750885378967

  WAIT #2: nam='SQL*Net message from client' ela= 126 driver>  obj#=-1 tim=1307750885379118

  WAIT #0: nam='SQL*Net message to client' ela= 1 driver>  obj#=-1 tim=1307750885379173

  WAIT #0: nam='SQL*Net message from client' ela= 5384831 driver>  p3=0 obj#=-1 tim=1307750890764022
  =====================
  PARSING IN CURSOR #3 len=50 dep=0 uid=55 oct=3 lid=55 tim=1307750890764197  hv=2273608758 ad='2349fa44'
  select salary from employees where employee_id=:id
  END OF STMT
  PARSE #3:c=0,e=96,p=0,cr=0,cu=0,mis=0,r=0,dep=0,og=1,tim=1307750890764193
  BINDS #3:
  kkscoacd
  Bind#0
  oacdty=02 mxl=22(22) mxlc=00 mal=00 scl=00 pre=00
  oacflg=03 fl2=1000000 frm=00 csi=00 siz=24 off=0
  kxsbbbfp=b7fb9ad0  bln=22  avl=02  flg=05
  value=200
  EXEC #3:c=0,e=334,p=0,cr=0,cu=0,mis=0,r=0,dep=0,og=1,tim=1307750890764600

  WAIT #3: nam='SQL*Net message to client' ela= 2 driver>  WAIT #3: nam='db file sequential read' ela= 13073 file#=5 block#=84 blocks=1 obj#=51857 tim=1307750890780678
  FETCH #3:c=5999,e=16119,p=1,cr=2,cu=0,mis=0,r=1,dep=0,og=1,tim=1307750890780769


运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.iyunv.com/thread-599455-1-1.html 上篇帖子: oracle关于坏块的修复一 下篇帖子: NBU异机恢复ORACLE成功版本
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表