<?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"
	>
<channel>
	<title>Comments on: Unstable Plans (Oracle Plan Stability/Instability)</title>
	<atom:link href="http://kerryosborne.oracle-guy.com/2008/10/unstable-plans/feed/" rel="self" type="application/rss+xml" />
	<link>http://kerryosborne.oracle-guy.com/2008/10/unstable-plans/</link>
	<description>Just another Oracle blog</description>
	<pubDate>Thu, 29 Jul 2010 12:11:08 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.3</generator>
		<item>
		<title>By: osborne</title>
		<link>http://kerryosborne.oracle-guy.com/2008/10/unstable-plans/#comment-15485</link>
		<dc:creator>osborne</dc:creator>
		<pubDate>Mon, 19 Jul 2010 00:17:06 +0000</pubDate>
		<guid isPermaLink="false">http://kerryosborne.oracle-guy.com/?p=155#comment-15485</guid>
		<description>I think you are confusing plan_hash_value with hash_value (and old_hash_value). A statement can have only one sql_id and only one hash_value (its based on the text of the statement). A statement can have many plan_hash_values. And yes you can influence a statement to use a particular plan. I've done a number of posts on using SQL Profiles to do just that. See &lt;a href="http://kerryosborne.oracle-guy.com/2009/04/oracle-sql-profiles/" rel="nofollow"&gt;SQL Profiles&lt;/a&gt; for example.

