<?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/"
		>
<channel>
	<title>Comments on: ORACLE 11g SQL Plan Management: The Dark Side of SPM. Part 4</title>
	<atom:link href="http://intermediatesql.com/oracle/oracle-11g-sql-plan-management-the-dark-side-of-spm-part-4/feed/" rel="self" type="application/rss+xml" />
	<link>http://intermediatesql.com/oracle/oracle-11g-sql-plan-management-the-dark-side-of-spm-part-4/</link>
	<description>Color Coded SQL, UNIX and Database Essays</description>
	<lastBuildDate>Mon, 27 May 2013 11:46:37 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
	<item>
		<title>By: Dara</title>
		<link>http://intermediatesql.com/oracle/oracle-11g-sql-plan-management-the-dark-side-of-spm-part-4/comment-page-1/#comment-1105</link>
		<dc:creator>Dara</dc:creator>
		<pubDate>Wed, 13 Mar 2013 19:40:34 +0000</pubDate>
		<guid isPermaLink="false">http://intermediatesql.com/?p=323#comment-1105</guid>
		<description><![CDATA[Thank you for your POV.  It was informative about what to consider.
Regarding Scenerio 2, MOS note SQL Plan Baselines Clarified from a Security Perspective. [ID 1469099.1] discusses that &quot;SQL plan baselines are user-agnostic by design&quot;.  It explains the details.  But our point is valid - something to be aware of!  (Oracle just doesn&#039;t see it as a bug.)]]></description>
		<content:encoded><![CDATA[<p>Thank you for your <span class="caps">POV. </span> It was informative about what to consider.<br />
Regarding Scenerio 2, <span class="caps">MOS </span>note <span class="caps">SQL</span> Plan Baselines Clarified from a Security Perspective. [ID 1469099.1] discusses that &#8220;SQL plan baselines are user-agnostic by design&#8221;.  It explains the details.  But our point is valid &#8211; something to be aware of!  (Oracle just doesn&#8217;t see it as a bug.)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alireza</title>
		<link>http://intermediatesql.com/oracle/oracle-11g-sql-plan-management-the-dark-side-of-spm-part-4/comment-page-1/#comment-1029</link>
		<dc:creator>Alireza</dc:creator>
		<pubDate>Tue, 15 Jan 2013 08:27:16 +0000</pubDate>
		<guid isPermaLink="false">http://intermediatesql.com/?p=323#comment-1029</guid>
		<description><![CDATA[Hi Maxym,
sorry! the last memo was not completed - so here we go with the completed one:

I got it! YES what i exactly meant is &quot;Automatic Plan Evolution of SQL Plan Management&quot; which is abviously an interaction between the SQL Tune Advisor&#039;s nightly tuning task and SPM!! which would be proceeded through DBMS_SQLTUNE sub routines and requires tuning pack lisence (what we own!).
My questions are:
1)would you mean it is preferable to use DBMS_SQLTUNE once we got the Tunung Pack lisence for an autom. evolve process?
2)obviously SPM requires much more DBA manually works rather than DBMS_SQLTUNE, true?
3)can you recommand any oracle docu which describes more about the interactive engine of both features?

Many Thanks!
Alireza]]></description>
		<content:encoded><![CDATA[<p>Hi Maxym,<br />
sorry! the last memo was not completed &#8211; so here we go with the completed one:</p>
<p>I got it! <span class="caps">YES </span>what i exactly meant is &#8220;Automatic Plan Evolution of <span class="caps">SQL</span> Plan Management&#8221; which is abviously an interaction between the <span class="caps">SQL</span> Tune Advisor&#8217;s nightly tuning task and <span class="caps">SPM</span>!! which would be proceeded through <span class="caps">DBMS</span>_SQLTUNE sub routines and requires tuning pack lisence (what we own!).<br />
My questions are:<br />
1)would you mean it is preferable to use <span class="caps">DBMS</span>_SQLTUNE once we got the Tunung Pack lisence for an autom. evolve process?<br />
2)obviously <span class="caps">SPM </span>requires much more <span class="caps">DBA </span>manually works rather than <span class="caps">DBMS</span>_SQLTUNE, true?<br />
3)can you recommand any oracle docu which describes more about the interactive engine of both features?</p>
<p>Many Thanks!<br />
Alireza</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alireza</title>
		<link>http://intermediatesql.com/oracle/oracle-11g-sql-plan-management-the-dark-side-of-spm-part-4/comment-page-1/#comment-1028</link>
		<dc:creator>Alireza</dc:creator>
		<pubDate>Mon, 14 Jan 2013 21:31:00 +0000</pubDate>
		<guid isPermaLink="false">http://intermediatesql.com/?p=323#comment-1028</guid>
		<description><![CDATA[Hi Maxym,
I got it !
Yes I meant actually The automatic SQL Tuning Advisor, which is related to the dbms_sqltune sub programs.
So I understand that by having the tuning pack lisence (which we own) it is preferable to use dbms_sqltune rather than SPM!?
 As I assume that :
a) one feature has mostly nothing to do with another
b) SPM requires much more manually DBA tasks, whereas dbms_sqltune mostly doesn&#039;t!

Thanks!
Alireza]]></description>
		<content:encoded><![CDATA[<p>Hi Maxym,<br />
I got it <img src="Yes" alt="which we own" />?<br />
 As I assume that :<br />
a) one feature has mostly nothing to do with another<br />
b) <span class="caps">SPM </span>requires much more manually <span class="caps">DBA </span>tasks, whereas dbms_sqltune mostly doesn&#8217;t!</p>
<p>Thanks!<br />
Alireza</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Maxym Kharchenko</title>
		<link>http://intermediatesql.com/oracle/oracle-11g-sql-plan-management-the-dark-side-of-spm-part-4/comment-page-1/#comment-1026</link>
		<dc:creator>Maxym Kharchenko</dc:creator>
		<pubDate>Sat, 12 Jan 2013 18:33:22 +0000</pubDate>
		<guid isPermaLink="false">http://intermediatesql.com/?p=323#comment-1026</guid>
		<description><![CDATA[Hi Alireza,

1. I&#039;m assuming you are asking: &quot;what if ACCEPTED SPM baseline is using an index and you remove the index&quot; ?
The way SPM works is: it tries to reproduce the plan from baseline during parse. If it cannot (i.e. if the index is not there), it cannot use this plan, even if it is ACCEPTED and needs to either try other ACCEPTED plans from baseline or parse a new one.
The plan with the index remain ACCEPTED, I believe (did not check on that) but will not be used.
Keep in mind that you can have several ACCEPTED plans for the same statement and ORACLE can choose between them during parse. ACCEPTED does not mean BEST, nor does it mean THE ONLY ONE that can be used. Rather it means: it was approved at some point (which you can do manually, btw) 

2. SPM is not a part of diagnostic license - it is available as a part of enterprise edition. What you are probably thinking about is DBMS_SQLTUNE package, which deals with profiles (close cousins to baselines), and does require tuning pack. It has a job that looks through sqls and finds profile recommendations as well as evolve baselines. But it is not necessary if you only want to evolve baselines - you can create your own &quot;evolve&quot; script quite easily.

Speaking of upgrades. You want to be real careful here. I think the main benefit of SPM during upgrades is the fact that you can &quot;freeze&quot; plans, not so much that you can make them better. While it is nice to improve the plans after upgrade, to me it is much more important not to make them worse ... Unfortunately SPM evolution can do both. 
What is, arguably, even worse, it can also populate baselines with several ACCEPTED plans for the same sql, meaning that your sql will execute sometimes with plan A and sometimes with plan B. These plan flips can be disastrous if your users are relying on stable execution of that sql (there are ways to fix it by i.e. working with ENABLED attribute, but it&#039;s better not to have this problem in the first place).

So, be extra careful with auto evolutions - they can do both good and bad.

Regards,
Maxym Kharchenko]]></description>
		<content:encoded><![CDATA[<p>Hi Alireza,</p>
<p>1. I&#8217;m assuming you are asking: &#8220;what if <span class="caps">ACCEPTED SPM </span>baseline is using an index and you remove the index&#8221; ?<br />
The way <span class="caps">SPM </span>works is: it tries to reproduce the plan from baseline during parse. If it cannot (i.e. if the index is not there), it cannot use this plan, even if it is <span class="caps">ACCEPTED </span>and needs to either try other <span class="caps">ACCEPTED </span>plans from baseline or parse a new one.<br />
The plan with the index remain <span class="caps">ACCEPTED,</span> I believe (did not check on that) but will not be used.<br />
Keep in mind that you can have several <span class="caps">ACCEPTED </span>plans for the same statement and <span class="caps">ORACLE </span>can choose between them during parse. <span class="caps">ACCEPTED </span>does not mean <span class="caps">BEST, </span>nor does it mean <span class="caps">THE ONLY ONE </span>that can be used. Rather it means: it was approved at some point (which you can do manually, btw) </p>
<p>2. <span class="caps">SPM </span>is not a part of diagnostic license &#8211; it is available as a part of enterprise edition. What you are probably thinking about is <span class="caps">DBMS</span>_SQLTUNE package, which deals with profiles (close cousins to baselines), and does require tuning pack. It has a job that looks through sqls and finds profile recommendations as well as evolve baselines. But it is not necessary if you only want to evolve baselines &#8211; you can create your own &#8220;evolve&#8221; script quite easily.</p>
<p>Speaking of upgrades. You want to be real careful here. I think the main benefit of <span class="caps">SPM </span>during upgrades is the fact that you can &#8220;freeze&#8221; plans, not so much that you can make them better. While it is nice to improve the plans after upgrade, to me it is much more important not to make them worse &#8230; Unfortunately <span class="caps">SPM </span>evolution can do both. <br />
What is, arguably, even worse, it can also populate baselines with several <span class="caps">ACCEPTED </span>plans for the same sql, meaning that your sql will execute sometimes with plan A and sometimes with plan B. These plan flips can be disastrous if your users are relying on stable execution of that sql (there are ways to fix it by i.e. working with <span class="caps">ENABLED </span>attribute, but it&#8217;s better not to have this problem in the first place).</p>
<p>So, be extra careful with auto evolutions &#8211; they can do both good and bad.</p>
<p>Regards,<br />
Maxym Kharchenko</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alireza</title>
		<link>http://intermediatesql.com/oracle/oracle-11g-sql-plan-management-the-dark-side-of-spm-part-4/comment-page-1/#comment-1023</link>
		<dc:creator>Alireza</dc:creator>
		<pubDate>Thu, 10 Jan 2013 17:06:56 +0000</pubDate>
		<guid isPermaLink="false">http://intermediatesql.com/?p=323#comment-1023</guid>
		<description><![CDATA[Hi,
intresting notes in this article, but 2 questions!
Q1:
scenario 1: what if we remove the index on &#039;t&#039; and still let the &quot;best&quot; plan be ACCEPTED within the baselines?
Q2:
I have read that by having DIAGNOSTIC PACK lisence oracle would/should evolve and ACCEPT the best plan among the different ones within the baselines. I mean is there any way to enforce oracle to implicitly choose the best plan - let me say any automatically evolve process available?
My question is based on the cases, where we enable the SPM to capture the baselines and deploye a new release and we want to let oracle choose the best plans AFTER the deployment process.
If not the case , i could only imagine the best way to do that is running a script over the baselines and SET all the attributes of the column &quot;ACCEPTED&quot; to YES -&gt; thus we might enforde oracle to ALWAYS choose the best plans !!
What do you mean?
Thanks!]]></description>
		<content:encoded><![CDATA[<p>Hi,<br />
intresting notes in this article, but 2 questions!<br />
Q1:<br />
scenario 1: what if we remove the index on &#8216;t&#8217; and still let the &#8220;best&#8221; plan be <span class="caps">ACCEPTED </span>within the baselines?<br />
Q2:<br />
I have read that by having <span class="caps">DIAGNOSTIC PACK </span>lisence oracle would/should evolve and <span class="caps">ACCEPT </span>the best plan among the different ones within the baselines. I mean is there any way to enforce oracle to implicitly choose the best plan &#8211; let me say any automatically evolve process available?<br />
My question is based on the cases, where we enable the <span class="caps">SPM </span>to capture the baselines and deploye a new release and we want to let oracle choose the best plans <span class="caps">AFTER </span>the deployment process.<br />
If not the case , i could only imagine the best way to do that is running a script over the baselines and <span class="caps">SET </span>all the attributes of the column &#8220;ACCEPTED&#8221; to <span class="caps">YES </span>-&gt; thus we might enforde oracle to <span class="caps">ALWAYS </span>choose the best plans !!<br />
What do you mean?<br />
Thanks!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Maxym Kharchenko</title>
		<link>http://intermediatesql.com/oracle/oracle-11g-sql-plan-management-the-dark-side-of-spm-part-4/comment-page-1/#comment-979</link>
		<dc:creator>Maxym Kharchenko</dc:creator>
		<pubDate>Thu, 06 Dec 2012 20:54:34 +0000</pubDate>
		<guid isPermaLink="false">http://intermediatesql.com/?p=323#comment-979</guid>
		<description><![CDATA[Hello Vikas,

There could be multiple reasons. 

First of all, look at the v$sql.SQL_PLAN_BASELINE field for your query cursor to see what/whether baseline is actually used (it will be empty if it&#039;s not) or running dbms_xplan on your cursor and looking at the &quot;notes&quot; section. Depending on the results you can look deeper by i.e. dumping 10053 trace and seeing why baseline was (not) chosen.]]></description>
		<content:encoded><![CDATA[<p>Hello Vikas,</p>
<p>There could be multiple reasons. </p>
<p>First of all, look at the v$sql.SQL_PLAN_BASELINE field for your query cursor to see what/whether baseline is actually used (it will be empty if it&#8217;s not) or running dbms_xplan on your cursor and looking at the &#8220;notes&#8221; section. Depending on the results you can look deeper by i.e. dumping 10053 trace and seeing why baseline was (not) chosen.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Vikas Chauhan</title>
		<link>http://intermediatesql.com/oracle/oracle-11g-sql-plan-management-the-dark-side-of-spm-part-4/comment-page-1/#comment-977</link>
		<dc:creator>Vikas Chauhan</dc:creator>
		<pubDate>Thu, 06 Dec 2012 20:49:21 +0000</pubDate>
		<guid isPermaLink="false">http://intermediatesql.com/?p=323#comment-977</guid>
		<description><![CDATA[I have a scenario where there is an accepted baseline, but at runtime Oracle is still using the worse plan, why would this be ?]]></description>
		<content:encoded><![CDATA[<p>I have a scenario where there is an accepted baseline, but at runtime Oracle is still using the worse plan, why would this be ?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Maxym Kharchenko</title>
		<link>http://intermediatesql.com/oracle/oracle-11g-sql-plan-management-the-dark-side-of-spm-part-4/comment-page-1/#comment-923</link>
		<dc:creator>Maxym Kharchenko</dc:creator>
		<pubDate>Tue, 18 Sep 2012 22:10:09 +0000</pubDate>
		<guid isPermaLink="false">http://intermediatesql.com/?p=323#comment-923</guid>
		<description><![CDATA[Antony,

I&#039;m not sure that scenario 1 is strictly about baseline attributes, such as FIXED.

My point is: indexes can be ignored, because baselines require EXPLICIT operations (which is a bit weird).

I.e. if you have a baseline on your query that uses a full table scan and then you add an index, ORACLE will not automatically switch to using that index, even though a new plan with the index will likely be generated and be vastly more efficient.

You have to do something to enable the new plan, by either evolving it or simply forcing it (or dropping the baseline).

As for FIXED attribute, it can be used to force the plan that you want (again, explicitly), but I found it to be somewhat unreliable, so I&#039;m always forcing the plan by disabling all the other plans in the baseline (through ENABLED attribute).

Cheers,
Maxym Kharchenko]]></description>
		<content:encoded><![CDATA[<p>Antony,</p>
<p>I&#8217;m not sure that scenario 1 is strictly about baseline attributes, such as <span class="caps">FIXED.</span></p>
<p>My point is: indexes can be ignored, because baselines require <span class="caps">EXPLICIT </span>operations (which is a bit weird).</p>
<p>I.e. if you have a baseline on your query that uses a full table scan and then you add an index, <span class="caps">ORACLE </span>will not automatically switch to using that index, even though a new plan with the index will likely be generated and be vastly more efficient.</p>
<p>You have to do something to enable the new plan, by either evolving it or simply forcing it (or dropping the baseline).</p>
<p>As for <span class="caps">FIXED </span>attribute, it can be used to force the plan that you want (again, explicitly), but I found it to be somewhat unreliable, so I&#8217;m always forcing the plan by disabling all the other plans in the baseline (through <span class="caps">ENABLED </span>attribute).</p>
<p>Cheers,<br />
Maxym Kharchenko</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: antony</title>
		<link>http://intermediatesql.com/oracle/oracle-11g-sql-plan-management-the-dark-side-of-spm-part-4/comment-page-1/#comment-922</link>
		<dc:creator>antony</dc:creator>
		<pubDate>Tue, 18 Sep 2012 21:43:20 +0000</pubDate>
		<guid isPermaLink="false">http://intermediatesql.com/?p=323#comment-922</guid>
		<description><![CDATA[On Scenario 1,please check the column &quot;FIXED&quot;,which is used to set the plan that can be used even if both plans are accepted.

Thanks]]></description>
		<content:encoded><![CDATA[<p>On Scenario 1,please check the column &#8220;FIXED&#8221;,which is used to set the plan that can be used even if both plans are accepted.</p>
<p>Thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Amy</title>
		<link>http://intermediatesql.com/oracle/oracle-11g-sql-plan-management-the-dark-side-of-spm-part-4/comment-page-1/#comment-845</link>
		<dc:creator>Amy</dc:creator>
		<pubDate>Fri, 15 Jun 2012 14:55:33 +0000</pubDate>
		<guid isPermaLink="false">http://intermediatesql.com/?p=323#comment-845</guid>
		<description><![CDATA[Wow, nice info!  I was researching this for the company i work for and find this information very useful and informative!! To close #2 Loophole, don&#039;t let anyone but dba&#039;s have privs to create objects in the DB and create a cron job to validate!  done.]]></description>
		<content:encoded><![CDATA[<p>Wow, nice info!  I was researching this for the company i work for and find this information very useful and informative!! To close #2 Loophole, don&#8217;t let anyone but dba&#8217;s have privs to create objects in the DB and create a cron job to validate!  done.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
