<?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: Why Isn&#8217;t Oracle Using My Outline / Profile / Baseline?</title>
	<atom:link href="http://kerryosborne.oracle-guy.com/2009/07/why-isnt-oracle-using-my-outline-profile-baseline/feed/" rel="self" type="application/rss+xml" />
	<link>http://kerryosborne.oracle-guy.com/2009/07/why-isnt-oracle-using-my-outline-profile-baseline/</link>
	<description>Just another Oracle blog</description>
	<lastBuildDate>Mon, 06 Feb 2012 21:28:20 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: Outline, SQL profile and SQL Plan Management(SPM) &#171; Oracle Explorer: Standing on the shoulders of giants</title>
		<link>http://kerryosborne.oracle-guy.com/2009/07/why-isnt-oracle-using-my-outline-profile-baseline/#comment-49146</link>
		<dc:creator>Outline, SQL profile and SQL Plan Management(SPM) &#171; Oracle Explorer: Standing on the shoulders of giants</dc:creator>
		<pubDate>Fri, 22 Jul 2011 00:54:54 +0000</pubDate>
		<guid isPermaLink="false">http://kerryosborne.oracle-guy.com/?p=1668#comment-49146</guid>
		<description>[...] SQL profile requires a license. http://kerryosborne.oracle-guy.com/2009/04/oracle-sql-profiles/ http://kerryosborne.oracle-guy.com/2009/07/why-isnt-oracle-using-my-outline-profile-baseline/ [...]</description>
		<content:encoded><![CDATA[<p>[...] SQL profile requires a license. <a href="http://kerryosborne.oracle-guy.com/2009/04/oracle-sql-profiles/" rel="nofollow">http://kerryosborne.oracle-guy.com/2009/04/oracle-sql-profiles/</a> <a href="http://kerryosborne.oracle-guy.com/2009/07/why-isnt-oracle-using-my-outline-profile-baseline/" rel="nofollow">http://kerryosborne.oracle-guy.com/2009/07/why-isnt-oracle-using-my-outline-profile-baseline/</a> [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: anu</title>
		<link>http://kerryosborne.oracle-guy.com/2009/07/why-isnt-oracle-using-my-outline-profile-baseline/#comment-45146</link>
		<dc:creator>anu</dc:creator>
		<pubDate>Thu, 16 Jun 2011 12:04:13 +0000</pubDate>
		<guid isPermaLink="false">http://kerryosborne.oracle-guy.com/?p=1668#comment-45146</guid>
		<description>Kerry,
In what scenarios are force_matching_signature=0? I created a sql tuning set of 30 statements to load into the SQL Management Base (dba_sql_plan_baselines) But,  notice that not all of them get loaded into this table from the sql tuning set. I see the ones that had a value of 0 for the force_matching_signature column in the sql tuning set are the ones that didnt make it into the dba_sql_plan_baselines.  Can you explain why these didnt make it to the dba_sql_plan_baselines?

Thanks, 
Anu</description>
		<content:encoded><![CDATA[<p>Kerry,<br />
In what scenarios are force_matching_signature=0? I created a sql tuning set of 30 statements to load into the SQL Management Base (dba_sql_plan_baselines) But,  notice that not all of them get loaded into this table from the sql tuning set. I see the ones that had a value of 0 for the force_matching_signature column in the sql tuning set are the ones that didnt make it into the dba_sql_plan_baselines.  Can you explain why these didnt make it to the dba_sql_plan_baselines?</p>
<p>Thanks,<br />
Anu</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: SQL Plan Baselines &#171; Oracle Scratchpad</title>
		<link>http://kerryosborne.oracle-guy.com/2009/07/why-isnt-oracle-using-my-outline-profile-baseline/#comment-35908</link>
		<dc:creator>SQL Plan Baselines &#171; Oracle Scratchpad</dc:creator>
		<pubDate>Thu, 10 Feb 2011 16:50:38 +0000</pubDate>
		<guid isPermaLink="false">http://kerryosborne.oracle-guy.com/?p=1668#comment-35908</guid>
		<description>[...] (pt.1) 2. Do SQL Plan Baselines use hints (pt. 2) 3. SQL Plan Management &#8211; SQL Plan Baselines 4. Why isn&#8217;t Oracle using my outline/ SQL profile / SQL Plan Baseline 5. Dynamic Sampling and profiles/baselines 6. Licence differences between profiles and [...]</description>
		<content:encoded><![CDATA[<p>[...] (pt.1) 2. Do SQL Plan Baselines use hints (pt. 2) 3. SQL Plan Management &#8211; SQL Plan Baselines 4. Why isn&#8217;t Oracle using my outline/ SQL profile / SQL Plan Baseline 5. Dynamic Sampling and profiles/baselines 6. Licence differences between profiles and [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bill Auslander</title>
		<link>http://kerryosborne.oracle-guy.com/2009/07/why-isnt-oracle-using-my-outline-profile-baseline/#comment-26990</link>
		<dc:creator>Bill Auslander</dc:creator>
		<pubDate>Mon, 25 Oct 2010 21:05:30 +0000</pubDate>
		<guid isPermaLink="false">http://kerryosborne.oracle-guy.com/?p=1668#comment-26990</guid>
		<description>Yes, the profile was created manually.  I&#039;m not sure why INDEX works, but INDEX_RS_ASC doesn&#039;t.  But, I can&#039;t argue with my query that used to take 63 seconds, now takes 9 seconds.  And, it sounds like Oracle is fine with manually created profiles, so I&#039;m good to go.  Thanks for the great info!

Bill</description>
		<content:encoded><![CDATA[<p>Yes, the profile was created manually.  I&#8217;m not sure why INDEX works, but INDEX_RS_ASC doesn&#8217;t.  But, I can&#8217;t argue with my query that used to take 63 seconds, now takes 9 seconds.  And, it sounds like Oracle is fine with manually created profiles, so I&#8217;m good to go.  Thanks for the great info!</p>
<p>Bill</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: osborne</title>
		<link>http://kerryosborne.oracle-guy.com/2009/07/why-isnt-oracle-using-my-outline-profile-baseline/#comment-26980</link>
		<dc:creator>osborne</dc:creator>
		<pubDate>Mon, 25 Oct 2010 19:14:30 +0000</pubDate>
		<guid isPermaLink="false">http://kerryosborne.oracle-guy.com/?p=1668#comment-26980</guid>
		<description>This looks like a profile created manually (by my create_sql_profile.sql script for example). At any rate, I don&#039;t see any problem with what you&#039;ve done. I recently found a reference on MOS to using dbms_sqltune.import_sql_profile to create manual profiles. So I think it is not something to worry about. See this post on that topic: 

http://kerryosborne.oracle-guy.com/2010/07/sqlt-coe_xfr_sql_profilesql/

By the way, I&#039;d be interested to know what access path the INDEX hint allowed that the INDEX_RS_ASC didn&#039;t. 

Kerry</description>
		<content:encoded><![CDATA[<p>This looks like a profile created manually (by my create_sql_profile.sql script for example). At any rate, I don&#8217;t see any problem with what you&#8217;ve done. I recently found a reference on MOS to using dbms_sqltune.import_sql_profile to create manual profiles. So I think it is not something to worry about. See this post on that topic: </p>
<p><a href="http://kerryosborne.oracle-guy.com/2010/07/sqlt-coe_xfr_sql_profilesql/" rel="nofollow">http://kerryosborne.oracle-guy.com/2010/07/sqlt-coe_xfr_sql_profilesql/</a></p>
<p>By the way, I&#8217;d be interested to know what access path the INDEX hint allowed that the INDEX_RS_ASC didn&#8217;t. </p>
<p>Kerry</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bill Auslander</title>
		<link>http://kerryosborne.oracle-guy.com/2009/07/why-isnt-oracle-using-my-outline-profile-baseline/#comment-26978</link>
		<dc:creator>Bill Auslander</dc:creator>
		<pubDate>Mon, 25 Oct 2010 18:39:42 +0000</pubDate>
		<guid isPermaLink="false">http://kerryosborne.oracle-guy.com/?p=1668#comment-26978</guid>
		<description>Yes, I have.  Here it is:

BEGIN_OUTLINE_DATA
INDEX_RS_ASC(@SEL$1 NAMES@SEL$1 UPPER_NAME_INDEX)
OUTLINE_LEAF(@SEL$1)
ALL_ROWS
OPT_PARAM(&#039;optimizer_index_caching&#039; 40)
OPT_PARAM(&#039;optimizer_index_cost_adj&#039; 40)
DB_VERSION(&#039;11.1.0.7&#039;)
OPTIMIZER_FEATURES_ENABLE(&#039;11.1.0.7&#039;)
IGNORE_OPTIM_EMBEDDED_HINTS
END_OUTLINE_DATA


Also - I used fix_sql_profile_hint.sql to change it to INDEX(@SEL$1 NAMES@SEL$1 UPPER_NAME_INDEX), and now I get the promised 90% improvement!  However, it feels like I&#039;m cheating (read &quot;Oracle doesn&#039;t support/recommend this&quot;).
I&#039;m hoping maybe I&#039;m missing a setting or something that would cause the hint to be INDEX instead of INDEX_RS_ASC.</description>
		<content:encoded><![CDATA[<p>Yes, I have.  Here it is:</p>
<p>BEGIN_OUTLINE_DATA<br />
INDEX_RS_ASC(@SEL$1 NAMES@SEL$1 UPPER_NAME_INDEX)<br />
OUTLINE_LEAF(@SEL$1)<br />
ALL_ROWS<br />
OPT_PARAM(&#8216;optimizer_index_caching&#8217; 40)<br />
OPT_PARAM(&#8216;optimizer_index_cost_adj&#8217; 40)<br />
DB_VERSION(&#8217;11.1.0.7&#8242;)<br />
OPTIMIZER_FEATURES_ENABLE(&#8217;11.1.0.7&#8242;)<br />
IGNORE_OPTIM_EMBEDDED_HINTS<br />
END_OUTLINE_DATA</p>
<p>Also &#8211; I used fix_sql_profile_hint.sql to change it to INDEX(@SEL$1 NAMES@SEL$1 UPPER_NAME_INDEX), and now I get the promised 90% improvement!  However, it feels like I&#8217;m cheating (read &#8220;Oracle doesn&#8217;t support/recommend this&#8221;).<br />
I&#8217;m hoping maybe I&#8217;m missing a setting or something that would cause the hint to be INDEX instead of INDEX_RS_ASC.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: osborne</title>
		<link>http://kerryosborne.oracle-guy.com/2009/07/why-isnt-oracle-using-my-outline-profile-baseline/#comment-26972</link>
		<dc:creator>osborne</dc:creator>
		<pubDate>Mon, 25 Oct 2010 17:22:19 +0000</pubDate>
		<guid isPermaLink="false">http://kerryosborne.oracle-guy.com/?p=1668#comment-26972</guid>
		<description>Hi Bill,

When trying to understand why a hint based mechanism is not doing what you expect, it&#039;s best to look directly at the hints. You say you implemented a SQL profile suggested by the Tuning Advisor. Generally those hints look like OPT_ESTIMATE or statistics modification type hints. Have you run the sql_profile_hints.sql script to see exactly what&#039;s being applied? If so can you paste the output here?

Kerry</description>
		<content:encoded><![CDATA[<p>Hi Bill,</p>
<p>When trying to understand why a hint based mechanism is not doing what you expect, it&#8217;s best to look directly at the hints. You say you implemented a SQL profile suggested by the Tuning Advisor. Generally those hints look like OPT_ESTIMATE or statistics modification type hints. Have you run the sql_profile_hints.sql script to see exactly what&#8217;s being applied? If so can you paste the output here?</p>
<p>Kerry</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bill Auslander</title>
		<link>http://kerryosborne.oracle-guy.com/2009/07/why-isnt-oracle-using-my-outline-profile-baseline/#comment-26965</link>
		<dc:creator>Bill Auslander</dc:creator>
		<pubDate>Mon, 25 Oct 2010 16:30:47 +0000</pubDate>
		<guid isPermaLink="false">http://kerryosborne.oracle-guy.com/?p=1668#comment-26965</guid>
		<description>Very interesting and helpful article!

I have a query that is doing a full table scan.  I ran the tuning optimizer task, and it recommended an SQL profile which I accepted, that promised 90%+ improvement.  When comparing the plans, it proposed using an index.  Good, so far!

Well, as in your case, when running the query, it still did the full table scan even though it said it used the profile.

The index hint for the profile used INDEX_RS_ASC.  I believe that is the culprit.

When I run my query specifically with the /*+ INDEX  (table_name my_index) */ hint, then the index is used.

If I run it with /*+ INDEX_RS_ASC (table_name my_index) */ then a full table scan is done.

Is there a way, without using your scripts to change the profile hint, for me to get Oracle to do use the INDEX hint rather than an INDEX_RS_ASC hint?

Thanks,

Bill</description>
		<content:encoded><![CDATA[<p>Very interesting and helpful article!</p>
<p>I have a query that is doing a full table scan.  I ran the tuning optimizer task, and it recommended an SQL profile which I accepted, that promised 90%+ improvement.  When comparing the plans, it proposed using an index.  Good, so far!</p>
<p>Well, as in your case, when running the query, it still did the full table scan even though it said it used the profile.</p>
<p>The index hint for the profile used INDEX_RS_ASC.  I believe that is the culprit.</p>
<p>When I run my query specifically with the /*+ INDEX  (table_name my_index) */ hint, then the index is used.</p>
<p>If I run it with /*+ INDEX_RS_ASC (table_name my_index) */ then a full table scan is done.</p>
<p>Is there a way, without using your scripts to change the profile hint, for me to get Oracle to do use the INDEX hint rather than an INDEX_RS_ASC hint?</p>
<p>Thanks,</p>
<p>Bill</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: osborne</title>
		<link>http://kerryosborne.oracle-guy.com/2009/07/why-isnt-oracle-using-my-outline-profile-baseline/#comment-25300</link>
		<dc:creator>osborne</dc:creator>
		<pubDate>Mon, 11 Oct 2010 14:00:54 +0000</pubDate>
		<guid isPermaLink="false">http://kerryosborne.oracle-guy.com/?p=1668#comment-25300</guid>
		<description>Naren,

  SQL Profiles can apply to multiple SQL statements via the FORCE_MATCHING parameter, but there is no finer grained way of applying them than to a single SQL_ID. So no, there is no syntax for applying them to individual children. That would not help you anyway because as soon as you create a SQL Profile, the existing cursors will be invalidated and a new cursor will be created at the next execution. As to why you got the plan you wanted on one child and not others, I am not sure how you created your SQL Profile, maybe with my create_1_hint_sql_profile.sql script? At any rate, the syntax you are using &quot;index (Table_Alias Index_Name)&quot; would need to be modified to include a query block in order for it to work inside a SQL profile like this:

index(Table_Alias@Query_Block Index_Name)

The default query block name is SEL$1 for a simple query (you can see them by doing an XPLAN with &#039;alias&#039;)

select * from table(dbms_xplan.display_cursor(&#039;&amp;sql_id&#039;,&#039;&amp;child_no&#039;,&#039;alias&#039;));

So the plan changing is probably a function of the optimizer just coming up with a different plan (maybe due to bind variable peeking).

Kerry</description>
		<content:encoded><![CDATA[<p>Naren,</p>
<p>  SQL Profiles can apply to multiple SQL statements via the FORCE_MATCHING parameter, but there is no finer grained way of applying them than to a single SQL_ID. So no, there is no syntax for applying them to individual children. That would not help you anyway because as soon as you create a SQL Profile, the existing cursors will be invalidated and a new cursor will be created at the next execution. As to why you got the plan you wanted on one child and not others, I am not sure how you created your SQL Profile, maybe with my create_1_hint_sql_profile.sql script? At any rate, the syntax you are using &#8220;index (Table_Alias Index_Name)&#8221; would need to be modified to include a query block in order for it to work inside a SQL profile like this:</p>
<p>index(Table_Alias@Query_Block Index_Name)</p>
<p>The default query block name is SEL$1 for a simple query (you can see them by doing an XPLAN with &#8216;alias&#8217;)</p>
<p>select * from table(dbms_xplan.display_cursor(&#8216;&#038;sql_id&#8217;,'&#038;child_no&#8217;,'alias&#8217;));</p>
<p>So the plan changing is probably a function of the optimizer just coming up with a different plan (maybe due to bind variable peeking).</p>
<p>Kerry</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Naren</title>
		<link>http://kerryosborne.oracle-guy.com/2009/07/why-isnt-oracle-using-my-outline-profile-baseline/#comment-24749</link>
		<dc:creator>Naren</dc:creator>
		<pubDate>Wed, 06 Oct 2010 03:17:14 +0000</pubDate>
		<guid isPermaLink="false">http://kerryosborne.oracle-guy.com/?p=1668#comment-24749</guid>
		<description>Hi Kerry,

I have been using SQL hints on sql profiles with good degree of success. Recently, i am facing an issue where after applying the SQL hint (/*+INDEX(Table_ALias Index_Name)*/)to an SQL profile, the plan changes for certain child numbers only. For example, a sql_id had child numbers 0, 2, 4, 6 and dbms_xplan indicated that the child 2 has the hinted plan (good) whereas the others don&#039;t. This is on Oracle 11.1.0.7. 

I there a way to apply a sql profile to different child numbers of the same sql_id? Would appreciate if u can explore further? 

Regards,
Naren</description>
		<content:encoded><![CDATA[<p>Hi Kerry,</p>
<p>I have been using SQL hints on sql profiles with good degree of success. Recently, i am facing an issue where after applying the SQL hint (/*+INDEX(Table_ALias Index_Name)*/)to an SQL profile, the plan changes for certain child numbers only. For example, a sql_id had child numbers 0, 2, 4, 6 and dbms_xplan indicated that the child 2 has the hinted plan (good) whereas the others don&#8217;t. This is on Oracle 11.1.0.7. </p>
<p>I there a way to apply a sql profile to different child numbers of the same sql_id? Would appreciate if u can explore further? </p>
<p>Regards,<br />
Naren</p>
]]></content:encoded>
	</item>
</channel>
</rss>