Kerry</description>
		<content:encoded><![CDATA[<p>I think you are confusing plan_hash_value with hash_value (and old_hash_value). A statement can have only one sql_id and only one hash_value (its based on the text of the statement). A statement can have many plan_hash_values. And yes you can influence a statement to use a particular plan. I&#8217;ve done a number of posts on using SQL Profiles to do just that. See <a href="http://kerryosborne.oracle-guy.com/2009/04/oracle-sql-profiles/"  rel="nofollow">SQL Profiles</a> for example.</p>
<p>Kerry</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Yuvaraj</title>
		<link>http://kerryosborne.oracle-guy.com/2008/10/unstable-plans/#comment-14138</link>
		<dc:creator>Yuvaraj</dc:creator>
		<pubDate>Mon, 05 Jul 2010 00:27:25 +0000</pubDate>
		<guid isPermaLink="false">http://kerryosborne.oracle-guy.com/?p=155#comment-14138</guid>
		<description>I thought of checking with you whether if it is possible to force oracle to use the plan from old hash value then the newer one. There are two hash values for a same SQL_ID. I would like to force the old hash value.</description>
		<content:encoded><![CDATA[<p>I thought of checking with you whether if it is possible to force oracle to use the plan from old hash value then the newer one. There are two hash values for a same SQL_ID. I would like to force the old hash value.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: osborne</title>
		<link>http://kerryosborne.oracle-guy.com/2008/10/unstable-plans/#comment-14135</link>
		<dc:creator>osborne</dc:creator>
		<pubDate>Mon, 05 Jul 2010 00:22:15 +0000</pubDate>
		<guid isPermaLink="false">http://kerryosborne.oracle-guy.com/?p=155#comment-14135</guid>
		<description>I'm sorry Yuvaraj, but I have not done anything with old_hash_value. Nor do I know of anyone who has written about it. Tanel Poder has written about calculating SQL_ID from hash_value though. 

Kerry</description>
		<content:encoded><![CDATA[<p>I&#8217;m sorry Yuvaraj, but I have not done anything with old_hash_value. Nor do I know of anyone who has written about it. Tanel Poder has written about calculating SQL_ID from hash_value though. </p>
<p>Kerry</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Yuvaraj</title>
		<link>http://kerryosborne.oracle-guy.com/2008/10/unstable-plans/#comment-14134</link>
		<dc:creator>Yuvaraj</dc:creator>
		<pubDate>Mon, 05 Jul 2010 00:13:56 +0000</pubDate>
		<guid isPermaLink="false">http://kerryosborne.oracle-guy.com/?p=155#comment-14134</guid>
		<description>Thanks. I am trying to find a procedure to use old hash value instead of a new hash value. There are two hash values for a same SQL_ID. Could you pls provide a link if you have written a doc on this?</description>
		<content:encoded><![CDATA[<p>Thanks. I am trying to find a procedure to use old hash value instead of a new hash value. There are two hash values for a same SQL_ID. Could you pls provide a link if you have written a doc on this?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: osborne</title>
		<link>http://kerryosborne.oracle-guy.com/2008/10/unstable-plans/#comment-14112</link>
		<dc:creator>osborne</dc:creator>
		<pubDate>Sun, 04 Jul 2010 19:47:36 +0000</pubDate>
		<guid isPermaLink="false">http://kerryosborne.oracle-guy.com/?p=155#comment-14112</guid>
		<description>SELECT * FROM table(dbms_xplan.display_awr(nvl('&#038;sql_id','a96b61z6vp3un'),nvl('&#038;plan_hash_value',null),null,'typical +peeked_binds'));</description>
		<content:encoded><![CDATA[<p>SELECT * FROM table(dbms_xplan.display_awr(nvl(&#8217;&#038;sql_id&#8217;,'a96b61z6vp3un&#8217;),nvl(&#8217;&#038;plan_hash_value&#8217;,null),null,&#8217;typical +peeked_binds&#8217;));</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Yuvaraj</title>
		<link>http://kerryosborne.oracle-guy.com/2008/10/unstable-plans/#comment-14111</link>
		<dc:creator>Yuvaraj</dc:creator>
		<pubDate>Sun, 04 Jul 2010 19:41:13 +0000</pubDate>
		<guid isPermaLink="false">http://kerryosborne.oracle-guy.com/?p=155#comment-14111</guid>
		<description>Could you paste the "@dplan_awr" script?</description>
		<content:encoded><![CDATA[<p>Could you paste the &#8220;@dplan_awr&#8221; script?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: osborne</title>
		<link>http://kerryosborne.oracle-guy.com/2008/10/unstable-plans/#comment-3229</link>
		<dc:creator>osborne</dc:creator>
		<pubDate>Thu, 09 Jul 2009 13:05:55 +0000</pubDate>
		<guid isPermaLink="false">http://kerryosborne.oracle-guy.com/?p=155#comment-3229</guid>
		<description>Hi Paul,

The find_sql.sql script is here:

http://www.oracle-guy.com/scripts/find_sql.sql

Sometimes I don't post the text for scripts I use regularly (if I've already posted them). A quick search for the script name in the blog search box will usually turn them up. I probably should do a post that lists my most used scripts with links to them. I'll see if I can get that done soon.

Kerry</description>
		<content:encoded><![CDATA[<p>Hi Paul,</p>
<p>The find_sql.sql script is here:</p>
<p><a href="http://www.oracle-guy.com/scripts/find_sql.sql"  rel="nofollow">http://www.oracle-guy.com/scripts/find_sql.sql</a></p>
<p>Sometimes I don&#8217;t post the text for scripts I use regularly (if I&#8217;ve already posted them). A quick search for the script name in the blog search box will usually turn them up. I probably should do a post that lists my most used scripts with links to them. I&#8217;ll see if I can get that done soon.</p>
<p>Kerry</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Paul</title>
		<link>http://kerryosborne.oracle-guy.com/2008/10/unstable-plans/#comment-3224</link>
		<dc:creator>Paul</dc:creator>
		<pubDate>Thu, 09 Jul 2009 09:20:52 +0000</pubDate>
		<guid isPermaLink="false">http://kerryosborne.oracle-guy.com/?p=155#comment-3224</guid>
		<description>Hi Kerry,
Nice piece of work. Could you please post the 'find_sql.sql' script??
thx
Paul</description>
		<content:encoded><![CDATA[<p>Hi Kerry,<br />
Nice piece of work. Could you please post the &#8216;find_sql.sql&#8217; script??<br />
thx<br />
Paul</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: osborne</title>
		<link>http://kerryosborne.oracle-guy.com/2008/10/unstable-plans/#comment-2401</link>
		<dc:creator>osborne</dc:creator>
		<pubDate>Fri, 12 Jun 2009 13:27:05 +0000</pubDate>
		<guid isPermaLink="false">http://kerryosborne.oracle-guy.com/?p=155#comment-2401</guid>
		<description>Julio,

  Not much to go on in you're question, but I'll hazard a couple of suggestions any way. Plan instability is often the result of bind variable peeking. The worst cases often happen when you have a histogram on a skewed column in combination with a bind variable in a where clause that references the column. The best way to fix this issue is to use literals instead of bind variables for such columns. Creating a SQL Profile or Outline to lock in one of the plans can often be a pretty quick short term fix as well. Also, you should be aware that 10g's standard method of gathering stats does not do a very good job (in my opinion) of picking which columns to gather histograms on (it usually creates too many). The auto sample size is often too small to create an accurate histogram as well. So you may want to re-evaluate the stats gathering. I've written several posts about bind variable peeking and methods for dealing with the issue. Here are a couple you might want to look at:

&lt;a href="http://kerryosborne.oracle-guy.com/2009/04/oracle-11g-sql-plan-management-sql-plan-baselines/" rel="nofollow"&gt;Bind Variable Peeking Drives Me Nuts!&lt;/a&gt;
&lt;a href="http://kerryosborne.oracle-guy.com/2008/12/oracle-outlines-aka-plan-stability/" rel="nofollow"&gt;Outlines - aka Plan Stability&lt;/a&gt;
&lt;a href="http://kerryosborne.oracle-guy.com/2009/04/oracle-sql-profiles/" rel="nofollow"&gt;SQl Profiles&lt;/a&gt;

Or just search the blog for "Plan Instability" or "Bind Variable Peeking".

Hope that helps.

Kerry</description>
		<content:encoded><![CDATA[<p>Julio,</p>
<p>  Not much to go on in you&#8217;re question, but I&#8217;ll hazard a couple of suggestions any way. Plan instability is often the result of bind variable peeking. The worst cases often happen when you have a histogram on a skewed column in combination with a bind variable in a where clause that references the column. The best way to fix this issue is to use literals instead of bind variables for such columns. Creating a SQL Profile or Outline to lock in one of the plans can often be a pretty quick short term fix as well. Also, you should be aware that 10g&#8217;s standard method of gathering stats does not do a very good job (in my opinion) of picking which columns to gather histograms on (it usually creates too many). The auto sample size is often too small to create an accurate histogram as well. So you may want to re-evaluate the stats gathering. I&#8217;ve written several posts about bind variable peeking and methods for dealing with the issue. Here are a couple you might want to look at:</p>
<p><a href="http://kerryosborne.oracle-guy.com/2009/04/oracle-11g-sql-plan-management-sql-plan-baselines/"  rel="nofollow">Bind Variable Peeking Drives Me Nuts!</a><br />
<a href="http://kerryosborne.oracle-guy.com/2008/12/oracle-outlines-aka-plan-stability/"  rel="nofollow">Outlines - aka Plan Stability</a><br />
<a href="http://kerryosborne.oracle-guy.com/2009/04/oracle-sql-profiles/"  rel="nofollow">SQl Profiles</a></p>
<p>Or just search the blog for &#8220;Plan Instability&#8221; or &#8220;Bind Variable Peeking&#8221;.</p>
<p>Hope that helps.</p>
<p>Kerry</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Julio Cesar</title>
		<link>http://kerryosborne.oracle-guy.com/2008/10/unstable-plans/#comment-2380</link>
		<dc:creator>Julio Cesar</dc:creator>
		<pubDate>Wed, 10 Jun 2009 20:36:37 +0000</pubDate>
		<guid isPermaLink="false">http://kerryosborne.oracle-guy.com/?p=155#comment-2380</guid>
		<description>Hi Kerry, we are facing this trouble now, the same query can run in 1 minute or in a hour, we disabled the AMM and set all the memory parameters manually, but the problem persists in a dangerous way, do you have some idea in solving it?

Best regards and I wish you luck if you're still with this trouble.

Júlio César</description>
		<content:encoded><![CDATA[<p>Hi Kerry, we are facing this trouble now, the same query can run in 1 minute or in a hour, we disabled the AMM and set all the memory parameters manually, but the problem persists in a dangerous way, do you have some idea in solving it?</p>
<p>Best regards and I wish you luck if you&#8217;re still with this trouble.</p>
<p>Júlio César</p>
]]></content:encoded>
	</item>
</channel>
</rss>
