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.


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM