<?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: Cursor_sharing</title>
	<atom:link href="http://jonathanlewis.wordpress.com/2008/03/09/cursor_sharing/feed/" rel="self" type="application/rss+xml" />
	<link>http://jonathanlewis.wordpress.com/2008/03/09/cursor_sharing/</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: Valentin Nikotin</title>
		<link>http://jonathanlewis.wordpress.com/2008/03/09/cursor_sharing/#comment-54077</link>
		<dc:creator><![CDATA[Valentin Nikotin]]></dc:creator>
		<pubDate>Tue, 12 Mar 2013 14:57:00 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=348#comment-54077</guid>
		<description><![CDATA[And another funny thing with force sharing. This result is from 11g, but try to check it with 10g - there is no any reason in v$sql_shared_cursor why we have 2 cursors :-)
[sourcecode language=&quot;SQL&quot; collapse=&quot;true&quot;]
SQL&gt; alter session set cursor_sharing = force;

Session altered.

SQL&gt; select /* cursor_sharing2 */ level, -level from dual connect by level &lt; 3 order by 1;

     LEVEL     -LEVEL
---------- ----------
         1         -1
         2         -2

SQL&gt; select /* cursor_sharing2 */ level, -level from dual connect by level &lt; 3 order by 2;

     LEVEL     -LEVEL
---------- ----------
         2         -2
         1         -1

SQL&gt; select sql_text,sql_id,plan_hash_value,literal_hash_value from v$sql s where sql_id = &#039;75qbnnd93d3sw&#039;;

SQL_TEXT                                                                                                       SQL_ID        PLAN_HASH_VALUE LITERAL_HASH_VALUE
-------------------------------------------------------------------------------------------------------------- ------------- --------------- ------------------
select /* cursor_sharing2 */ level, -level from dual connect by level &lt; :&quot;SYS_B_0&quot; order by :&quot;SYS_B_1&quot;         75qbnnd93d3sw      3764016154         2342552567
select /* cursor_sharing2 */ level, -level from dual connect by level &lt; :&quot;SYS_B_0&quot; order by :&quot;SYS_B_1&quot;         75qbnnd93d3sw      3764016154         2064090006

SQL&gt; select hash_match_failed from v$sql_shared_cursor where sql_id = &#039;75qbnnd93d3sw&#039;;

H
-
N
Y
[/sourcecode]]]></description>
		<content:encoded><![CDATA[<p>And another funny thing with force sharing. This result is from 11g, but try to check it with 10g &#8211; there is no any reason in v$sql_shared_cursor why we have 2 cursors :-)</p>
<pre class="brush: sql; collapse: true; light: false; title: ; toolbar: true; notranslate">
SQL&gt; alter session set cursor_sharing = force;

Session altered.

SQL&gt; select /* cursor_sharing2 */ level, -level from dual connect by level &lt; 3 order by 1;

     LEVEL     -LEVEL
---------- ----------
         1         -1
         2         -2

SQL&gt; select /* cursor_sharing2 */ level, -level from dual connect by level &lt; 3 order by 2;

     LEVEL     -LEVEL
---------- ----------
         2         -2
         1         -1

SQL&gt; select sql_text,sql_id,plan_hash_value,literal_hash_value from v$sql s where sql_id = '75qbnnd93d3sw';

SQL_TEXT                                                                                                       SQL_ID        PLAN_HASH_VALUE LITERAL_HASH_VALUE
-------------------------------------------------------------------------------------------------------------- ------------- --------------- ------------------
select /* cursor_sharing2 */ level, -level from dual connect by level &lt; :&quot;SYS_B_0&quot; order by :&quot;SYS_B_1&quot;         75qbnnd93d3sw      3764016154         2342552567
select /* cursor_sharing2 */ level, -level from dual connect by level &lt; :&quot;SYS_B_0&quot; order by :&quot;SYS_B_1&quot;         75qbnnd93d3sw      3764016154         2064090006

SQL&gt; select hash_match_failed from v$sql_shared_cursor where sql_id = '75qbnnd93d3sw';

H
-
N
Y
</pre>
]]></content:encoded>
	</item>
	<item>
		<title>By: Valentin Nikotin</title>
		<link>http://jonathanlewis.wordpress.com/2008/03/09/cursor_sharing/#comment-54076</link>
		<dc:creator><![CDATA[Valentin Nikotin]]></dc:creator>
		<pubDate>Tue, 12 Mar 2013 14:47:45 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=348#comment-54076</guid>
		<description><![CDATA[In my case I did some spool-based export script, that creates file with inserts. To reduce parsing I added &quot;cursor_sharing = force&quot; before inserts, but still found a lot of cursors after data had been loaded. I noticed that sql_id was different, so it wasn&#039;t just mismatch issue. When I checked SQL, I got it.]]></description>
		<content:encoded><![CDATA[<p>In my case I did some spool-based export script, that creates file with inserts. To reduce parsing I added &#8220;cursor_sharing = force&#8221; before inserts, but still found a lot of cursors after data had been loaded. I noticed that sql_id was different, so it wasn&#8217;t just mismatch issue. When I checked SQL, I got it.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jonathan Lewis</title>
		<link>http://jonathanlewis.wordpress.com/2008/03/09/cursor_sharing/#comment-54073</link>
		<dc:creator><![CDATA[Jonathan Lewis]]></dc:creator>
		<pubDate>Tue, 12 Mar 2013 12:31:48 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=348#comment-54073</guid>
		<description><![CDATA[Valentin,

You&#039;re very good at finding entertaining anomalies.

I wonder if this manages to have some side effects relating to the problems that people can see with bind variable mismatch based on varchar() lengths ?]]></description>
		<content:encoded><![CDATA[<p>Valentin,</p>
<p>You&#8217;re very good at finding entertaining anomalies.</p>
<p>I wonder if this manages to have some side effects relating to the problems that people can see with bind variable mismatch based on varchar() lengths ?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Valentin Nikotin</title>
		<link>http://jonathanlewis.wordpress.com/2008/03/09/cursor_sharing/#comment-54071</link>
		<dc:creator><![CDATA[Valentin Nikotin]]></dc:creator>
		<pubDate>Tue, 12 Mar 2013 12:15:37 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=348#comment-54071</guid>
		<description><![CDATA[Just another sharing oops:
[sourcecode language=&quot;SQL&quot; collapse=&quot;true&quot;]
SQL&gt; alter session set cursor_sharing = force;

Session altered.

SQL&gt; select /* cursor_sharing */ 1 from dual;

         1
----------
         1

SQL&gt; select /* cursor_sharing */ null from dual;

N
-


SQL&gt; select /* cursor_sharing */ -1 from dual;

        -1
----------
        -1

SQL&gt; insert /* cursor_sharing */ into y values (1);

1 row created.

SQL&gt; insert /* cursor_sharing */ into y values (-1);

1 row created.

SQL&gt; insert /* cursor_sharing */ into y values (null);

1 row created.

SQL&gt; commit;

Commit complete.

SQL&gt; select sql_text from v$sql where sql_text like &#039;%/* cursor_sharing */%&#039; order by 1;

SQL_TEXT
------------------------------------------------------------
insert /* cursor_sharing */ into y values (-:&quot;SYS_B_0&quot;)
insert /* cursor_sharing */ into y values (:&quot;SYS_B_0&quot;)
insert /* cursor_sharing */ into y values (null)
select /* cursor_sharing */ -:&quot;SYS_B_0&quot; from dual
select /* cursor_sharing */ :&quot;SYS_B_0&quot; from dual
select /* cursor_sharing */ null from dual

6 rows selected.
[/sourcecode]]]></description>
		<content:encoded><![CDATA[<p>Just another sharing oops:</p>
<pre class="brush: sql; collapse: true; light: false; title: ; toolbar: true; notranslate">
SQL&gt; alter session set cursor_sharing = force;

Session altered.

SQL&gt; select /* cursor_sharing */ 1 from dual;

         1
----------
         1

SQL&gt; select /* cursor_sharing */ null from dual;

N
-


SQL&gt; select /* cursor_sharing */ -1 from dual;

        -1
----------
        -1

SQL&gt; insert /* cursor_sharing */ into y values (1);

1 row created.

SQL&gt; insert /* cursor_sharing */ into y values (-1);

1 row created.

SQL&gt; insert /* cursor_sharing */ into y values (null);

1 row created.

SQL&gt; commit;

Commit complete.

SQL&gt; select sql_text from v$sql where sql_text like '%/* cursor_sharing */%' order by 1;

SQL_TEXT
------------------------------------------------------------
insert /* cursor_sharing */ into y values (-:&quot;SYS_B_0&quot;)
insert /* cursor_sharing */ into y values (:&quot;SYS_B_0&quot;)
insert /* cursor_sharing */ into y values (null)
select /* cursor_sharing */ -:&quot;SYS_B_0&quot; from dual
select /* cursor_sharing */ :&quot;SYS_B_0&quot; from dual
select /* cursor_sharing */ null from dual

6 rows selected.
</pre>
]]></content:encoded>
	</item>
	<item>
		<title>By: Cursor Sharing 3 &#171; Oracle Scratchpad</title>
		<link>http://jonathanlewis.wordpress.com/2008/03/09/cursor_sharing/#comment-36143</link>
		<dc:creator><![CDATA[Cursor Sharing 3 &#171; Oracle Scratchpad]]></dc:creator>
		<pubDate>Mon, 03 May 2010 20:58:39 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=348#comment-36143</guid>
		<description><![CDATA[[...] another anomaly with cursor_sharing (fixed in 11g) that might be a source of performance [...]]]></description>
		<content:encoded><![CDATA[<p>[...] another anomaly with cursor_sharing (fixed in 11g) that might be a source of performance [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jonathan Lewis</title>
		<link>http://jonathanlewis.wordpress.com/2008/03/09/cursor_sharing/#comment-35002</link>
		<dc:creator><![CDATA[Jonathan Lewis]]></dc:creator>
		<pubDate>Wed, 16 Dec 2009 13:54:08 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=348#comment-35002</guid>
		<description><![CDATA[Anthony,

No, there isn&#039;t - even in 11.2
For a list of valid hints you can query &lt;em&gt;&lt;strong&gt;v$sql_hint&lt;/strong&gt;&lt;/em&gt; in 11g.]]></description>
		<content:encoded><![CDATA[<p>Anthony,</p>
<p>No, there isn&#8217;t &#8211; even in 11.2<br />
For a list of valid hints you can query <em><strong>v$sql_hint</strong></em> in 11g.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Anthony Odukoya</title>
		<link>http://jonathanlewis.wordpress.com/2008/03/09/cursor_sharing/#comment-34994</link>
		<dc:creator><![CDATA[Anthony Odukoya]]></dc:creator>
		<pubDate>Wed, 16 Dec 2009 09:15:22 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=348#comment-34994</guid>
		<description><![CDATA[is there actually a hint cursor_sharing_force available in oracle 11.1.0.x because I have tried that in house and it seems as though such a hint does not exist?]]></description>
		<content:encoded><![CDATA[<p>is there actually a hint cursor_sharing_force available in oracle 11.1.0.x because I have tried that in house and it seems as though such a hint does not exist?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jonathan Lewis</title>
		<link>http://jonathanlewis.wordpress.com/2008/03/09/cursor_sharing/#comment-34686</link>
		<dc:creator><![CDATA[Jonathan Lewis]]></dc:creator>
		<pubDate>Wed, 21 Oct 2009 10:05:36 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=348#comment-34686</guid>
		<description><![CDATA[Coskan,

I&#039;ll look into that as soon as I can - and see if I can work out why I thought that my statement was true. I&#039;m fairly sure it would have been 11.1.0.6.]]></description>
		<content:encoded><![CDATA[<p>Coskan,</p>
<p>I&#8217;ll look into that as soon as I can &#8211; and see if I can work out why I thought that my statement was true. I&#8217;m fairly sure it would have been 11.1.0.6.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: coskan</title>
		<link>http://jonathanlewis.wordpress.com/2008/03/09/cursor_sharing/#comment-34683</link>
		<dc:creator><![CDATA[coskan]]></dc:creator>
		<pubDate>Wed, 21 Oct 2009 09:16:53 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=348#comment-34683</guid>
		<description><![CDATA[Jonathan,

In Which version of 11G filter disappears. It is still there for my 11.1.0.6 on windows
[sourcecode]
SQL&gt; select * from v$version
  2  ;

BANNER
--------------------------------------------------------------------------------
Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - Production
PL/SQL Release 11.1.0.6.0 - Production
CORE    11.1.0.6.0      Production
TNS for 32-bit Windows: Version 11.1.0.6.0 - Production
NLSRTL Version 11.1.0.6.0 - Production

SQL&gt; show parameter optimizer_features_enable 

NAME                                 TYPE                             VALUE
------------------------------------ -------------------------------- ----------------------------------
optimizer_features_enable            string                           11.1.0.6

SQL&gt; show parameter cursor_sharing

NAME                                 TYPE                             VALUE
------------------------------------ -------------------------------- ----------------------------------
cursor_sharing                       string                           SIMILAR

SQL&gt; select id from t1 where rownum=1;

        ID
----------
    128734

SQL&gt; @e2

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------------------------------
-------------------------------------------------
SQL_ID  cpbxvfq99ntfb, child number 0
-------------------------------------
select id from t1 where rownum=:&quot;SYS_B_0&quot;

Plan hash value: 3836375644

---------------------------------------------------------------------------
&#124; Id  &#124; Operation          &#124; Name &#124; Rows  &#124; Bytes &#124; Cost (%CPU)&#124; Time     &#124;
---------------------------------------------------------------------------
&#124;   0 &#124; SELECT STATEMENT   &#124;      &#124;       &#124;       &#124;     2 (100)&#124;          &#124;
&#124;*  1 &#124;  COUNT STOPKEY     &#124;      &#124;       &#124;       &#124;            &#124;          &#124;
&#124;   2 &#124;   TABLE ACCESS FULL&#124; T1   &#124;     1 &#124;     5 &#124;     2   (0)&#124; 00:00:01 &#124;
---------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   1 - filter(ROWNUM=:SYS_B_0)


19 rows selected.

SQL&gt; select id from t1 where rownum=2;

no rows selected

SQL&gt; @e2

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------------------------------
-------------------------------------------------
SQL_ID  cpbxvfq99ntfb, child number 1
-------------------------------------
select id from t1 where rownum=:&quot;SYS_B_0&quot;

Plan hash value: 624922415

----------------------------------------------------------------------------
&#124; Id  &#124; Operation           &#124; Name &#124; Rows  &#124; Bytes &#124; Cost (%CPU)&#124; Time     &#124;
----------------------------------------------------------------------------
&#124;   0 &#124; SELECT STATEMENT    &#124;      &#124;       &#124;       &#124;   765 (100)&#124;          &#124;
&#124;   1 &#124;  COUNT              &#124;      &#124;       &#124;       &#124;            &#124;          &#124;
&#124;*  2 &#124;   FILTER            &#124;      &#124;       &#124;       &#124;            &#124;          &#124;
&#124;   3 &#124;    TABLE ACCESS FULL&#124; T1   &#124;  1000K&#124;  4882K&#124;   765   (2)&#124; 00:00:10 &#124;
----------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   2 - filter(ROWNUM=:SYS_B_0)


20 rows selected.
[/sourcecode]]]></description>
		<content:encoded><![CDATA[<p>Jonathan,</p>
<p>In Which version of 11G filter disappears. It is still there for my 11.1.0.6 on windows</p>
<pre class="brush: plain; title: ; notranslate">
SQL&amp;gt; select * from v$version
  2  ;

BANNER
--------------------------------------------------------------------------------
Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - Production
PL/SQL Release 11.1.0.6.0 - Production
CORE    11.1.0.6.0      Production
TNS for 32-bit Windows: Version 11.1.0.6.0 - Production
NLSRTL Version 11.1.0.6.0 - Production

SQL&amp;gt; show parameter optimizer_features_enable 

NAME                                 TYPE                             VALUE
------------------------------------ -------------------------------- ----------------------------------
optimizer_features_enable            string                           11.1.0.6

SQL&amp;gt; show parameter cursor_sharing

NAME                                 TYPE                             VALUE
------------------------------------ -------------------------------- ----------------------------------
cursor_sharing                       string                           SIMILAR

SQL&amp;gt; select id from t1 where rownum=1;

        ID
----------
    128734

SQL&amp;gt; @e2

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------------------------------
-------------------------------------------------
SQL_ID  cpbxvfq99ntfb, child number 0
-------------------------------------
select id from t1 where rownum=:&quot;SYS_B_0&quot;

Plan hash value: 3836375644

---------------------------------------------------------------------------
| Id  | Operation          | Name | Rows  | Bytes | Cost (%CPU)| Time     |
---------------------------------------------------------------------------
|   0 | SELECT STATEMENT   |      |       |       |     2 (100)|          |
|*  1 |  COUNT STOPKEY     |      |       |       |            |          |
|   2 |   TABLE ACCESS FULL| T1   |     1 |     5 |     2   (0)| 00:00:01 |
---------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   1 - filter(ROWNUM=:SYS_B_0)


19 rows selected.

SQL&amp;gt; select id from t1 where rownum=2;

no rows selected

SQL&amp;gt; @e2

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------------------------------
-------------------------------------------------
SQL_ID  cpbxvfq99ntfb, child number 1
-------------------------------------
select id from t1 where rownum=:&quot;SYS_B_0&quot;

Plan hash value: 624922415

----------------------------------------------------------------------------
| Id  | Operation           | Name | Rows  | Bytes | Cost (%CPU)| Time     |
----------------------------------------------------------------------------
|   0 | SELECT STATEMENT    |      |       |       |   765 (100)|          |
|   1 |  COUNT              |      |       |       |            |          |
|*  2 |   FILTER            |      |       |       |            |          |
|   3 |    TABLE ACCESS FULL| T1   |  1000K|  4882K|   765   (2)| 00:00:10 |
----------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   2 - filter(ROWNUM=:SYS_B_0)


20 rows selected.
</pre>
]]></content:encoded>
	</item>
	<item>
		<title>By: Cursor_sharing (2) &#171; Oracle Scratchpad</title>
		<link>http://jonathanlewis.wordpress.com/2008/03/09/cursor_sharing/#comment-34617</link>
		<dc:creator><![CDATA[Cursor_sharing (2) &#171; Oracle Scratchpad]]></dc:creator>
		<pubDate>Tue, 13 Oct 2009 18:24:00 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=348#comment-34617</guid>
		<description><![CDATA[[...] earlier posting on my blog about one of the little oddities that can appear when you use cursor_sharing.    Leave a [...]]]></description>
		<content:encoded><![CDATA[<p>[...] earlier posting on my blog about one of the little oddities that can appear when you use cursor_sharing.    Leave a [...]</p>
]]></content:encoded>
	</item>
</channel>
</rss>
