<?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: Bind Capture</title>
	<atom:link href="http://jonathanlewis.wordpress.com/2008/07/24/bind-capture/feed/" rel="self" type="application/rss+xml" />
	<link>http://jonathanlewis.wordpress.com/2008/07/24/bind-capture/</link>
	<description>Just another Oracle weblog</description>
	<lastBuildDate>Wed, 19 Jun 2013 22:21:35 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
	<item>
		<title>By: bdrouvot</title>
		<link>http://jonathanlewis.wordpress.com/2008/07/24/bind-capture/#comment-55126</link>
		<dc:creator><![CDATA[bdrouvot]]></dc:creator>
		<pubDate>Tue, 30 Apr 2013 07:31:59 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=417#comment-55126</guid>
		<description><![CDATA[Hello Kyle,

Have you been able to figure out &quot;v$sql.bind_data – seemed like from the test above that this was more dependable, but still wondering if this is always the peeked bind values, or recently used values&quot; ?

I am asking because I write a sql to retrieve &quot;peeked&quot; and &quot;passed&quot; bind variable per execution that rely on v$sql_plan.other_xml (see http://bdrouvot.wordpress.com/2013/04/29/bind-variable-peeking-retrieve-peeked-and-passed-values-per-execution-in-oracle-11-2/) but I would like to display more &quot;peeked datatype values&quot; thanks to : dbms_sqltune.extract_bind

Thx
Bertrand]]></description>
		<content:encoded><![CDATA[<p>Hello Kyle,</p>
<p>Have you been able to figure out &#8220;v$sql.bind_data – seemed like from the test above that this was more dependable, but still wondering if this is always the peeked bind values, or recently used values&#8221; ?</p>
<p>I am asking because I write a sql to retrieve &#8220;peeked&#8221; and &#8220;passed&#8221; bind variable per execution that rely on v$sql_plan.other_xml (see <a href="http://bdrouvot.wordpress.com/2013/04/29/bind-variable-peeking-retrieve-peeked-and-passed-values-per-execution-in-oracle-11-2/" rel="nofollow">http://bdrouvot.wordpress.com/2013/04/29/bind-variable-peeking-retrieve-peeked-and-passed-values-per-execution-in-oracle-11-2/</a>) but I would like to display more &#8220;peeked datatype values&#8221; thanks to : dbms_sqltune.extract_bind</p>
<p>Thx<br />
Bertrand</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: http://dboptimizer.com/tools-2/ &#124; xfang</title>
		<link>http://jonathanlewis.wordpress.com/2008/07/24/bind-capture/#comment-52352</link>
		<dc:creator><![CDATA[http://dboptimizer.com/tools-2/ &#124; xfang]]></dc:creator>
		<pubDate>Fri, 28 Dec 2012 14:30:41 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=417#comment-52352</guid>
		<description><![CDATA[[...] extracting bind variables is something I’ve meant to look into but not spent much time. See http://jonathanlewis.wordpress.com/2008/07/24/bind-capture/ [...]]]></description>
		<content:encoded><![CDATA[<p>[...] extracting bind variables is something I’ve meant to look into but not spent much time. See <a href="http://jonathanlewis.wordpress.com/2008/07/24/bind-capture/" rel="nofollow">http://jonathanlewis.wordpress.com/2008/07/24/bind-capture/</a> [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: VMCD.ORG &#187; Blog Archive &#187; Capture binds always actually ?</title>
		<link>http://jonathanlewis.wordpress.com/2008/07/24/bind-capture/#comment-49464</link>
		<dc:creator><![CDATA[VMCD.ORG &#187; Blog Archive &#187; Capture binds always actually ?]]></dc:creator>
		<pubDate>Tue, 28 Aug 2012 10:06:19 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=417#comment-49464</guid>
		<description><![CDATA[[...] 在不停的变化，而此时通过dbms_xplan peeking binds 则不会产生变化,这也验证了jonathanlewis的这篇文章。 这篇文章的主旨为 &#8220;Capture binds always [...]]]></description>
		<content:encoded><![CDATA[<p>[...] 在不停的变化，而此时通过dbms_xplan peeking binds 则不会产生变化,这也验证了jonathanlewis的这篇文章。 这篇文章的主旨为 &#8220;Capture binds always [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Capture binds always actually ? &#124; louis liu 的镜像blog</title>
		<link>http://jonathanlewis.wordpress.com/2008/07/24/bind-capture/#comment-49460</link>
		<dc:creator><![CDATA[Capture binds always actually ? &#124; louis liu 的镜像blog]]></dc:creator>
		<pubDate>Tue, 28 Aug 2012 07:53:52 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=417#comment-49460</guid>
		<description><![CDATA[[...] 在不停的变化，而此时通过dbms_xplan peeking binds 则不会产生变化,这也验证了jonathanlewis的这篇文章。 这篇文章的主旨为 &#8220;Capture binds always [...]]]></description>
		<content:encoded><![CDATA[<p>[...] 在不停的变化，而此时通过dbms_xplan peeking binds 则不会产生变化,这也验证了jonathanlewis的这篇文章。 这篇文章的主旨为 &#8220;Capture binds always [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Doug's Oracle Blog</title>
		<link>http://jonathanlewis.wordpress.com/2008/07/24/bind-capture/#comment-47946</link>
		<dc:creator><![CDATA[Doug's Oracle Blog]]></dc:creator>
		<pubDate>Sat, 14 Jul 2012 07:00:31 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=417#comment-47946</guid>
		<description><![CDATA[&lt;strong&gt;OTHER_XML...&lt;/strong&gt;

Some features in this post require a Diagnostics Pack license.Just a small tip you might find makes things a little easier for you one day when trying to work out the underlying cause of a SQL execution plan change that leads to degraded performance af...]]></description>
		<content:encoded><![CDATA[<p><strong>OTHER_XML&#8230;</strong></p>
<p>Some features in this post require a Diagnostics Pack license.Just a small tip you might find makes things a little easier for you one day when trying to work out the underlying cause of a SQL execution plan change that leads to degraded performance af&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: DBA</title>
		<link>http://jonathanlewis.wordpress.com/2008/07/24/bind-capture/#comment-41950</link>
		<dc:creator><![CDATA[DBA]]></dc:creator>
		<pubDate>Tue, 04 Oct 2011 19:00:27 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=417#comment-41950</guid>
		<description><![CDATA[dba_hist_sql_bind_metadata shows the bind variable of last_name datatype_string as VARCHAR2(32).
2 questions:
1) Do you know if there is a limit on how many bind values the Peeked Binds section of the plan shows?
2) Is it possible for the optimizer to not peek at all 8 bind values but just peek at 7? This is a stupid question, but who knows.]]></description>
		<content:encoded><![CDATA[<p>dba_hist_sql_bind_metadata shows the bind variable of last_name datatype_string as VARCHAR2(32).<br />
2 questions:<br />
1) Do you know if there is a limit on how many bind values the Peeked Binds section of the plan shows?<br />
2) Is it possible for the optimizer to not peek at all 8 bind values but just peek at 7? This is a stupid question, but who knows.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jonathan Lewis</title>
		<link>http://jonathanlewis.wordpress.com/2008/07/24/bind-capture/#comment-41943</link>
		<dc:creator><![CDATA[Jonathan Lewis]]></dc:creator>
		<pubDate>Tue, 04 Oct 2011 15:23:55 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=417#comment-41943</guid>
		<description><![CDATA[DBA,

&lt;em&gt;&quot;Why wouldn&#039;t it show all the binds?&quot;&lt;/em&gt;
I don&#039;t know - I have seen the same phenomenon, but I haven&#039;t had time to investigate it.  It may be related to bind variable declaration sizes for character or NLS variables, though. I think I may also have seen the problem with binds of type timestamp.]]></description>
		<content:encoded><![CDATA[<p>DBA,</p>
<p><em>&#8220;Why wouldn&#8217;t it show all the binds?&#8221;</em><br />
I don&#8217;t know &#8211; I have seen the same phenomenon, but I haven&#8217;t had time to investigate it.  It may be related to bind variable declaration sizes for character or NLS variables, though. I think I may also have seen the problem with binds of type timestamp.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: DBA</title>
		<link>http://jonathanlewis.wordpress.com/2008/07/24/bind-capture/#comment-41926</link>
		<dc:creator><![CDATA[DBA]]></dc:creator>
		<pubDate>Mon, 03 Oct 2011 15:11:36 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=417#comment-41926</guid>
		<description><![CDATA[We have a query that runs behind a UI search screen based on several different criteria that the end user might enter with up to 28 bind variables. Most often only 8 of them are used (7 of them are auto populated, with end user entering only last_name). When I used dbms_xplan.display_cursor with +peeked_binds format, it doesn&#039;t show all 8 bind values. e.g. it doesn&#039;t show last_name criterion - which is the most important one. And I know that the user entered last_name. v$sql_bind_capture and dba_hist_sqlbind shows the last_name value. But dbms_xplan.display_cursor doesn&#039;t. Have you come across this? Why wouldn&#039;t it show all the binds?]]></description>
		<content:encoded><![CDATA[<p>We have a query that runs behind a UI search screen based on several different criteria that the end user might enter with up to 28 bind variables. Most often only 8 of them are used (7 of them are auto populated, with end user entering only last_name). When I used dbms_xplan.display_cursor with +peeked_binds format, it doesn&#8217;t show all 8 bind values. e.g. it doesn&#8217;t show last_name criterion &#8211; which is the most important one. And I know that the user entered last_name. v$sql_bind_capture and dba_hist_sqlbind shows the last_name value. But dbms_xplan.display_cursor doesn&#8217;t. Have you come across this? Why wouldn&#8217;t it show all the binds?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kyle Hailey</title>
		<link>http://jonathanlewis.wordpress.com/2008/07/24/bind-capture/#comment-37466</link>
		<dc:creator><![CDATA[Kyle Hailey]]></dc:creator>
		<pubDate>Sat, 02 Oct 2010 20:55:47 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=417#comment-37466</guid>
		<description><![CDATA[Thanks for the followup - yesterday, when I ran the script on the work database 
v$sql.bind_data had the values and v$sql_plan.other_xml didn&#039;t. Maybe I was making some mistake because now when I run it on my laptop from home both methods work. Will have to do some more testing.
We are adding to add bind variable capture to DB Optimizer and the first priority is to show peeked values but also interested in providing fall back methods to gather bind variable values and a &quot;nice to have&quot; feature would be to show recently used values that aren&#039;t necessarily the peeked values.
1) v$sql_plan.other_xml - peeked values (plus added benefit of having the hints so one could re-instantiate the plan should the statement&#039;s plan change in the future)
2) v$sql.bind_data - seemed like from the test above that this was more dependable, but still wondering if this is always the peeked bind values, or recently used values
3) v$sql_bind_data - recently used values, only updated every 900 seconds, and just looking at it right after running a query, it doesn&#039;t seem to be filled in immediately (like maybe it&#039;s filled in upon first execution and the not updated for another 900 seconds) but again maybe I&#039;m making a mistake

[sourcecode]
select b.sql_text, a.bind_vars, c.datatype, c.value
from v$sql_cursor a, v$sql b, v$sql_bind_data c
where b.address = a.parent_handle
  and a.curno = c.cursor_num
  and b.sql_id= &#039;&amp;v_sqlid&#039;
  and b.child_number = &amp;v_sqlcn
/
[/sourcecode]]]></description>
		<content:encoded><![CDATA[<p>Thanks for the followup &#8211; yesterday, when I ran the script on the work database<br />
v$sql.bind_data had the values and v$sql_plan.other_xml didn&#8217;t. Maybe I was making some mistake because now when I run it on my laptop from home both methods work. Will have to do some more testing.<br />
We are adding to add bind variable capture to DB Optimizer and the first priority is to show peeked values but also interested in providing fall back methods to gather bind variable values and a &#8220;nice to have&#8221; feature would be to show recently used values that aren&#8217;t necessarily the peeked values.<br />
1) v$sql_plan.other_xml &#8211; peeked values (plus added benefit of having the hints so one could re-instantiate the plan should the statement&#8217;s plan change in the future)<br />
2) v$sql.bind_data &#8211; seemed like from the test above that this was more dependable, but still wondering if this is always the peeked bind values, or recently used values<br />
3) v$sql_bind_data &#8211; recently used values, only updated every 900 seconds, and just looking at it right after running a query, it doesn&#8217;t seem to be filled in immediately (like maybe it&#8217;s filled in upon first execution and the not updated for another 900 seconds) but again maybe I&#8217;m making a mistake</p>
<pre class="brush: plain; title: ; notranslate">
select b.sql_text, a.bind_vars, c.datatype, c.value
from v$sql_cursor a, v$sql b, v$sql_bind_data c
where b.address = a.parent_handle
  and a.curno = c.cursor_num
  and b.sql_id= '&amp;v_sqlid'
  and b.child_number = &amp;v_sqlcn
/
</pre>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jonathan Lewis</title>
		<link>http://jonathanlewis.wordpress.com/2008/07/24/bind-capture/#comment-37464</link>
		<dc:creator><![CDATA[Jonathan Lewis]]></dc:creator>
		<pubDate>Sat, 02 Oct 2010 10:39:50 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=417#comment-37464</guid>
		<description><![CDATA[Kyle,

The XML tags in your final output have made Wordpress destroy the results - but when I ran your script on 10.2.0.1 my XML output included (with some editing):

[sourecode]
&lt;peeked_binds&gt;&lt;bind nam=&quot;:X&quot; pos=&quot;1&quot; dty=&quot;1&quot; csi=&quot;178&quot; frm=&quot;1&quot; mxl=&quot;32&quot;&gt;58&lt;/bind&gt;&lt;/peeked_binds&gt;
[/sourcecode]

As you can see, the &#039;X&#039; is there as 58 (hex).

Your comment arrived at a good moment, though, because it reminded me of the options available for capturing bind variables - which I need to do the next time a visit a particular client.

Here&#039;s an interesting follow-up, though, on what information is stored where:
[sourcecode]
exec :X := &#039;Y&#039;

select :X from dual where dummy = :X;
[/sourcecode]
Some code will use the same bind variable several times - and even use the same variable in the select list and the where clause. In 10.2.0.1 here are three different result from trying to get the value of :X
[sourcecode]
v$sql.bind_data
BIND_DATA
------------------------------------

1 row selected.

dbms_xplan.display_cursor()
Peeked Binds (identified by position):
--------------------------------------
   2 - :X (VARCHAR2(30), CSID=178, Primary=1)

v$sql_bind_capture

  POSITION DUP_POSITION NAME  VALUE_STRING
---------- ------------ ----- ------------
         1              :X
         2            1 :X

[/sourcecode]

In this case v$sql.bind_data breaks completely - and the other two don&#039;t help us to get values.
]]></description>
		<content:encoded><![CDATA[<p>Kyle,</p>
<p>The XML tags in your final output have made WordPress destroy the results &#8211; but when I ran your script on 10.2.0.1 my XML output included (with some editing):</p>
<p>[sourecode]<br />
&lt;peeked_binds&gt;&lt;bind nam=&#8221;:X&#8221; pos=&#8221;1&#8243; dty=&#8221;1&#8243; csi=&#8221;178&#8243; frm=&#8221;1&#8243; mxl=&#8221;32&#8243;&gt;58&lt;/bind&gt;&lt;/peeked_binds&gt;<br />
[/sourcecode]</p>
<p>As you can see, the &#8216;X&#8217; is there as 58 (hex).</p>
<p>Your comment arrived at a good moment, though, because it reminded me of the options available for capturing bind variables &#8211; which I need to do the next time a visit a particular client.</p>
<p>Here&#8217;s an interesting follow-up, though, on what information is stored where:</p>
<pre class="brush: plain; title: ; notranslate">
exec :X := 'Y'

select :X from dual where dummy = :X;
</pre>
<p>Some code will use the same bind variable several times &#8211; and even use the same variable in the select list and the where clause. In 10.2.0.1 here are three different result from trying to get the value of :X</p>
<pre class="brush: plain; title: ; notranslate">
v$sql.bind_data
BIND_DATA
------------------------------------

1 row selected.

dbms_xplan.display_cursor()
Peeked Binds (identified by position):
--------------------------------------
   2 - :X (VARCHAR2(30), CSID=178, Primary=1)

v$sql_bind_capture

  POSITION DUP_POSITION NAME  VALUE_STRING
---------- ------------ ----- ------------
         1              :X
         2            1 :X

</pre>
<p>In this case v$sql.bind_data breaks completely &#8211; and the other two don&#8217;t help us to get values.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
