Sessions "CPU Usage"

59 views
Skip to first unread message

hell...@gmail.com

unread,
Mar 30, 2009, 2:57:40 AM3/30/09
to Lab128 - Tools for advanced Oracle tuning
I want to know meaning/unit of "CPU Usage" column in Sessions
monitor

ex) 0.33 ===> 33% ??

This value are extracted from what dictionary table?

sorry for poor english.

Sergei - Lab128

unread,
Mar 30, 2009, 10:54:50 AM3/30/09
to Lab128 - Tools for advanced Oracle tuning
Hi,

It happens to be in percent, .33 is .33%. Here is why:

What you see in this column is delta of v$sesstat (CPU used by this
session) divided by time between two snapshots. Let's assume that you
query v$sesstat for some session and see 700. Ten seconds later you
see 800. Therefore Lab128 will show (800-700) / 10 = 10. Because
Oracle reports this statistics in centiseconds (.01 sec), amount of
CPU time in this example was 1 second. So the session was on average
10% of time on CPU.

It was only by coincidence, because Oracle reports time in
centiseconds in this V4 view, the resulting value is in %. You can
change "CPU used by this session" statistics to any other from few
hundred of available in v$sesstat (see the Help - F1 - how to change),
Lab128 will apply same rule: (VAL2 - VAL1) / TIME. For example, if you
change to "consistent gets" statistic, the meaning of reported value
will be "gets/sec".

I should also warn that in older Oracle versions "CPU used by this
session" was updated only at the end of query execution, so if you run
long query, you will see 0% in several refreshes and a big spike at
the end. The recent versions of Oracle are updating this statistics in
the middle of execution but still they are not perfect. It works quite
well if the session is doing short queries - it does several
executions between the snapshots, and you see average of time spent on
CPU.

Regards,
Sergei

hell...@gmail.com

unread,
Mar 30, 2009, 12:34:52 PM3/30/09
to Lab128 - Tools for advanced Oracle tuning
thank you ^^
> > sorry for poor english.- Hide quoted text -
>
> - Show quoted text -
Reply all
Reply to author
Forward
0 new messages