<?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: CURSOR_SHARING = SIMILAR !</title>
	<atom:link href="http://www.dbform.com/html/2007/341.html/feed" rel="self" type="application/rss+xml" />
	<link>http://www.dbform.com/html/2007/341.html</link>
	<description>面朝大海，春暖花开</description>
	<lastBuildDate>Fri, 12 Mar 2010 16:38:20 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: kamus</title>
		<link>http://www.dbform.com/html/2007/341.html/comment-page-1#comment-22716</link>
		<dc:creator>kamus</dc:creator>
		<pubDate>Mon, 27 Apr 2009 08:27:29 +0000</pubDate>
		<guid isPermaLink="false">http://www.dbform.com/archives/341#comment-22716</guid>
		<description>&lt;a href=&quot;#comment-22711&quot; rel=&quot;nofollow&quot;&gt;@ma.qy&lt;/a&gt; 
你提到的这篇文档并没有指出histogram的存在与此问题无关。相反地，倒是我这篇文章一份很好的注脚  :D
比如你说dynamic sampling会导致游标不共享，原因在于“even if there are no histograms (or even statistics) on a table (since dynamic sampling will create these in the background.”
当然，还有其它情况也会导致CBO认为bind is unsafe，但是正如你提到的文档中所说，“This occurs in a few scenarios but the most common is with histogram stats on an equality predicate.”
同时，这篇文档也说明了为什么设置CURSOR_SHARING = FORCE也可以解决这个问题。
</description>
		<content:encoded><![CDATA[<p><a href="#comment-22711" rel="nofollow">@ma.qy</a><br />
你提到的这篇文档并没有指出histogram的存在与此问题无关。相反地，倒是我这篇文章一份很好的注脚  <img src='http://www.dbform.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /><br />
比如你说dynamic sampling会导致游标不共享，原因在于“even if there are no histograms (or even statistics) on a table (since dynamic sampling will create these in the background.”<br />
当然，还有其它情况也会导致CBO认为bind is unsafe，但是正如你提到的文档中所说，“This occurs in a few scenarios but the most common is with histogram stats on an equality predicate.”<br />
同时，这篇文档也说明了为什么设置CURSOR_SHARING = FORCE也可以解决这个问题。</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ma.qy</title>
		<link>http://www.dbform.com/html/2007/341.html/comment-page-1#comment-22711</link>
		<dc:creator>ma.qy</dc:creator>
		<pubDate>Mon, 27 Apr 2009 06:51:39 +0000</pubDate>
		<guid isPermaLink="false">http://www.dbform.com/archives/341#comment-22711</guid>
		<description>我来说说这个问题。当cursor_sharing=similar
1：从metalink 377847.1来看，不论有无histgram，都不会共享游标。
2：这个问题与是否有histogram无关。而在如“377847.1”所说的dynamic sampling，是否有关？从我的测试结果来看，应该是有关的。但是在tom的文章里面，tom明确说明dynamic sampling只在hard parse才发生。
3:我已经测试到没有histogram的时候也会发生bind peek导致游标不共享。而且肯定可以重复</description>
		<content:encoded><![CDATA[<p>我来说说这个问题。当cursor_sharing=similar<br />
1：从metalink 377847.1来看，不论有无histgram，都不会共享游标。<br />
2：这个问题与是否有histogram无关。而在如“377847.1”所说的dynamic sampling，是否有关？从我的测试结果来看，应该是有关的。但是在tom的文章里面，tom明确说明dynamic sampling只在hard parse才发生。<br />
3:我已经测试到没有histogram的时候也会发生bind peek导致游标不共享。而且肯定可以重复</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Programming Tutorials</title>
		<link>http://www.dbform.com/html/2007/341.html/comment-page-1#comment-16977</link>
		<dc:creator>Programming Tutorials</dc:creator>
		<pubDate>Sat, 27 Oct 2007 05:09:17 +0000</pubDate>
		<guid isPermaLink="false">http://www.dbform.com/archives/341#comment-16977</guid>
		<description>&lt;strong&gt;Programming Tutorials...&lt;/strong&gt;

I couldn&#039;t understand some parts of this article, but it sounds interesting...</description>
		<content:encoded><![CDATA[<p><strong>Programming Tutorials&#8230;</strong></p>
<p>I couldn&#8217;t understand some parts of this article, but it sounds interesting&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Software Development Guide</title>
		<link>http://www.dbform.com/html/2007/341.html/comment-page-1#comment-16768</link>
		<dc:creator>Software Development Guide</dc:creator>
		<pubDate>Wed, 10 Oct 2007 03:31:32 +0000</pubDate>
		<guid isPermaLink="false">http://www.dbform.com/archives/341#comment-16768</guid>
		<description>&lt;strong&gt;Software Development Guide...&lt;/strong&gt;

I couldn&#039;t understand some parts of this article, but it sounds interesting...</description>
		<content:encoded><![CDATA[<p><strong>Software Development Guide&#8230;</strong></p>
<p>I couldn&#8217;t understand some parts of this article, but it sounds interesting&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: koko</title>
		<link>http://www.dbform.com/html/2007/341.html/comment-page-1#comment-16455</link>
		<dc:creator>koko</dc:creator>
		<pubDate>Fri, 14 Sep 2007 07:34:32 +0000</pubDate>
		<guid isPermaLink="false">http://www.dbform.com/archives/341#comment-16455</guid>
		<description>恩  而且我觉得这种情况太容易发生了
一个sql如果出现了多个varchar2(4000)很有可能在将来的莫个时候
出现问题 
我就在怀疑
这种varchar2节约空间的机制 真的有必要吗？</description>
		<content:encoded><![CDATA[<p>恩  而且我觉得这种情况太容易发生了<br />
一个sql如果出现了多个varchar2(4000)很有可能在将来的莫个时候<br />
出现问题<br />
我就在怀疑<br />
这种varchar2节约空间的机制 真的有必要吗？</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: kamus</title>
		<link>http://www.dbform.com/html/2007/341.html/comment-page-1#comment-16438</link>
		<dc:creator>kamus</dc:creator>
		<pubDate>Thu, 13 Sep 2007 03:00:04 +0000</pubDate>
		<guid isPermaLink="false">http://www.dbform.com/archives/341#comment-16438</guid>
		<description>@koko
你说的那个帖子我有印象，那其实也是varchar2变长的问题，而且还必须是后出现的SQL中绑定的变量长度要大于前面一个SQL，所以也并不仅仅是你说的只要满足那4个条件就可以，你说的那4个条件太普遍了。</description>
		<content:encoded><![CDATA[<p>@koko<br />
你说的那个帖子我有印象，那其实也是varchar2变长的问题，而且还必须是后出现的SQL中绑定的变量长度要大于前面一个SQL，所以也并不仅仅是你说的只要满足那4个条件就可以，你说的那4个条件太普遍了。</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: koko</title>
		<link>http://www.dbform.com/html/2007/341.html/comment-page-1#comment-16388</link>
		<dc:creator>koko</dc:creator>
		<pubDate>Mon, 10 Sep 2007 03:08:06 +0000</pubDate>
		<guid isPermaLink="false">http://www.dbform.com/archives/341#comment-16388</guid>
		<description>还有这几个

http://www.itpub.net/731757,0.html

http://www.itpub.net/731071.html

困惑了很久了</description>
		<content:encoded><![CDATA[<p>还有这几个</p>
<p><a href="http://www.itpub.net/731757,0.html" rel="nofollow">http://www.itpub.net/731757,0.html</a></p>
<p><a href="http://www.itpub.net/731071.html" rel="nofollow">http://www.itpub.net/731071.html</a></p>
<p>困惑了很久了</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: koko</title>
		<link>http://www.dbform.com/html/2007/341.html/comment-page-1#comment-16387</link>
		<dc:creator>koko</dc:creator>
		<pubDate>Mon, 10 Sep 2007 03:01:42 +0000</pubDate>
		<guid isPermaLink="false">http://www.dbform.com/archives/341#comment-16387</guid>
		<description>早些时候我在论坛发过一个帖子 你也参与了的 你可能忘记了

http://www.itpub.net/763469,0.html</description>
		<content:encoded><![CDATA[<p>早些时候我在论坛发过一个帖子 你也参与了的 你可能忘记了</p>
<p><a href="http://www.itpub.net/763469,0.html" rel="nofollow">http://www.itpub.net/763469,0.html</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: kamus</title>
		<link>http://www.dbform.com/html/2007/341.html/comment-page-1#comment-16357</link>
		<dc:creator>kamus</dc:creator>
		<pubDate>Sat, 08 Sep 2007 05:23:15 +0000</pubDate>
		<guid isPermaLink="false">http://www.dbform.com/archives/341#comment-16357</guid>
		<description>@koko
如果是这样的话，那应当是另外一个问题。
能否给出你的SQL，执行计划以及相关表信息。
你的情况是最普通的绑定变量应用，如果仅仅是因为绑定变量就导致version count过高，那这个世界早就乱了。。。</description>
		<content:encoded><![CDATA[<p>@koko<br />
如果是这样的话，那应当是另外一个问题。<br />
能否给出你的SQL，执行计划以及相关表信息。<br />
你的情况是最普通的绑定变量应用，如果仅仅是因为绑定变量就导致version count过高，那这个世界早就乱了。。。</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: koko</title>
		<link>http://www.dbform.com/html/2007/341.html/comment-page-1#comment-16305</link>
		<dc:creator>koko</dc:creator>
		<pubDate>Thu, 06 Sep 2007 07:57:58 +0000</pubDate>
		<guid isPermaLink="false">http://www.dbform.com/archives/341#comment-16305</guid>
		<description>产生这种情况的条件是：
1. cursor_sharing = similar
2. 收集了列上的histogram
3. SQL中使用到了此列作为条件，并且条件是“等于”
4. 这个SQL是没有绑定变量的

这四个条件是必要的吗？
我记得似乎就是绑定了变量，还是会出现这种情况的

我这里就是这个现象  
1. cursor_sharing = exact
2 .未收集列上的histogram
3. insert sql
4.绑定了变量

version_count&gt;32767 因此oracle在查一个sql有没有一个可用的执行计划的时候 child table &gt;32767 抱了一个ora600的错</description>
		<content:encoded><![CDATA[<p>产生这种情况的条件是：<br />
1. cursor_sharing = similar<br />
2. 收集了列上的histogram<br />
3. SQL中使用到了此列作为条件，并且条件是“等于”<br />
4. 这个SQL是没有绑定变量的</p>
<p>这四个条件是必要的吗？<br />
我记得似乎就是绑定了变量，还是会出现这种情况的</p>
<p>我这里就是这个现象<br />
1. cursor_sharing = exact<br />
2 .未收集列上的histogram<br />
3. insert sql<br />
4.绑定了变量</p>
<p>version_count&gt;32767 因此oracle在查一个sql有没有一个可用的执行计划的时候 child table &gt;32767 抱了一个ora600的错</p>
]]></content:encoded>
	</item>
</channel>
</rss>
