ITPub博客

首页 > 数据库 > 数据库开发技术 > 怎么估算一段时间里,几条SQL所占用的时间

怎么估算一段时间里,几条SQL所占用的时间

原创 数据库开发技术 作者:pentium 时间:2007-07-20 18:21:56 0 删除 编辑
http://www.itpub.net/817953.html[@more@]



....................................................CPU.......Elapsd

Buffer Gets Executions Gets per Exec
%Total Time (s) Time (s) Hash Value--------------- ------------ -------------- ------ -------- --------- ----------
57,829,948 686 84,300.2 17.0 994.30 2768.46 3580151673...



17.0 == %Total
994.30 =CPU Times
2768.46 =Elapsed Times

%CPU 在9i 的DB里只能自己估算,找到
CPU used by this session 1,143,177 317.5 59.9
要第一个值/100,得到Total CPU秒数
然后用top sql里的cpu time / Total CPU 就可以得到 CPU%

从理论上来说,你可以自己改spreport.sql 来增加一个Top CPU 的section

Parse CPU to Parse Elapsd %:计算公式为:Parse CPU to Parse Elapsd %= 100*(parse time cpu / parse time elapsed)。即:解析实际运行时间/(解析实际运行时间+解析中等待资源时间)。此处为11.4%,非常低,用于解析花费的每个CPU秒花费了大约8.77秒的wall clock时间,这说明花了很多时间等待一个资源。如果该比率为100%,意味着CPU时间等于经过的时间,没有任何等待。

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/14377/viewspace-927270/ ,如需转载,请注明出处,否则将追究法律责任。

上一篇: statspack使用手册
请登录后发表评论 登录
全部评论

注册时间:2010-09-30

  • 博文量
    191
  • 访问量
    327283