<?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: Analysing Statspack(8)</title>
	<atom:link href="http://jonathanlewis.wordpress.com/2007/11/10/analysing-statspack8/feed/" rel="self" type="application/rss+xml" />
	<link>http://jonathanlewis.wordpress.com/2007/11/10/analysing-statspack8/</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: xpchild &#187; analysing statspack 8</title>
		<link>http://jonathanlewis.wordpress.com/2007/11/10/analysing-statspack8/#comment-43210</link>
		<dc:creator><![CDATA[xpchild &#187; analysing statspack 8]]></dc:creator>
		<pubDate>Fri, 16 Dec 2011 08:15:39 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/2007/11/10/analysing-statspack8/#comment-43210</guid>
		<description><![CDATA[[...] 原文：http://jonathanlewis.wordpress.com/2007/11/10/analysing-statspack8/ [...]]]></description>
		<content:encoded><![CDATA[<p>[...] 原文：http://jonathanlewis.wordpress.com/2007/11/10/analysing-statspack8/ [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jonathan Lewis</title>
		<link>http://jonathanlewis.wordpress.com/2007/11/10/analysing-statspack8/#comment-29319</link>
		<dc:creator><![CDATA[Jonathan Lewis]]></dc:creator>
		<pubDate>Tue, 22 Jan 2008 20:49:22 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/2007/11/10/analysing-statspack8/#comment-29319</guid>
		<description><![CDATA[Keyur, please note that I don&#039;t do requests - this isn&#039;t AskTom.

However - the UNION / DISTINCT: if you take out the DISTINCT and turn the UNION into a UNION ALL, you will have changed the logic of the query: so, unless the need for uniqueness was an error, you can&#039;t make those changes.

Note - you haven&#039;t mentioned the version of Oracle, but most versions will postpone the DISTINCT operator, by doing a UNION ALL  and then applying the SORT UNIQUE.

As far as setting session_cached_cursors is concerned, a simple guideline is to incrase it until the statistics about cached cursors suggest that you will get minimal extra benefit from incrasing the cache further. One way of viewing this is to see if the lots of sessions have reached the limit, and are still doing lots of parses which are not &quot;parse count (hard)&quot;.]]></description>
		<content:encoded><![CDATA[<p>Keyur, please note that I don&#8217;t do requests &#8211; this isn&#8217;t AskTom.</p>
<p>However &#8211; the UNION / DISTINCT: if you take out the DISTINCT and turn the UNION into a UNION ALL, you will have changed the logic of the query: so, unless the need for uniqueness was an error, you can&#8217;t make those changes.</p>
<p>Note &#8211; you haven&#8217;t mentioned the version of Oracle, but most versions will postpone the DISTINCT operator, by doing a UNION ALL  and then applying the SORT UNIQUE.</p>
<p>As far as setting session_cached_cursors is concerned, a simple guideline is to incrase it until the statistics about cached cursors suggest that you will get minimal extra benefit from incrasing the cache further. One way of viewing this is to see if the lots of sessions have reached the limit, and are still doing lots of parses which are not &#8220;parse count (hard)&#8221;.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Keyur</title>
		<link>http://jonathanlewis.wordpress.com/2007/11/10/analysing-statspack8/#comment-29316</link>
		<dc:creator><![CDATA[Keyur]]></dc:creator>
		<pubDate>Tue, 22 Jan 2008 19:34:04 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/2007/11/10/analysing-statspack8/#comment-29316</guid>
		<description><![CDATA[Hello Jonathan,

I have a database with following behaviour.

only one SELECT statement is using 60% CPU, all other looks normal using 3-4-5% I dig more in to that SELECT statement and found it has SELECT DISTINCT..... UNION SELECT DISTINCT... kind format. After looking at Execution plan, I see all steps are using CPU normally excepting last statement ( In order of execution) SORT UNIQUE is spending 85% CPU out of 100% CPU for that statement.

There is some suggestion like use UNION ALL instead of UNION, dont use DISTINCT. 

Second thing is, I thought to check how that statement is parse and executed. That statement was executed 4000 times, hardparse 1 time and soft parse 3999. It means it is doing soft parsing each time it execute it. SO question is how to resuce that part. I think that is causing some Library Cache, as I see that in AWR report as top 5 events.

ThenI thought to look at SESSION_CACHE_CURSORS, which is set to 150. In AWR, session cursor cache hits -67350 142.01 8.04 , this is based on 8 minute of AWR.

Now how to find out weather SESSION_CACHED_CURSORS is set to appropriate or needs to increase it. Please provide some direction about how to decide/tune SESSION_CACHE_CURSORS ?

We can not change application because it is third party application. how to tune this.

Please provide some lights on this topic.

Thanks]]></description>
		<content:encoded><![CDATA[<p>Hello Jonathan,</p>
<p>I have a database with following behaviour.</p>
<p>only one SELECT statement is using 60% CPU, all other looks normal using 3-4-5% I dig more in to that SELECT statement and found it has SELECT DISTINCT&#8230;.. UNION SELECT DISTINCT&#8230; kind format. After looking at Execution plan, I see all steps are using CPU normally excepting last statement ( In order of execution) SORT UNIQUE is spending 85% CPU out of 100% CPU for that statement.</p>
<p>There is some suggestion like use UNION ALL instead of UNION, dont use DISTINCT. </p>
<p>Second thing is, I thought to check how that statement is parse and executed. That statement was executed 4000 times, hardparse 1 time and soft parse 3999. It means it is doing soft parsing each time it execute it. SO question is how to resuce that part. I think that is causing some Library Cache, as I see that in AWR report as top 5 events.</p>
<p>ThenI thought to look at SESSION_CACHE_CURSORS, which is set to 150. In AWR, session cursor cache hits -67350 142.01 8.04 , this is based on 8 minute of AWR.</p>
<p>Now how to find out weather SESSION_CACHED_CURSORS is set to appropriate or needs to increase it. Please provide some direction about how to decide/tune SESSION_CACHE_CURSORS ?</p>
<p>We can not change application because it is third party application. how to tune this.</p>
<p>Please provide some lights on this topic.</p>
<p>Thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jonathan Lewis</title>
		<link>http://jonathanlewis.wordpress.com/2007/11/10/analysing-statspack8/#comment-28093</link>
		<dc:creator><![CDATA[Jonathan Lewis]]></dc:creator>
		<pubDate>Mon, 31 Dec 2007 23:42:55 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/2007/11/10/analysing-statspack8/#comment-28093</guid>
		<description><![CDATA[Gocats,

Looks like you still haven&#039;t read the blog. Here&#039;s a quote from Don Burleson&#039;s own entry on his own forum (from 15th June 2005 until at least 4th Nov 2007):

&lt;em&gt;&quot;Now I haven&#039;t had time to pour-over this AWR report in-detail, but I&#039;m inclinded to agree in this case, that manual assignment of db_cache_size is appropriate.

Here is the report:
&lt;a href=&quot;http://www.dbaoracle.com/reports/awr_report1.doc&quot; rel=&quot;nofollow&quot;&gt;http://www.dbaoracle.com/reports/awr_report1.doc&lt;/a&gt;&lt;/em&gt;

I don&#039;t think many people would read that and say that the intent was for the report to remain private. (The link no longer works - as I pointed out when I updated my blog entry)

By 11th Nov 2007 that comment had been edited out from Burleson&#039;s posting, and from a posting by another user who had quoted that part of Burleson&#039;s post.
]]></description>
		<content:encoded><![CDATA[<p>Gocats,</p>
<p>Looks like you still haven&#8217;t read the blog. Here&#8217;s a quote from Don Burleson&#8217;s own entry on his own forum (from 15th June 2005 until at least 4th Nov 2007):</p>
<p><em>&#8220;Now I haven&#8217;t had time to pour-over this AWR report in-detail, but I&#8217;m inclinded to agree in this case, that manual assignment of db_cache_size is appropriate.</p>
<p>Here is the report:<br />
<a href="http://www.dbaoracle.com/reports/awr_report1.doc" rel="nofollow">http://www.dbaoracle.com/reports/awr_report1.doc</a></em></p>
<p>I don&#8217;t think many people would read that and say that the intent was for the report to remain private. (The link no longer works &#8211; as I pointed out when I updated my blog entry)</p>
<p>By 11th Nov 2007 that comment had been edited out from Burleson&#8217;s posting, and from a posting by another user who had quoted that part of Burleson&#8217;s post.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: gocats</title>
		<link>http://jonathanlewis.wordpress.com/2007/11/10/analysing-statspack8/#comment-28092</link>
		<dc:creator><![CDATA[gocats]]></dc:creator>
		<pubDate>Mon, 31 Dec 2007 23:09:02 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/2007/11/10/analysing-statspack8/#comment-28092</guid>
		<description><![CDATA[I suggest you read up on the law.  The fact that the document was available does not make it fair game.  Thats the whole point of the anti-hacking laws.  Just because someone can access data does not mean it is legal for that person to access the data. The way the law has been interpreted, or at least the way I read the opinions is, if it was the clear intent of Burleson for it to remain private (and marking it confidential would make that intent clear), it is not legal for you to read and comment on the document.

Just because someone leaves the front door open doesn&#039;t mean its legal for you to go in and sleep on the couch.]]></description>
		<content:encoded><![CDATA[<p>I suggest you read up on the law.  The fact that the document was available does not make it fair game.  Thats the whole point of the anti-hacking laws.  Just because someone can access data does not mean it is legal for that person to access the data. The way the law has been interpreted, or at least the way I read the opinions is, if it was the clear intent of Burleson for it to remain private (and marking it confidential would make that intent clear), it is not legal for you to read and comment on the document.</p>
<p>Just because someone leaves the front door open doesn&#8217;t mean its legal for you to go in and sleep on the couch.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jonathan Lewis</title>
		<link>http://jonathanlewis.wordpress.com/2007/11/10/analysing-statspack8/#comment-28083</link>
		<dc:creator><![CDATA[Jonathan Lewis]]></dc:creator>
		<pubDate>Mon, 31 Dec 2007 19:04:09 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/2007/11/10/analysing-statspack8/#comment-28083</guid>
		<description><![CDATA[Gocats,

You only have to read this sentence from the blog to recognise the flaw in your argument:

&lt;i&gt;The report is a Word document (dated 2nd June 2005) at this URL, and it is referenced from this thread (dated 15th June 2005) on the Burlseon Consulting Oracle Forum;&lt;/i&gt;

]]></description>
		<content:encoded><![CDATA[<p>Gocats,</p>
<p>You only have to read this sentence from the blog to recognise the flaw in your argument:</p>
<p><i>The report is a Word document (dated 2nd June 2005) at this URL, and it is referenced from this thread (dated 15th June 2005) on the Burlseon Consulting Oracle Forum;</i></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: gocats</title>
		<link>http://jonathanlewis.wordpress.com/2007/11/10/analysing-statspack8/#comment-28016</link>
		<dc:creator><![CDATA[gocats]]></dc:creator>
		<pubDate>Sun, 30 Dec 2007 23:47:38 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/2007/11/10/analysing-statspack8/#comment-28016</guid>
		<description><![CDATA[I am curious if the report was clearly marked confidential when you started working on it?  If so, most interpretations of data privacy laws, including those the criminal courts have accepted, would say that you have broken the law by accessing it when you are not authorized to do.  I shudder to think what your civil liability would be for publishing the analysis.]]></description>
		<content:encoded><![CDATA[<p>I am curious if the report was clearly marked confidential when you started working on it?  If so, most interpretations of data privacy laws, including those the criminal courts have accepted, would say that you have broken the law by accessing it when you are not authorized to do.  I shudder to think what your civil liability would be for publishing the analysis.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jonathan Lewis</title>
		<link>http://jonathanlewis.wordpress.com/2007/11/10/analysing-statspack8/#comment-27705</link>
		<dc:creator><![CDATA[Jonathan Lewis]]></dc:creator>
		<pubDate>Wed, 26 Dec 2007 11:44:07 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/2007/11/10/analysing-statspack8/#comment-27705</guid>
		<description><![CDATA[Davide,

Unfortunately this is true; and the difference between the setting and the actual average read size has been a problem to the optimizer for many years.  (If you set a multiblock read size of 128, say, the optimizer would &quot;adjust&quot; this to a value around 40 for the purposes of doing the arithmetic - but who knows what might really happen at run-time ?).

The effect of the defaults for optimizer exec and optimizer read counts will cause the optimizer to increase the relative costs of tablescans.  If you view this as Oracle Corp&#039;s attempt to minimise the number of queries that do the wrong thing, it&#039;s probably a good strategy. Moreover, if a query uses an indexed access path when it should be doing a tablescan, putting in hints to do tablescans is probably going to be a less fragile fix than trying to hint a query that does tablescans when it should be using indexes.

So it&#039;s a compromise - but I think it&#039;s probably a statistically wise compromise.]]></description>
		<content:encoded><![CDATA[<p>Davide,</p>
<p>Unfortunately this is true; and the difference between the setting and the actual average read size has been a problem to the optimizer for many years.  (If you set a multiblock read size of 128, say, the optimizer would &#8220;adjust&#8221; this to a value around 40 for the purposes of doing the arithmetic &#8211; but who knows what might really happen at run-time ?).</p>
<p>The effect of the defaults for optimizer exec and optimizer read counts will cause the optimizer to increase the relative costs of tablescans.  If you view this as Oracle Corp&#8217;s attempt to minimise the number of queries that do the wrong thing, it&#8217;s probably a good strategy. Moreover, if a query uses an indexed access path when it should be doing a tablescan, putting in hints to do tablescans is probably going to be a less fragile fix than trying to hint a query that does tablescans when it should be using indexes.</p>
<p>So it&#8217;s a compromise &#8211; but I think it&#8217;s probably a statistically wise compromise.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Davide</title>
		<link>http://jonathanlewis.wordpress.com/2007/11/10/analysing-statspack8/#comment-27516</link>
		<dc:creator><![CDATA[Davide]]></dc:creator>
		<pubDate>Mon, 24 Dec 2007 14:11:03 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/2007/11/10/analysing-statspack8/#comment-27516</guid>
		<description><![CDATA[
if we eliminate the db_file_multiblock_read_count isn&#039;t there a discrepancy from the number of disk accesses the optimizer thinks to have to do (based on the default 8 blocks of _db_file_optimizer_read_count ) and the real number of accesses it will do executing the query?

Best Regards,
Davide]]></description>
		<content:encoded><![CDATA[<p>if we eliminate the db_file_multiblock_read_count isn&#8217;t there a discrepancy from the number of disk accesses the optimizer thinks to have to do (based on the default 8 blocks of _db_file_optimizer_read_count ) and the real number of accesses it will do executing the query?</p>
<p>Best Regards,<br />
Davide</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Niall Litchfield</title>
		<link>http://jonathanlewis.wordpress.com/2007/11/10/analysing-statspack8/#comment-25014</link>
		<dc:creator><![CDATA[Niall Litchfield]]></dc:creator>
		<pubDate>Tue, 20 Nov 2007 16:02:38 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/2007/11/10/analysing-statspack8/#comment-25014</guid>
		<description><![CDATA[Just a brief update to say that the original word report has been removed from Don&#039;s site (though not yet the links to it from various of his own web sites) meaning that your excellent advice at the start of the article is now not possible to follow.]]></description>
		<content:encoded><![CDATA[<p>Just a brief update to say that the original word report has been removed from Don&#8217;s site (though not yet the links to it from various of his own web sites) meaning that your excellent advice at the start of the article is now not possible to follow.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
