AWR报告中Parse CPU to Parse Elapsd%的理解

AWR报告中Parse CPU to Parse Elapsd%的理解
 
原文自:http://dbua.iteye.com/blog/827243
 
Parse CPU to Parse Elapsd%是指sql语句的CPU时间与总体解析时间的比率, SQL总体解析时间包括CPU时间和wait时间,这个比率过低说明SQL Parse的wait时间远远大于CPU的 Parse时间不是很正常,可能有大量lib cache latch or shared pool latch。
   有时候Parse CPU to Parse Elapsd%会超过100%,这是由于四舍五入造成的,CPU Time是一点一点纪录,并累加的(按SQL Parse 中的每个Call)而Elapsed Time 是一段一段纪录,并累加的(按SQL 一次parse)比如说,现在开始一个 parse , 中间有100次call, 本来每次应该是 0.8 微秒,但是,Oracle 纪录时每次计成是 1 微秒,结果,这一次的parse CPU 被记录成 100 微秒。而Elapsed Time 纪录的是整个的时间,等于 0.8 *100 + (wait time),结果就可能小于 100 微秒。而最终结果就是 Parse CPU to Parse Elapsd% > 100%
   Parse CPU to Parse Elapsd%的相关的统计信息可以从statspack中的Instance Activity Stats部门能够查到如:
parse time cpu                              13,305            3.5          0.2
parse time elapsed                           84,624           22.1          0.9
   Parse CPU to Parse Elapsd%过低一般是由于latch争用造成的,需要具体问题具体分析,经常伴随较高的latch free和enqueue等待事件。
 
在:http://hoopercharles.wordpress.com/2011/09/01/parse-cpu-to-parse-elapsd-what-is-wrong-with-this-quote/
中有这样一段描述:
“The Parse CPU to Parse Elapsd metric shows how much time the CPU is spending parsing SQL statements. The lower this metric is, the better. In the following example [not quoted], it is about 2%, which is very low. If this metric ever gets to 5%, it may mean investigation is warranted to determine why the CPU is spending this much time simply parsing SQL statements.”
 
 
以下是网上的一个分析:
 
AWR Analysis - Parse CPU to Parse Elapsd %
 
Under AWR’s Instance Efficiency Percentages - Parse CPU to Parse Elapsd % is one area which is more confusing and clear information will not be available. Information below talks clearly on how to we interpret the ratio.
 
• If you spend 1 CPU second on CPU to parse but total elapsed is 5 second wall clock time then it means you are waiting on some resources to complete the parsing.
 
• Ideally Parse Elapsed must be equal to Parse CPU, i.e., only CPU time is used for parsing. In that case the ratio is 100%. If wait time is more than the ratio will be less.
 
在Instance Activity Stats可以看到:
parse time cpu及parse time elapsed
而Parse CPU to Parse Elapsd%=parse time cpu÷parse time elapsed
 
以(8879/110582)*100=8.03%为例,
What does it mean and how it is being interpreted 
• Parse CPU to Parse Elapsd %: 8.03 
• It is percentage. 8.03% means .0803
• If you divide it by 1 then 1/.0803 = 12.45
• Which means 12.45 second (wall clock time) must be elapsed for every cpu second for parsing. Its not    
   good.
• It represents resource contention while parsing.Low Value for this ratio is an indicator of latching problem. Investigate the latch sections in AWR report for contention on library cache and shared pool latches.
原文地址:https://www.cnblogs.com/zougang/p/6424907.html