  | | | CPU Time calculation in AWR Reports | CPU Time calculation in AWR Reports 2007-11-02 - By LS Cheng
Back I think the difference may be because v$sysstat is refreshed after a call is completed but in SYS_TIME_MODEL_CPU it gets refreshed every 3 seconds
Thanks
-- LSC
On Nov 1, 2007 6:10 PM, Tanel Poder <tanel.poder.003@(protected)> wrote:
> Well you can trace the awrrpt run... > > I suspect (but don't know for sure) that AWR uses DBA_HIST_SYS_TIME_MODEL > for its CPU info... V$SYS_TIME_MODEL CPU values can differ from V$SYSSTAT > ones... > > SQL> select > 2 a.value/1000000 time_model_seconds, > 3 b.value/10000 sysstat_seconds, > 4 a.value/1000000 - b.value/10000 missing_seconds > 5 from > 6 v$sys_time_model a, > 7 v$sysstat b > 8 where > 9 a.stat_name = 'DB CPU' > 10 and b.name = 'CPU used by this session' > 11 / > > TIME_MODEL_SECONDS SYSSTAT_SECONDS MISSING_SECONDS > -- ---- ---- ----- -- ---- ---- -- -- ---- ---- -- > 126.997282 4.6276 122.369682 > > > -- > Regards, > Tanel Poder > http://blog.tanelpoder.com > > > > -- --Original Message-- -- > > From: oracle-l-bounce@(protected) > > [mailto:oracle-l-bounce@(protected)] On Behalf Of Luis > > Fernando Cerri > > Sent: Thursday, November 01, 2007 23:20 > > To: oracle-l@(protected) > > Subject: CPU Time calculation in AWR Reports > > > > Hello, list. > > > > At Statspack age, 'CPU Time' value in section 'Top 5 Timed > > Events' was calculated as the difference of 'CPU used by this > > session' values between two snapshots: > > > > select 'CPU' , (e.value-b.value)/100 time > > from stats$sysstat b, stats$sysstat e > > where e.snap_id = :v_eid > > and b.snap_id = :v_bid > > and e.name = 'CPU used > > by this session' > > and b.name = 'CPU used > > by this session'; > > > > > > -- > http://www.freelists.org/webpage/oracle-l > > >
I think the difference may be because v$sysstat is refreshed after a call is completed but in SYS_TIME_MODEL_CPU it gets refreshed every 3 seconds<br><br> <br>Thanks<br><br>--<br>LSC<br><br><div class="gmail_quote">On Nov 1, 2007 6:10 PM, Tanel Poder < <a href="mailto:tanel.poder.003@(protected)">tanel.poder.003@(protected)</a>> wrote: <br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Well you can trace the awrrpt run... <br><br>I suspect (but don't know for sure) that AWR uses DBA_HIST_SYS_TIME _MODEL<br>for its CPU info... V$SYS_TIME_MODEL CPU values can differ from V $SYSSTAT<br>ones...<br><br>SQL> select<br> 2 a.value /1000000 time_model_seconds, <br> 3 b.value/10000 sysstat_seconds,<br> 4 a.value/1000000 - b.value/10000 missing_seconds<br> 5   ;from<br> 6 v$sys_time_model a,<br> 7 v $sysstat b<br> 8 where<br> 9 a.stat_name = ' ;DB CPU' <br> 10 and <a href="http://b.name" target="_blank">b.name</a> = & #39;CPU used by this session'<br> 11 /<br><br>TIME_MODEL_SECONDS SYSSTAT_SECONDS MISSING_SECONDS<br>-- ---- ---- ----- -- ---- ---- -- -- ------ -- --- <br> 126.997282 4 .6276 122.369682<br><font color="#888888"><br><br>--<br >Regards,<br>Tanel Poder<br><a href="http://blog.tanelpoder.com" target="_blank" >http://blog.tanelpoder.com</a><br></font><div class="Ih2E3d"> <br><br>> -- --Original Message-- --<br>> From: <a href="mailto:oracle-l -bounce@(protected)">oracle-l-bounce@(protected)</a><br>> [mailto:<a href ="mailto:oracle-l-bounce@(protected)">oracle-l-bounce@(protected) </a>] On Behalf Of Luis<br>> Fernando Cerri<br>> Sent: Thursday, November 01, 2007 23:20<br>> To: <a href="mailto:oracle-l@(protected)">oracle-l @(protected)</a><br>> Subject: CPU Time calculation in AWR Reports <br>><br>> Hello, list.<br>><br>> At Statspack age, 'CPU Time& #39; value in section 'Top 5 Timed<br>> Events' was calculated as the difference of 'CPU used by this<br>> session' values between two snapshots: <br>><br>> select 'CPU' , (e.value-b.value)/100 time<br>> from stats$sysstat b, stats$sysstat e<br>> where e.snap_id = :v_eid <br>> and b.snap_id = :v_bid<br>> and <a href="http://e.name" target="_blank">e.name</a> = 'CPU used<br>> by this session' <br>> and <a href="http://b.name" target="_blank">b.name</a> = 'CPU used<br>> by this session';<br>><br>><br> <br></div><div><div></div><div class="Wj3C7c">--<br><a href="http://www .freelists.org/webpage/oracle-l" target="_blank"> http://www.freelists.org/webpage/oracle-l</a><br><br><br></div></div>< /blockquote></div><br>
|
|
 |