你好,游客 登录 注册 搜索
背景:
阅读新闻

Oracle EBS SQL Trace日志收集的方法

[日期:2012-06-19] 来源:Linux社区  作者:pan_tian [字体:大 中 小]

TKPROF

之前我们收集的trace日志仍为Raw Trace,如果要做性能分析的话,往往要转换为TKPROF,TKPROF可以把Raw Trace转换为更易读的形式。

  1. TKPROF Command   
  2. $tkprof tracefile outputfile [explain= ] [table= ] [print= ] [insert= ] [sys= ] [sort= ] ...  
  3.   
  4. Sample:  
  5. TKPROF raw_trace.trc OUTPUTA.TKPROF EXPLAIN=scott/tiger SYS=NO SORT=(EXECPU,FCHCPU)  

tracefile:你要分析的trace文件

outputfile:格式化后的文件

explain=user/password@connectstring

table=schema.tablename

    注1:这两个参数是一起使用的,通过连接数据库对在trace文件中出现的每条sql语句查看执行计划,并将之输出到outputfile中

    注2:该table必须是数据库中不存在的,如果存在会报错

print=n:只列出最初N个sql执行语句

insert=filename:会产生一个sql文件,运行此文件可将收集到的数据insert到数据库表中

sys=no:过滤掉由sys执行的语句

record=filename:可将非嵌套执行的sql语句过滤到指定的文件中去

waits=yes|no:是否统计任何等待事件

aggregate=yes|no:是否将相同sql语句的执行信息合计起来,默认为yes

sort=option:设置排序选项,选项如下:

        prscnt:number of times parse was called
        prscpu:cpu time parsing
        prsela:elapsed time parsing
        prsdsk:number of disk reads during parse
        prsqry:number of buffers for consistent read during parse
        prscu:number of buffers for current read during parse
        prsmis:number of misses in library cache during parse
        execnt:number of execute was called
        execpu:cpu time spent executing
        exeela:elapsed time executing
        exedsk:number of disk reads during execute
        exeqry:number of buffers for consistent read during execute
        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

 
  1. Tkprof: Release 9.2.0.1.0 - Production on Tue Dec 24 15:32:43 2002  
  2. Copyright (c) 1982, 2002, Oracle Corporation.  All rights reserved.  
  3.   
  4. Trace file: ORCL102_ora_3064.trc  
  5.   
  6. Sort options: default  
  7.   
  8. ********************************************************************************  
  9. count    = number of times OCI procedure was executed  
  10. cpu      = cpu time in seconds executing  
  11. elapsed  = elapsed time in seconds executing  
  12. disk     = number of physical reads of buffers from disk  
  13. query    = number of buffers gotten for consistent read  
  14. current  = number of buffers gotten in current mode (usually for update)  
  15. rows     = number of rows processed by the fetch or execute call  
  16. ********************************************************************************  
  17.   
  18. select *  
  19. from  
  20.  employee where emp_id = 3737  
  21.    
  22. call     count       cpu    elapsed       disk      query    current        rows  
  23. ------- ------  -------- ---------- ---------- ---------- ----------  ----------  
  24. Parse       10      0.00       0.03          0          0          0           0  
  25. Execute     10      0.00       0.00          0          0          0           0  
  26. Fetch       20      0.34       0.35         72       4730          0          10  
  27. ------- ------  -------- ---------- ---------- ---------- ----------  ----------  
  28. total       40      0.34       0.39         72       4730          0          10  
  29.    
  30. Misses in library cache during parse: 1  
  31. Optimizer goal: CHOOSE  
  32. Parsing user id: 59  
  33.    
  34. Rows     Row Source Operation  
  35. -------  ---------------------------------------------------  
  36.       1  TABLE ACCESS FULL EMPLOYEE  
linux
相关资讯       Oracle高级培训 
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数

       

评论声明
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款