<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments on: CPU used</title>
	<atom:link href="http://jonathanlewis.wordpress.com/2009/05/26/cpu-used/feed/" rel="self" type="application/rss+xml" />
	<link>http://jonathanlewis.wordpress.com/2009/05/26/cpu-used/</link>
	<description>Just another Oracle weblog</description>
	<lastBuildDate>Mon, 20 May 2013 17:10:14 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
	<item>
		<title>By: Jonathan Lewis</title>
		<link>http://jonathanlewis.wordpress.com/2009/05/26/cpu-used/#comment-52764</link>
		<dc:creator><![CDATA[Jonathan Lewis]]></dc:creator>
		<pubDate>Sat, 12 Jan 2013 11:19:31 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=1300#comment-52764</guid>
		<description><![CDATA[Vincent,

I think it&#039;s impossible to say - and detailed interpretation may depend on Version and Platform.

I would assume that Oracle used a rounding mechanism to convert whatever time it acuired for CPU, so that the boundary case would be 5,000 ms rather than 10,000, and we might hope that on average the errors summed to zero across all sessions. We might also question whether Oracle populated the session value for &quot;CPU Used by this session&quot; by accumulating figures like &quot;how many hundredths of CPU seconds have I used since last time&quot; or whether it echoed the o/s result for &quot;CPU time current recorded against this process&quot;. The former would tend to introduce a cumulative error that might explain your results.

A couple of reference points: 

a) you could query v$sess_time_model and compare it with v$sesstat to see if there were particular sessions that showed the largest discrepancy. This might give you some further ideas on the cause.

b) when I ran your query on the next 11.2.0.3 I used, the error was the other way - i.e. DB CPU was smaller (by about 5%) than CPU used. (I also had a few sessions which recorded CPU used, but showed zero DB CPU.]]></description>
		<content:encoded><![CDATA[<p>Vincent,</p>
<p>I think it&#8217;s impossible to say &#8211; and detailed interpretation may depend on Version and Platform.</p>
<p>I would assume that Oracle used a rounding mechanism to convert whatever time it acuired for CPU, so that the boundary case would be 5,000 ms rather than 10,000, and we might hope that on average the errors summed to zero across all sessions. We might also question whether Oracle populated the session value for &#8220;CPU Used by this session&#8221; by accumulating figures like &#8220;how many hundredths of CPU seconds have I used since last time&#8221; or whether it echoed the o/s result for &#8220;CPU time current recorded against this process&#8221;. The former would tend to introduce a cumulative error that might explain your results.</p>
<p>A couple of reference points: </p>
<p>a) you could query v$sess_time_model and compare it with v$sesstat to see if there were particular sessions that showed the largest discrepancy. This might give you some further ideas on the cause.</p>
<p>b) when I ran your query on the next 11.2.0.3 I used, the error was the other way &#8211; i.e. DB CPU was smaller (by about 5%) than CPU used. (I also had a few sessions which recorded CPU used, but showed zero DB CPU.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Vincent</title>
		<link>http://jonathanlewis.wordpress.com/2009/05/26/cpu-used/#comment-52590</link>
		<dc:creator><![CDATA[Vincent]]></dc:creator>
		<pubDate>Mon, 07 Jan 2013 13:47:59 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=1300#comment-52590</guid>
		<description><![CDATA[Hi Jonathan,

If I&#039;m right, &quot;CPU used by this session&quot; is measured in tens of milliseconds and user calls under ten milliseconds are not added to this metric whereas &quot;DB CPU&quot; is measured in microseconds.

Could that difference in accuracy explain why &quot;DB CPU&quot; could be significantly higher than &quot;CPU used by this session&quot; ?
Would that mean that a lot of user calls complete in less than 10 millisecond in the following example ?
[sourcecode]
SQL&gt; select cpu1, cpu2, cpu2 - cpu1
  2  from (
  3    select round(value / 10000) cpu2
  4    from   v$sys_time_model
  5    where  stat_name = &#039;DB CPU&#039;),
  6       (
  7    select value cpu1
  8    from   v$sysstat
  9    where name = &#039;CPU used by this session&#039;);

      CPU1       CPU2  CPU2-CPU1
---------- ---------- ----------
   4591465    5878762    1287297
[/sourcecode]
Thank you for your help
]]></description>
		<content:encoded><![CDATA[<p>Hi Jonathan,</p>
<p>If I&#8217;m right, &#8220;CPU used by this session&#8221; is measured in tens of milliseconds and user calls under ten milliseconds are not added to this metric whereas &#8220;DB CPU&#8221; is measured in microseconds.</p>
<p>Could that difference in accuracy explain why &#8220;DB CPU&#8221; could be significantly higher than &#8220;CPU used by this session&#8221; ?<br />
Would that mean that a lot of user calls complete in less than 10 millisecond in the following example ?</p>
<pre class="brush: plain; title: ; notranslate">
SQL&amp;gt; select cpu1, cpu2, cpu2 - cpu1
  2  from (
  3    select round(value / 10000) cpu2
  4    from   v$sys_time_model
  5    where  stat_name = 'DB CPU'),
  6       (
  7    select value cpu1
  8    from   v$sysstat
  9    where name = 'CPU used by this session');

      CPU1       CPU2  CPU2-CPU1
---------- ---------- ----------
   4591465    5878762    1287297
</pre>
<p>Thank you for your help</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jonathan Lewis</title>
		<link>http://jonathanlewis.wordpress.com/2009/05/26/cpu-used/#comment-46595</link>
		<dc:creator><![CDATA[Jonathan Lewis]]></dc:creator>
		<pubDate>Thu, 24 May 2012 10:07:00 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=1300#comment-46595</guid>
		<description><![CDATA[Yasir,

Sorry about the long delay in replying.

Your calculations look correct. However, to follow up the 70% question, I would also at the section on OS Statistics to cross-check the BUSY_TIME, and the split between SYS_TIME and USER_TIME - I like to ensure that different sources of information give consistent values before I jump to any conclusions.]]></description>
		<content:encoded><![CDATA[<p>Yasir,</p>
<p>Sorry about the long delay in replying.</p>
<p>Your calculations look correct. However, to follow up the 70% question, I would also at the section on OS Statistics to cross-check the BUSY_TIME, and the split between SYS_TIME and USER_TIME &#8211; I like to ensure that different sources of information give consistent values before I jump to any conclusions.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Yasir</title>
		<link>http://jonathanlewis.wordpress.com/2009/05/26/cpu-used/#comment-46359</link>
		<dc:creator><![CDATA[Yasir]]></dc:creator>
		<pubDate>Wed, 09 May 2012 08:32:16 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=1300#comment-46359</guid>
		<description><![CDATA[Hi,
If , in AWR,  we have CPU TIME =36000s and  total CPU capacity is 46. so Total CPU for 30 minutes elapsed time is 46*30*60=82800s.
So % of CPU TIME taken by oracle in 30 minutes is 36000/82800*100=43.47%. 
Is this calculation right?
also if % of busy time is 70% then is it right to say that 70-43.47=26.53% of CPU was taken by non oracle processes?]]></description>
		<content:encoded><![CDATA[<p>Hi,<br />
If , in AWR,  we have CPU TIME =36000s and  total CPU capacity is 46. so Total CPU for 30 minutes elapsed time is 46*30*60=82800s.<br />
So % of CPU TIME taken by oracle in 30 minutes is 36000/82800*100=43.47%.<br />
Is this calculation right?<br />
also if % of busy time is 70% then is it right to say that 70-43.47=26.53% of CPU was taken by non oracle processes?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Roberto</title>
		<link>http://jonathanlewis.wordpress.com/2009/05/26/cpu-used/#comment-34554</link>
		<dc:creator><![CDATA[Roberto]]></dc:creator>
		<pubDate>Fri, 02 Oct 2009 14:07:36 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=1300#comment-34554</guid>
		<description><![CDATA[Can I derive &quot;DB time&quot; (available from 10g) by Oracle9i statistics?&quot;]]></description>
		<content:encoded><![CDATA[<p>Can I derive &#8220;DB time&#8221; (available from 10g) by Oracle9i statistics?&#8221;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: German Minicucci</title>
		<link>http://jonathanlewis.wordpress.com/2009/05/26/cpu-used/#comment-33713</link>
		<dc:creator><![CDATA[German Minicucci]]></dc:creator>
		<pubDate>Mon, 29 Jun 2009 20:19:10 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=1300#comment-33713</guid>
		<description><![CDATA[Jonathan,

I think you&#039;re right! I&#039;m going to investigate further on that!
The explanation was simple then... A monitoring script was disabled and a lot of the CPU it was using got free, so now the instance is more idle than before.

Thanks so much for your help!]]></description>
		<content:encoded><![CDATA[<p>Jonathan,</p>
<p>I think you&#8217;re right! I&#8217;m going to investigate further on that!<br />
The explanation was simple then&#8230; A monitoring script was disabled and a lot of the CPU it was using got free, so now the instance is more idle than before.</p>
<p>Thanks so much for your help!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jonathan Lewis</title>
		<link>http://jonathanlewis.wordpress.com/2009/05/26/cpu-used/#comment-33711</link>
		<dc:creator><![CDATA[Jonathan Lewis]]></dc:creator>
		<pubDate>Mon, 29 Jun 2009 19:34:23 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=1300#comment-33711</guid>
		<description><![CDATA[German,

I&#039;ve had a quick look at an early and a late report. First thought 100 CPU seconds in one hour is virtually idle anyway.

But looking at where that CPU time came from (I checked SQL ordered by buffer gets as a first cross-check) most of it is coming from a couple of queries that look like monitoring queries (queries against v$lock and v$session, v$sql) and don&#039;t look like application code.

These disappear from the later statspack. So maybe the person who was checking on the database decided it wasn&#039;t worth the effort.

If you check the times you mention, the average wait time for each of those events hasn&#039;t changed - it&#039;s just that the reduction in CPU usage pushes their total time higher up the list and makes their percentage contribution higher.]]></description>
		<content:encoded><![CDATA[<p>German,</p>
<p>I&#8217;ve had a quick look at an early and a late report. First thought 100 CPU seconds in one hour is virtually idle anyway.</p>
<p>But looking at where that CPU time came from (I checked SQL ordered by buffer gets as a first cross-check) most of it is coming from a couple of queries that look like monitoring queries (queries against v$lock and v$session, v$sql) and don&#8217;t look like application code.</p>
<p>These disappear from the later statspack. So maybe the person who was checking on the database decided it wasn&#8217;t worth the effort.</p>
<p>If you check the times you mention, the average wait time for each of those events hasn&#8217;t changed &#8211; it&#8217;s just that the reduction in CPU usage pushes their total time higher up the list and makes their percentage contribution higher.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: German Minicucci</title>
		<link>http://jonathanlewis.wordpress.com/2009/05/26/cpu-used/#comment-33709</link>
		<dc:creator><![CDATA[German Minicucci]]></dc:creator>
		<pubDate>Mon, 29 Jun 2009 16:39:11 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=1300#comment-33709</guid>
		<description><![CDATA[Just to clarify, the CPU Time in seconds dropped to a 10% (from 100 seconds an hour to 10 seconds an hour).
That impacted the Top 5 Wait Events causing the controlfile and log file wait events to increase in % but not in amount of waits, so, the CPU Time % of Total Elapsed Time dropped to 60%.

Jonathan, I&#039;ve just sent you an e-mail with Statspack reports so you can check them out.

Could a decrease like that in the &quot;CPU used by this session&quot; statistic mean that the database is not being used?]]></description>
		<content:encoded><![CDATA[<p>Just to clarify, the CPU Time in seconds dropped to a 10% (from 100 seconds an hour to 10 seconds an hour).<br />
That impacted the Top 5 Wait Events causing the controlfile and log file wait events to increase in % but not in amount of waits, so, the CPU Time % of Total Elapsed Time dropped to 60%.</p>
<p>Jonathan, I&#8217;ve just sent you an e-mail with Statspack reports so you can check them out.</p>
<p>Could a decrease like that in the &#8220;CPU used by this session&#8221; statistic mean that the database is not being used?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jonathan Lewis</title>
		<link>http://jonathanlewis.wordpress.com/2009/05/26/cpu-used/#comment-33663</link>
		<dc:creator><![CDATA[Jonathan Lewis]]></dc:creator>
		<pubDate>Fri, 26 Jun 2009 07:41:10 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=1300#comment-33663</guid>
		<description><![CDATA[German,

I can imagine a lot of people reading your note and thinking: &quot;How can a drop from 90% to 60% be the same as dropping to one tenth of what it used to be&quot;.  I think I can guess what you&#039;re looking at when you say this - but it&#039;s not obvious. I can also guess why this might happen - but it&#039;s not compatible with no change in the workload, application, or statspack output.

If you want to email me a pair of one-hour reports from before and after the change that you think are good examples of the difference, I&#039;ll take a quick look at them - and write a note about them if they demonstrate a useful principle.]]></description>
		<content:encoded><![CDATA[<p>German,</p>
<p>I can imagine a lot of people reading your note and thinking: &#8220;How can a drop from 90% to 60% be the same as dropping to one tenth of what it used to be&#8221;.  I think I can guess what you&#8217;re looking at when you say this &#8211; but it&#8217;s not obvious. I can also guess why this might happen &#8211; but it&#8217;s not compatible with no change in the workload, application, or statspack output.</p>
<p>If you want to email me a pair of one-hour reports from before and after the change that you think are good examples of the difference, I&#8217;ll take a quick look at them &#8211; and write a note about them if they demonstrate a useful principle.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nigel</title>
		<link>http://jonathanlewis.wordpress.com/2009/05/26/cpu-used/#comment-33650</link>
		<dc:creator><![CDATA[Nigel]]></dc:creator>
		<pubDate>Thu, 25 Jun 2009 16:17:57 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=1300#comment-33650</guid>
		<description><![CDATA[Could an increase in the Controlfile and Logfile waits (IO?) be preventing the applications (whatever they are) from making as much use of CPU - i.e. acting as a botlteneck to processing?]]></description>
		<content:encoded><![CDATA[<p>Could an increase in the Controlfile and Logfile waits (IO?) be preventing the applications (whatever they are) from making as much use of CPU &#8211; i.e. acting as a botlteneck to processing?</p>
]]></content:encoded>
	</item>
</channel>
</rss>
