In this case it should be the same at the end of the day. Shouldn't it be?
After Jonathan posted his AWR observations, I couldn't reproduce similar
behavior and don't believe the time is calculated as *CPU used by this
session + recursive calls cpu usage*. At least not always. Here is a
post Recursive
Calls <
http://vsadilovskiy.wordpress.com/2007/11/05/recursive-calls/> that
demonstrates differences in reporting recursive calls CPU usage in various
tools.
I agree that the source of *CPU used by this session* value in v$sysstat
that is *definitely used* to report *CPU time* by Statspack might
be different from the source of the *DB CPU* from v$sys_time_model that *I
think* is used by AWR to report the same. The lack of definitive information
about different DB usage patterns, doesn't allow clear demonstration of
their correlation.
Vlad Sadilovskiy
Oracle Database Tools
Web site:
http://www.fourthelephant.comBlog:
http://vsadilovskiy.wordpress.comOn 11/2/07, LS Cheng wrote:
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_at_mail.ee> 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_at_freelists.org
On Behalf Of Luis
Fernando Cerri
Sent: Thursday, November 01, 2007 23:20
To: oracle-l_at_freelists.org
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--
http://www.freelists.org/webpage/oracle-l