<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>ora-solutions.net - Martin Decker &#187; Bugs</title>
	<atom:link href="http://www.ora-solutions.net/web/category/oracle-database/bugs/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.ora-solutions.net/web</link>
	<description>Indepented Oracle consultant</description>
	<lastBuildDate>Wed, 14 Jul 2010 17:59:51 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=abc</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Highly Dangerous Oracle Database Security Vulnerability</title>
		<link>http://www.ora-solutions.net/web/2010/02/26/highly-dangerous-oracle-database-security-vulnerability/</link>
		<comments>http://www.ora-solutions.net/web/2010/02/26/highly-dangerous-oracle-database-security-vulnerability/#comments</comments>
		<pubDate>Fri, 26 Feb 2010 20:39:25 +0000</pubDate>
		<dc:creator>Martin</dc:creator>
				<category><![CDATA[10g]]></category>
		<category><![CDATA[11g]]></category>
		<category><![CDATA[Bugs]]></category>
		<category><![CDATA[Oracle Database]]></category>
		<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://www.ora-solutions.net/web/?p=802</guid>
		<description><![CDATA[I would like to draw your attention to a particularly dangerous security vulnerability, which was recently published by David Litchfield. 
How dangerous is the vulnerability?
Any database user, who has &#8220;create session&#8221; privilege, which means, who can log into the database, can use the security hole to execute any OS command in the ownership of the [...]]]></description>
			<content:encoded><![CDATA[<p>I would like to draw your attention to a particularly dangerous security vulnerability, which was recently published by David Litchfield. </p>
<p><strong>How dangerous is the vulnerability?</strong></p>
<p>Any database user, who has &#8220;create session&#8221; privilege, which means, who can log into the database, can use the security hole to execute any OS command in the ownership of the oracle database owner. This means, that both denial of service as well as access to all data is exposed.</p>
<p><strong>Which versions are affected?</strong></p>
<p>Affected are database versions 10.2.0.4 (incl. 10.2.0.4.3 containing latest security patches as of January 2010) as well as 11g (incl. 11.2.0.1).</p>
<p><strong>What can I do to close this security vulernability?</strong></p>
<p>You can revoke privileges from PUBLIC:</p>
<p>revoke execute on dbms_java from PUBLIC;<br />
revoke execute on dbms_java_test from PUBLIC;<br />
revoke execute on “oracle/aurora/util/Wrapper” from PUBLIC;<br />
grant execute on sys.dbms_jvm_exp_perms to IMP_FULL_DATABASE;<br />
grant execute on sys.dbms_jvm_exp_perms to EXP_FULL_DATABASE;<br />
revoke execute on sys.dbms_jvm_exp_perms from PUBLIC;</p>
<p>If you are using a third party vendor application, you should contact your vendor to check compatibility with revoked privileges or test before implementing in production.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ora-solutions.net/web/2010/02/26/highly-dangerous-oracle-database-security-vulnerability/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Oracle Clusterware / ASM 11.1.0.7: ASM Instance crash</title>
		<link>http://www.ora-solutions.net/web/2009/10/28/oracle-clusterware-asm-11-1-0-7-asm-instance-crash/</link>
		<comments>http://www.ora-solutions.net/web/2009/10/28/oracle-clusterware-asm-11-1-0-7-asm-instance-crash/#comments</comments>
		<pubDate>Wed, 28 Oct 2009 15:27:00 +0000</pubDate>
		<dc:creator>Martin</dc:creator>
				<category><![CDATA[11g]]></category>
		<category><![CDATA[Bugs]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[MetaLink]]></category>
		<category><![CDATA[Oracle Database]]></category>
		<category><![CDATA[Solaris]]></category>
		<category><![CDATA[Unix]]></category>

		<guid isPermaLink="false">http://www.ora-solutions.net/web/?p=779</guid>
		<description><![CDATA[During a 11gR1 Clusterware installation for a Single Instance Failover Cluster at a customer site, I have experienced an interesting behaviour, which was caused by an Oracle Bug.
The environment was:

2 Node Oracle Clusterware 11.1.0.7 Cluster on Linux x86_64 using latest Recommended Patches as of October 19th. (pre PSU 11.1.0.7.1)
Clusterware installed as unix user crs
ASM installed [...]]]></description>
			<content:encoded><![CDATA[<p>During a 11gR1 Clusterware installation for a Single Instance Failover Cluster at a customer site, I have experienced an interesting behaviour, which was caused by an Oracle Bug.</p>
<p>The environment was:</p>
<ul>
<li>2 Node Oracle Clusterware 11.1.0.7 Cluster on Linux x86_64 using latest Recommended Patches as of October 19th. (pre PSU 11.1.0.7.1)</li>
<li>Clusterware installed as unix user crs</li>
<li>ASM installed as unix user oracle</li>
</ul>
<p>The ASM instances could be started with SQL*Plus without any problems, but if the ASM instances were started by means of clusterware using srvctl (either from root, crs or oracle) the  ASM instances would crash at diskgroup mount with:</p>
<blockquote>
<pre>ORA-07445: exception encountered: core dump  [sskgds_find_rtn_hdr()+1171]
[SIGBUS] [ADDR:0x2AACD701342C] [PC:0x25799DF]
[Non-existent physical address] []</pre>
</blockquote>
<p>Oracle Support identified this behaviour as Bug 6952915, for which there are patches for Linux x86, x86_64 and Solaris Sparc64.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ora-solutions.net/web/2009/10/28/oracle-clusterware-asm-11-1-0-7-asm-instance-crash/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>High CPU Utilization &#8211; waits on cursor: pin S</title>
		<link>http://www.ora-solutions.net/web/2009/08/11/high-cpu-utilization-waits-on-cursor-pin-s/</link>
		<comments>http://www.ora-solutions.net/web/2009/08/11/high-cpu-utilization-waits-on-cursor-pin-s/#comments</comments>
		<pubDate>Tue, 11 Aug 2009 05:42:14 +0000</pubDate>
		<dc:creator>Martin</dc:creator>
				<category><![CDATA[10g]]></category>
		<category><![CDATA[Bugs]]></category>
		<category><![CDATA[MetaLink]]></category>
		<category><![CDATA[Oracle Database]]></category>

		<guid isPermaLink="false">http://www.ora-solutions.net/web/?p=736</guid>
		<description><![CDATA[I have recently encountered a problem at a customer site, where the database instances resource utilization was so high that the application did not work anymore. Version was 10.2.0.4 on Linux with Oracle Recommended Generic Patches installed.
Unfortunately, the customer decided to bounce the instance, so that there is no possibility for intensive diagnosis. However, ASH [...]]]></description>
			<content:encoded><![CDATA[<p>I have recently encountered a problem at a customer site, where the database instances resource utilization was so high that the application did not work anymore. Version was 10.2.0.4 on Linux with Oracle Recommended Generic Patches installed.</p>
<p>Unfortunately, the customer decided to bounce the instance, so that there is no possibility for intensive diagnosis. However, ASH report shows that a dozen sessions either waited on Wait event &#8220;cursor: pin S&#8221; or were active (ON CPU) without any SQL_ID. An AWR Report  showed:</p>
<blockquote><pre>Top 5 Timed Events                                         Avg %Total
~~~~~~~~~~~~~~~~~~                                        wait   Call
Event                                 Waits    Time (s)   (ms)   Time Wait Class
------------------------------ ------------ ----------- ------ ------ ----------
cursor: pin S                   140,036,615      24,833      0 ######      Other
CPU time                                             19          72.9
log file sync                         8,767           8      1   30.2     Commit
log file parallel write               9,039           8      1   29.9 System I/O
control file parallel write           1,269           5      4   20.2 System I/O</pre>
</blockquote>
<p>Oracle Support confirmed that this is <strong>Bug 6904068 High CPU usage when there are &#8220;cursor: pin S&#8221; waits.</strong> We have filed a backport request for it, as there is no patch for our platform available yet.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ora-solutions.net/web/2009/08/11/high-cpu-utilization-waits-on-cursor-pin-s/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Default 10gR2 RAC TNS Configuration can cause TCP Timeouts for application</title>
		<link>http://www.ora-solutions.net/web/2009/05/12/default-10gr2-rac-tns-configuration-can-cause-tcp-timeouts-for-application/</link>
		<comments>http://www.ora-solutions.net/web/2009/05/12/default-10gr2-rac-tns-configuration-can-cause-tcp-timeouts-for-application/#comments</comments>
		<pubDate>Tue, 12 May 2009 14:57:06 +0000</pubDate>
		<dc:creator>Martin</dc:creator>
				<category><![CDATA[10g]]></category>
		<category><![CDATA[Bugs]]></category>
		<category><![CDATA[Oracle Database]]></category>
		<category><![CDATA[Real Application Clusters]]></category>
		<category><![CDATA[Unix]]></category>

		<guid isPermaLink="false">http://www.ora-solutions.net/web/?p=625</guid>
		<description><![CDATA[The default RAC installation does normally not set &#8220;local_listener&#8221; init.ora parameter. If the listener is running on port 1521, then the database does not need the parameter in order to find and register with the local TNS listener process. However, if you have *not* set local_listener, it means that the database registers at the listener [...]]]></description>
			<content:encoded><![CDATA[<p>The default RAC installation does normally not set &#8220;local_listener&#8221; init.ora parameter. If the listener is running on port 1521, then the database does not need the parameter in order to find and register with the local TNS listener process. However, if you have *not* set local_listener, it means that the database registers at the listener with the physical IP address instead of the virtual (vip) address. </p>
<p>You can determine if this happens when you take a look at &#8220;lsnrctl serv&#8221; output from your rac nodes:</p>
<pre>
Service "S_APP" has 1 instance(s).
  Instance "MDDB1", status READY, has 2 handler(s) for this service...
    Handler(s):
      "DEDICATED" established:0 refused:0 state:ready
         REMOTE SERVER
         (ADDRESS=(PROTOCOL=TCP)(HOST=ora-vm1.intra)(PORT=1521))
</pre>
<p>Instead of ora-vm1.intra, this should be ora-vm1-vip.intra.</p>
<p><strong>Why should I care?</strong></p>
<p>If you use the default configuration, then you are using the parameter “REMOTE_LISTENER” and therefore Server Side Connect Time Load Balancing. This means, that the listeners of all nodes receive load information from all instances of all nodes and they can redirect connections to the least loaded instance, even if the instance is on another node. But the connect string they then send back to the client contains the physical IP address instead of the virtual. </p>
<p>In case of node crashes or kernel panics, etc. the client has to wait for the TCP timeout until this is detected. </p>
<p><strong>Solution</strong></p>
<pre>
tnsnames.ora:

LISTENER_MDDB1 =
  (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = TCP)(HOST = ora-vm1-vip.intra)(PORT = 1521))
  )

LISTENER_MDDB2 =
  (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = TCP)(HOST = ora-vm2-vip.intra)(PORT = 1521))
  )

init.ora:
alter system set local_listener = 'LISTENER_MDDB1' sid='MDDB1';
alter system set local_listener = 'LISTENER_MDDB2' sid='MDDB2';
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.ora-solutions.net/web/2009/05/12/default-10gr2-rac-tns-configuration-can-cause-tcp-timeouts-for-application/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Your experience with RAC Dynamic Remastering (DRM) in 10gR2?</title>
		<link>http://www.ora-solutions.net/web/2009/05/12/your-experience-with-rac-dynamic-remastering-drm-in-10gr2/</link>
		<comments>http://www.ora-solutions.net/web/2009/05/12/your-experience-with-rac-dynamic-remastering-drm-in-10gr2/#comments</comments>
		<pubDate>Tue, 12 May 2009 14:37:48 +0000</pubDate>
		<dc:creator>Martin</dc:creator>
				<category><![CDATA[10g]]></category>
		<category><![CDATA[Bugs]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Linux Itanium]]></category>
		<category><![CDATA[Oracle Database]]></category>
		<category><![CDATA[Performance Tuning]]></category>
		<category><![CDATA[Real Application Clusters]]></category>
		<category><![CDATA[Unix]]></category>

		<guid isPermaLink="false">http://www.ora-solutions.net/web/?p=662</guid>
		<description><![CDATA[One of my customers is having severe RAC performance issues, which appeared a dozen times so far. Each time, the performance impact lasted around 10 minutes and caused basically a hang of the application. ASH investigation revealed that the time frame of performance issues exactly matches a DRM operation of the biggest segment of the [...]]]></description>
			<content:encoded><![CDATA[<p>One of my customers is having severe RAC performance issues, which appeared a dozen times so far. Each time, the performance impact lasted around 10 minutes and caused basically a hang of the application. ASH investigation revealed that the time frame of performance issues exactly matches a DRM operation of the biggest segment of the database. During the problematic time period, there are 20-50 instead of 5-10 active sessions and they are mostly waiting for gc related events: &#8220;gc buffer busy&#8221;,&#8221;gc cr block busy&#8221;, &#8220;gc cr block 2-way&#8221;, &#8220;gc current block 2-way&#8221;, &#8220;gc current request&#8221;, &#8220;gc current grant busy&#8221;, etc.</p>
<p>In addition, there is one single session which has wait event &#8220;<strong>kjbdrmcvtq lmon drm quiesce: ping completion</strong>&#8221; (on instance 1) and 1-3 sessions with wait event &#8220;<strong>gc remaster</strong>&#8220;. (on instance 2) The cur_obj# of the session waiting on &#8220;gc remaster&#8221; is pointing to the segment being remastered.</p>
<p>Does anybody have any experience with DRM problems with 10.2.0.4 on Linux Itanium?</p>
<p>I know that it is possible to deactive DRM, but usually it should be beneficial to have it enabled. I could not find any reports of performance impact during DRM operation on metalink. Support is involved but clueless so far.</p>
<p>Regards,<br />
Martin</p>
<p><a href="http://forums.oracle.com/forums/message.jspa?messageID=3447436#3447436">http://forums.oracle.com/forums/message.jspa?messageID=3447436#3447436</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.ora-solutions.net/web/2009/05/12/your-experience-with-rac-dynamic-remastering-drm-in-10gr2/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>RAC Deadlock Detection not working on 10.2.0.4 / Linux Itanium</title>
		<link>http://www.ora-solutions.net/web/2009/05/12/rac-deadlock-detection-not-working-on-10204-linux-itanium/</link>
		<comments>http://www.ora-solutions.net/web/2009/05/12/rac-deadlock-detection-not-working-on-10204-linux-itanium/#comments</comments>
		<pubDate>Tue, 12 May 2009 14:29:39 +0000</pubDate>
		<dc:creator>Martin</dc:creator>
				<category><![CDATA[10g]]></category>
		<category><![CDATA[Bugs]]></category>
		<category><![CDATA[Linux Itanium]]></category>
		<category><![CDATA[Oracle Database]]></category>

		<guid isPermaLink="false">http://www.ora-solutions.net/web/?p=660</guid>
		<description><![CDATA[We recently experienced a big issue, when the production database was hung. It turned out that the database has deadlocked, but the GES did not detect the deadlock situation, so all the sessions were waiting on &#8220;enq: TX row lock contention&#8221;. 
We could provide a reproducible testcase and it turned out to be bug 7014855. [...]]]></description>
			<content:encoded><![CDATA[<p>We recently experienced a big issue, when the production database was hung. It turned out that the database has deadlocked, but the GES did not detect the deadlock situation, so all the sessions were waiting on &#8220;enq: TX row lock contention&#8221;. </p>
<p>We could provide a reproducible testcase and it turned out to be bug 7014855. The bug is platform specific to Linux Itanium port and a patch is available.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ora-solutions.net/web/2009/05/12/rac-deadlock-detection-not-working-on-10204-linux-itanium/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Monitoring Index Usage not reliable in 10.2.0.4</title>
		<link>http://www.ora-solutions.net/web/2009/05/12/monitoring-index-usage-not-reliable-in-10204/</link>
		<comments>http://www.ora-solutions.net/web/2009/05/12/monitoring-index-usage-not-reliable-in-10204/#comments</comments>
		<pubDate>Tue, 12 May 2009 14:22:00 +0000</pubDate>
		<dc:creator>Martin</dc:creator>
				<category><![CDATA[10g]]></category>
		<category><![CDATA[Bugs]]></category>
		<category><![CDATA[Oracle Database]]></category>

		<guid isPermaLink="false">http://www.ora-solutions.net/web/?p=651</guid>
		<description><![CDATA[I recently had to analyze a system in respect of index utilization. The application has dozens of indexes and we have to find out, which ones are really needed and which ones are candidates for removal. 
There is a nice feature, called Index Monitoring which switches a flag if the index is used.
ALTER INDEX schema.index [...]]]></description>
			<content:encoded><![CDATA[<p>I recently had to analyze a system in respect of index utilization. The application has dozens of indexes and we have to find out, which ones are really needed and which ones are candidates for removal. </p>
<p>There is a nice feature, called Index Monitoring which switches a flag if the index is used.</p>
<blockquote><p>ALTER INDEX schema.index MONITORING USAGE;</p></blockquote>
<p>Internally, a recursive SQL Statement is executed for every parsing of a SQL:</p>
<blockquote><p>update object_usage set flags=flags+1 where obj#=:1 and bitand(flags, 1)=0</p></blockquote>
<p>To check whether the index was used, you can query the view v$object_usage. Unfortunately, the view definition contains a where clause to list only indexes of the current schema. </p>
<blockquote><p>
   where    io.owner# = userenv(&#8217;SCHEMAID&#8217;)</p></blockquote>
<p>Therefore, you can create a new view or just omit the limitation from the where clause:</p>
<blockquote><p>    create or replace view V$ALL_OBJECT_USAGE<br />
         (OWNER,<br />
         INDEX_NAME,<br />
         TABLE_NAME,<br />
         MONITORING,<br />
         USED,<br />
         START_MONITORING,<br />
         END_MONITORING)<br />
         as<br />
           select u.name, io.name, t.name,<br />
           decode(bitand(i.flags, 65536), 0, &#8216;NO&#8217;, &#8216;YES&#8217;),<br />
           decode(bitand(ou.flags, 1), 0, &#8216;NO&#8217;, &#8216;YES&#8217;),<br />
           ou.start_monitoring,<br />
           ou.end_monitoring<br />
         from sys.user$ u, sys.obj$ io, sys.obj$ t, sys.ind$ i, sys.object_usage ou<br />
         where i.obj# = ou.obj#<br />
         and io.obj# = ou.obj#<br />
         and t.obj# = i.bo#<br />
         and u.user# = io.owner#</p></blockquote>
<p>However, what is less known is that the DBMS_STATS can in some cases manipulate these flags. The issue is tracked with &#8220;Bug 6798910 &#8211; DBMS_STATS or EXPLAIN PLAN trigger index usage monitoring&#8221;. If you are using 10.2.0.4 and you are gathering stats manually with &#8220;CASCADE=>TRUE&#8221;, then the monitoring flag is set to &#8220;YES&#8221;. Obviously, in this case you can not identify candidate indexes for removal.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ora-solutions.net/web/2009/05/12/monitoring-index-usage-not-reliable-in-10204/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Oracle RAC 10.2.0.4 bug when adding/dropping redo log groups</title>
		<link>http://www.ora-solutions.net/web/2009/04/23/oracle-rac-10204-bug-when-addingdropping-redo-log-groups/</link>
		<comments>http://www.ora-solutions.net/web/2009/04/23/oracle-rac-10204-bug-when-addingdropping-redo-log-groups/#comments</comments>
		<pubDate>Thu, 23 Apr 2009 10:23:02 +0000</pubDate>
		<dc:creator>Martin</dc:creator>
				<category><![CDATA[10g]]></category>
		<category><![CDATA[Bugs]]></category>
		<category><![CDATA[MetaLink]]></category>
		<category><![CDATA[Oracle Database]]></category>

		<guid isPermaLink="false">http://www.ora-solutions.net/web/?p=648</guid>
		<description><![CDATA[On the oracle-l list, there was a post about a nasty bug in Oracle RAC 10.2.0.4 which can cause LGWR errors, instance failures and redo log corruptions.
The bug occurs if you add/remove redo log groups on a cluster database, which has some of it´s instances shut down.
More information about this Bug, which is tracked with [...]]]></description>
			<content:encoded><![CDATA[<p>On the oracle-l list, there was a post about a nasty bug in Oracle RAC 10.2.0.4 which can cause LGWR errors, instance failures and redo log corruptions.</p>
<p>The bug occurs if you add/remove redo log groups on a cluster database, which has some of it´s instances shut down.</p>
<p>More information about this Bug, which is tracked with Bug ID 6786022 can be found on MetaLink. There is a patch for 10.2.0.4 and Linux x86-64 available.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ora-solutions.net/web/2009/04/23/oracle-rac-10204-bug-when-addingdropping-redo-log-groups/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ASSM Problem with too low PCTFREE</title>
		<link>http://www.ora-solutions.net/web/2009/04/09/assm-problem-with-too-low-pctfree/</link>
		<comments>http://www.ora-solutions.net/web/2009/04/09/assm-problem-with-too-low-pctfree/#comments</comments>
		<pubDate>Thu, 09 Apr 2009 19:40:22 +0000</pubDate>
		<dc:creator>Martin</dc:creator>
				<category><![CDATA[10g]]></category>
		<category><![CDATA[11g]]></category>
		<category><![CDATA[Bugs]]></category>
		<category><![CDATA[MetaLink]]></category>
		<category><![CDATA[Oracle Database]]></category>

		<guid isPermaLink="false">http://www.ora-solutions.net/web/?p=605</guid>
		<description><![CDATA[During the Hotsos Symposium 2009 Training Day, Jonathan Lewis presented a problem which appears even on current 10g/11g databases. What is especially interesting is how this issue can be diagnosed. I reproduced the problem in 11.1.0.7 and will provide the steps you can use to verify. The problem can be demonstrated best when comparing response [...]]]></description>
			<content:encoded><![CDATA[<p>During the Hotsos Symposium 2009 Training Day, Jonathan Lewis presented a problem which appears even on current 10g/11g databases. What is especially interesting is how this issue can be diagnosed. I reproduced the problem in 11.1.0.7 and will provide the steps you can use to verify. The problem can be demonstrated best when comparing response time of an update statement for 8k blocksize and 16k blocksize. </p>
<ul>
<strong>
<li>8k Blocksize</li>
<p></strong></p>

<div class="wp_syntax"><div class="code"><pre class="oracle11" style="font-family:monospace;">SQL<span style="color: #66cc66;">&gt;</span> <span style="color: #993333; font-weight: bold; text-transform: uppercase;">DROP</span> <span style="color: #993333; font-weight: bold; text-transform: uppercase;">TABLE</span> t1_8k purge;
&nbsp;
SQL<span style="color: #66cc66;">&gt;</span> <span style="color: #993333; font-weight: bold; text-transform: uppercase;">CREATE</span> <span style="color: #993333; font-weight: bold; text-transform: uppercase;">TABLESPACE</span> DEMO8K datafile <span style="color: #993333; font-weight: bold; text-transform: uppercase;">SIZE</span> 128M blocksize <span style="color: #cc66cc;">8192</span>;
&nbsp;
<span style="color: #993333; font-weight: bold; text-transform: uppercase;">TABLESPACE</span> created.
&nbsp;
Elapsed: 00:00:<span style="color: #cc66cc;">07.35</span>
&nbsp;
SQL<span style="color: #66cc66;">&gt;</span> <span style="color: #993333; font-weight: bold; text-transform: uppercase;">CREATE</span> <span style="color: #993333; font-weight: bold; text-transform: uppercase;">TABLE</span> mdecker.t1_8k
<span style="color: #66cc66;">&#40;</span>n1 <span style="color: #993333; font-weight: bold; text-transform: uppercase;">NUMBER</span><span style="color: #66cc66;">,</span>
 n2 <span style="color: #993333; font-weight: bold; text-transform: uppercase;">NUMBER</span><span style="color: #66cc66;">&#41;</span>
 <span style="color: #993333; font-weight: bold; text-transform: uppercase;">TABLESPACE</span> DEMO8K;
&nbsp;
<span style="color: #993333; font-weight: bold; text-transform: uppercase;">TABLE</span> created.
&nbsp;
Elapsed: 00:00:<span style="color: #cc66cc;">00.02</span>
&nbsp;
SQL<span style="color: #66cc66;">&gt;</span> <span style="color: #993333; font-weight: bold; text-transform: uppercase;">INSERT</span> <span style="color: #993333; font-weight: bold; text-transform: uppercase;">INTO</span> t1_8k
<span style="color: #993333; font-weight: bold; text-transform: uppercase;">SELECT</span> <span style="color: #993333; font-weight: bold; text-transform: uppercase;">TRUNC</span><span style="color: #66cc66;">&#40;</span>dbms_random.<span style="color: #993333; font-weight: bold; text-transform: uppercase;">VALUE</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">10000000</span><span style="color: #66cc66;">,</span><span style="color: #cc66cc;">100000000</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span> n1<span style="color: #66cc66;">,</span>
           <span style="color: #993333; font-weight: bold; text-transform: uppercase;">TO_NUMBER</span><span style="color: #66cc66;">&#40;</span><span style="color: #993333; font-weight: bold; text-transform: uppercase;">NULL</span><span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold; text-transform: uppercase;">AS</span> n2
    <span style="color: #993333; font-weight: bold; text-transform: uppercase;">FROM</span> dual
<span style="color: #993333; font-weight: bold; text-transform: uppercase;">CONNECT</span> <span style="color: #993333; font-weight: bold; text-transform: uppercase;">BY</span> <span style="color: #993333; font-weight: bold; text-transform: uppercase;">LEVEL</span> <span style="color: #66cc66;">&lt;=</span> <span style="color: #cc66cc;">500000</span>
<span style="color: #66cc66;">/</span>
&nbsp;
&nbsp;
<span style="color: #cc66cc;">500000</span> <span style="color: #993333; font-weight: bold; text-transform: uppercase;">ROWS</span> created.
&nbsp;
Elapsed: 00:00:<span style="color: #cc66cc;">06.89</span>
&nbsp;
SQL<span style="color: #66cc66;">&gt;</span> <span style="color: #993333; font-weight: bold; text-transform: uppercase;">BEGIN</span> dbms_stats.gather_table_stats<span style="color: #66cc66;">&#40;</span>
        ownname <span style="color: #66cc66;">=&gt;</span> <span style="color: #ff0000;">'MDECKER'</span><span style="color: #66cc66;">,</span>
        tabname <span style="color: #66cc66;">=&gt;</span> <span style="color: #ff0000;">'T1_8K'</span><span style="color: #66cc66;">,</span>
        estimate_percent <span style="color: #66cc66;">=&gt;</span> <span style="color: #cc66cc;">100</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #993333; font-weight: bold; text-transform: uppercase;">END</span>;
<span style="color: #66cc66;">/</span>
&nbsp;
PL<span style="color: #66cc66;">/</span><span style="color: #993333; font-weight: bold; text-transform: uppercase;">SQL</span> <span style="color: #993333; font-weight: bold; text-transform: uppercase;">PROCEDURE</span> successfully completed.
&nbsp;
Elapsed: 00:00:<span style="color: #cc66cc;">02.13</span>
&nbsp;
SQL<span style="color: #66cc66;">&gt;</span> <span style="color: #993333; font-weight: bold; text-transform: uppercase;">SELECT</span> num_rows<span style="color: #66cc66;">,</span>blocks <span style="color: #993333; font-weight: bold; text-transform: uppercase;">FROM</span> dba_tables <span style="color: #993333; font-weight: bold; text-transform: uppercase;">WHERE</span> table_name <span style="color: #66cc66;">=</span> <span style="color: #ff0000;">'T1_8K'</span>;
&nbsp;
  NUM_ROWS     BLOCKS
<span style="color: #808080; font-style: italic;">---------- ----------</span>
    <span style="color: #cc66cc;">500000</span>        <span style="color: #cc66cc;">874</span>
&nbsp;
Elapsed: 00:00:<span style="color: #cc66cc;">00.15</span>
SQL<span style="color: #66cc66;">&gt;</span> <span style="color: #993333; font-weight: bold; text-transform: uppercase;">UPDATE</span> t1_8k <span style="color: #993333; font-weight: bold; text-transform: uppercase;">SET</span> n2 <span style="color: #66cc66;">=</span> n1;
&nbsp;
<span style="color: #cc66cc;">500000</span> <span style="color: #993333; font-weight: bold; text-transform: uppercase;">ROWS</span> updated.
&nbsp;
Elapsed: 00:01:<span style="color: #cc66cc;">09.04</span>
SQL<span style="color: #66cc66;">&gt;</span> <span style="color: #993333; font-weight: bold; text-transform: uppercase;">COMMIT</span>;</pre></div></div>

<p><strong>
<li>16k Blocksize</li>
<p></strong></p>

<div class="wp_syntax"><div class="code"><pre class="oracle11" style="font-family:monospace;">SQL<span style="color: #66cc66;">&gt;</span> <span style="color: #993333; font-weight: bold; text-transform: uppercase;">CREATE</span> <span style="color: #993333; font-weight: bold; text-transform: uppercase;">TABLESPACE</span> DEMO16K datafile <span style="color: #993333; font-weight: bold; text-transform: uppercase;">SIZE</span> 128M blocksize <span style="color: #cc66cc;">16384</span>;
&nbsp;
<span style="color: #993333; font-weight: bold; text-transform: uppercase;">TABLESPACE</span> created.
&nbsp;
Elapsed: 00:00:<span style="color: #cc66cc;">14.75</span>
&nbsp;
SQL<span style="color: #66cc66;">&gt;</span> <span style="color: #993333; font-weight: bold; text-transform: uppercase;">CREATE</span> <span style="color: #993333; font-weight: bold; text-transform: uppercase;">TABLE</span> mdecker.t1_16k
<span style="color: #66cc66;">&#40;</span>n1 <span style="color: #993333; font-weight: bold; text-transform: uppercase;">NUMBER</span><span style="color: #66cc66;">,</span>
 n2 <span style="color: #993333; font-weight: bold; text-transform: uppercase;">NUMBER</span><span style="color: #66cc66;">&#41;</span>
 <span style="color: #993333; font-weight: bold; text-transform: uppercase;">TABLESPACE</span> DEMO16K;
&nbsp;
<span style="color: #993333; font-weight: bold; text-transform: uppercase;">TABLE</span> created.
&nbsp;
Elapsed: 00:00:<span style="color: #cc66cc;">00.03</span>
&nbsp;
SQL<span style="color: #66cc66;">&gt;</span> <span style="color: #993333; font-weight: bold; text-transform: uppercase;">INSERT</span> <span style="color: #993333; font-weight: bold; text-transform: uppercase;">INTO</span> t1_16k
<span style="color: #993333; font-weight: bold; text-transform: uppercase;">SELECT</span> <span style="color: #993333; font-weight: bold; text-transform: uppercase;">TRUNC</span><span style="color: #66cc66;">&#40;</span>dbms_random.<span style="color: #993333; font-weight: bold; text-transform: uppercase;">VALUE</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">10000000</span><span style="color: #66cc66;">,</span><span style="color: #cc66cc;">100000000</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span> n1<span style="color: #66cc66;">,</span>
           <span style="color: #993333; font-weight: bold; text-transform: uppercase;">TO_NUMBER</span><span style="color: #66cc66;">&#40;</span><span style="color: #993333; font-weight: bold; text-transform: uppercase;">NULL</span><span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold; text-transform: uppercase;">AS</span> n2
    <span style="color: #993333; font-weight: bold; text-transform: uppercase;">FROM</span> dual
<span style="color: #993333; font-weight: bold; text-transform: uppercase;">CONNECT</span> <span style="color: #993333; font-weight: bold; text-transform: uppercase;">BY</span> <span style="color: #993333; font-weight: bold; text-transform: uppercase;">LEVEL</span> <span style="color: #66cc66;">&lt;=</span> <span style="color: #cc66cc;">500000</span>
<span style="color: #66cc66;">/</span>  
&nbsp;
&nbsp;
<span style="color: #cc66cc;">500000</span> <span style="color: #993333; font-weight: bold; text-transform: uppercase;">ROWS</span> created.
&nbsp;
Elapsed: 00:00:<span style="color: #cc66cc;">05.51</span>
SQL<span style="color: #66cc66;">&gt;</span> <span style="color: #993333; font-weight: bold; text-transform: uppercase;">BEGIN</span> dbms_stats.gather_table_stats<span style="color: #66cc66;">&#40;</span>
        ownname <span style="color: #66cc66;">=&gt;</span> <span style="color: #ff0000;">'MDECKER'</span><span style="color: #66cc66;">,</span>
        tabname <span style="color: #66cc66;">=&gt;</span> <span style="color: #ff0000;">'T1_16K'</span><span style="color: #66cc66;">,</span>
        estimate_percent <span style="color: #66cc66;">=&gt;</span> <span style="color: #cc66cc;">100</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #993333; font-weight: bold; text-transform: uppercase;">END</span>;
<span style="color: #66cc66;">/</span>  
&nbsp;
PL<span style="color: #66cc66;">/</span><span style="color: #993333; font-weight: bold; text-transform: uppercase;">SQL</span> <span style="color: #993333; font-weight: bold; text-transform: uppercase;">PROCEDURE</span> successfully completed.
&nbsp;
Elapsed: 00:00:<span style="color: #cc66cc;">01.78</span>
SQL<span style="color: #66cc66;">&gt;</span> <span style="color: #993333; font-weight: bold; text-transform: uppercase;">SELECT</span> num_rows<span style="color: #66cc66;">,</span>blocks <span style="color: #993333; font-weight: bold; text-transform: uppercase;">FROM</span> dba_tables <span style="color: #993333; font-weight: bold; text-transform: uppercase;">WHERE</span> table_name <span style="color: #66cc66;">=</span> <span style="color: #ff0000;">'T1_16K'</span>;
&nbsp;
  NUM_ROWS     BLOCKS
<span style="color: #808080; font-style: italic;">---------- ----------</span>
    <span style="color: #cc66cc;">500000</span>        <span style="color: #cc66cc;">436</span>
&nbsp;
Elapsed: 00:00:<span style="color: #cc66cc;">00.07</span>
&nbsp;
SQL<span style="color: #66cc66;">&gt;</span>  <span style="color: #993333; font-weight: bold; text-transform: uppercase;">UPDATE</span> t1_16k <span style="color: #993333; font-weight: bold; text-transform: uppercase;">SET</span> n2 <span style="color: #66cc66;">=</span> n1;
&nbsp;
<span style="color: #cc66cc;">500000</span> <span style="color: #993333; font-weight: bold; text-transform: uppercase;">ROWS</span> updated.
&nbsp;
Elapsed: 00:<span style="color: #cc66cc;">20</span>:<span style="color: #cc66cc;">20.89</span></pre></div></div>

<p>As you can see, the update statement for the 8k blocksize table took around 69 seconds whereas the same update for the table in the 16k tablespace took more than 20 minutes. When executing oradebug short_stack, you can see that for the 16k update, the stacktrace is similar for many executions. So, a lot of time is spent in the kernel functions ktspfsrch() and ktspscan_bmb().</p>
<p><code><br />
SQL&gt; oradebug setospid 23668<br />
Oracle pid: 18, Unix process pid: 23668, image: oracle@ora-vm1.intra (TNS V1-V3)<br />
SQL&gt; oradebug short_stack<br />
.....ktspfsrch()+559&lt;-ktspscan_bmb()+315 .....<br />
SQL&gt; oradebug short_stack<br />
.....ktspfsrch()+559&lt;-ktspscan_bmb()+315 .....<br />
SQL&gt; oradebug short_stack<br />
.....ktspfsrch()+559&lt;-ktspscan_bmb()+315 .....<br />
</code></p>
<p>It is important to understand that the problem is not necessarily related to the blocksize, but to the PCTFREE value. More information about this topic can be found here:</p>
<p><a href="http://structureddata.org/files/jl_test_case.html">http://structureddata.org/files/jl_test_case.html</a><br />
<a href="http://structureddata.org/2008/09/08/understanding-performance/">http://structureddata.org/2008/09/08/understanding-performance/</a><br />
<a href="http://www.oraclealchemist.com/oracle/hey-guys-does-size-matter/">http://www.oraclealchemist.com/oracle/hey-guys-does-size-matter/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.ora-solutions.net/web/2009/04/09/assm-problem-with-too-low-pctfree/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Intelligent (aka adaptive) Cursor Sharing Problem</title>
		<link>http://www.ora-solutions.net/web/2009/03/12/intelligent-aka-adaptive-cursor-sharing-problem/</link>
		<comments>http://www.ora-solutions.net/web/2009/03/12/intelligent-aka-adaptive-cursor-sharing-problem/#comments</comments>
		<pubDate>Thu, 12 Mar 2009 05:01:40 +0000</pubDate>
		<dc:creator>Martin</dc:creator>
				<category><![CDATA[11g]]></category>
		<category><![CDATA[Bugs]]></category>
		<category><![CDATA[MetaLink]]></category>
		<category><![CDATA[Oracle Database]]></category>

		<guid isPermaLink="false">http://www.ora-solutions.net/web/?p=586</guid>
		<description><![CDATA[Today, at the last day of Hotsos Symposium 2009 Ric van Dyke presented on &#8220;Intelligent (aka adaptive) Cursor Sharing&#8221;, a new feature of Oracle Database 11g. The feature was created to fix the shortcomings of bind peeking on columns with histograms. Tom Kyte presented a few years ago on this topic when he talked about [...]]]></description>
			<content:encoded><![CDATA[<p>Today, at the last day of <a href="http://www.hotsos.com/sym09.html">Hotsos Symposium 2009</a> Ric van Dyke presented on &#8220;Intelligent (aka adaptive) Cursor Sharing&#8221;, a new feature of Oracle Database 11g. The feature was created to fix the shortcomings of bind peeking on columns with histograms. Tom Kyte presented a few years ago on this topic when he talked about the impact of the wheather on Oracle database performance.</p>
<p>During the very interesting presentation Ric presented with a demo how this feature works but also showed a nasty side effect. He tested it on a million row table with a column &#8220;object type&#8221;, which was skewed. He bound several different values to the object_type bind variable causing 2 different execution plans to be used for the same sql_id. The problem with it was that he ended up with dozens of child cursors showing V$SQL.IS_SHARABLE => N. </p>
<p>It was not known whether this is a bug or whether the whole concept is flawed. I searched on metalink and found the appropriate document:</p>
<blockquote><p>
<strong>Bug 6644714 &#8211; High number of child cursors with adaptive cursor sharing<br />
</strong>This issue is fixed in	</p>
<p>    * 11.2 (Future Release)<br />
    * 11.1.0.7 (Server Patch Set)<br />
Lots of child cursors may be produced with adaptive cursor sharing enabled,<br />
sometimes with overlapping or same bind value selectivity ranges (in v$sql_cs_selectivity).<br />
This problem shows as LOAD_OPTIMIZER_STATS=&#8217;Y&#8217; for many of the cursors in V$SQL_SHARED_CURSOR.</p>
<p> &#8211; and &#8211; </p>
<p><strong>Bug 7213010 &#8211; Adaptive cursor sharing generates lots of child cursors</strong></p>
<p>This issue is fixed in	</p>
<p>    * 11.2 (Future Release)<br />
    * 11.1.0.7 (Server Patch Set) </p>
<p>Lots of child cursors may be produced for a query with bind variables<br />
appearing in at least two simple relational predicates<br />
(eg. col <op> :b).  </p>
<p>v$sql_cs_selectivity shows that there are multiple equivalent / overlapping<br />
ranges for a single cursor.  The number of ranges gets bigger and bigger<br />
as the query is run more times.
</p></blockquote>
<p>I then tried to verify if the problem indeed is gone in 11.1.0.7 and found out, that it isn´t.</p>
<p>Here is my testcase:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
</pre></td><td class="code"><pre class="sql" style="font-family:monospace;">SQL<span style="color: #66cc66;">&gt;</span> @<span style="color: #66cc66;">/</span>tmp<span style="color: #66cc66;">/</span>setup<span style="color: #66cc66;">.</span>sql
Connected<span style="color: #66cc66;">.</span>
SQL<span style="color: #66cc66;">&gt;</span> <span style="color: #993333; font-weight: bold;">DROP</span> <span style="color: #993333; font-weight: bold;">TABLE</span> tab1 purge;
&nbsp;
<span style="color: #993333; font-weight: bold;">TABLE</span> dropped<span style="color: #66cc66;">.</span>
&nbsp;
SQL<span style="color: #66cc66;">&gt;</span> <span style="color: #993333; font-weight: bold;">CREATE</span> <span style="color: #993333; font-weight: bold;">TABLE</span> tab1 <span style="color: #66cc66;">&#40;</span>a int<span style="color: #66cc66;">,</span>
  <span style="color: #cc66cc;">2</span>                     b varchar2<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">20</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">,</span>
  <span style="color: #cc66cc;">3</span>                                     padding varchar2<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">200</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
  <span style="color: #cc66cc;">4</span>  tablespace USERS;
&nbsp;
<span style="color: #993333; font-weight: bold;">TABLE</span> created<span style="color: #66cc66;">.</span>
&nbsp;
SQL<span style="color: #66cc66;">&gt;</span>
SQL<span style="color: #66cc66;">&gt;</span> <span style="color: #993333; font-weight: bold;">DROP</span> sequence myid;
&nbsp;
Sequence dropped<span style="color: #66cc66;">.</span>
&nbsp;
SQL<span style="color: #66cc66;">&gt;</span> <span style="color: #993333; font-weight: bold;">CREATE</span> sequence myid cache <span style="color: #cc66cc;">1000</span>;
&nbsp;
Sequence created<span style="color: #66cc66;">.</span>
&nbsp;
SQL<span style="color: #66cc66;">&gt;</span>
SQL<span style="color: #66cc66;">&gt;</span> begin
  <span style="color: #cc66cc;">2</span>  <span style="color: #993333; font-weight: bold;">FOR</span> i <span style="color: #993333; font-weight: bold;">IN</span> 1<span style="color: #66cc66;">..</span>100000
  <span style="color: #cc66cc;">3</span>  loop
  <span style="color: #cc66cc;">4</span>          <span style="color: #993333; font-weight: bold;">INSERT</span> <span style="color: #993333; font-weight: bold;">INTO</span> tab1 <span style="color: #993333; font-weight: bold;">VALUES</span> <span style="color: #66cc66;">&#40;</span>myid<span style="color: #66cc66;">.</span><span style="color: #993333; font-weight: bold;">NEXTVAL</span><span style="color: #66cc66;">,</span>
  <span style="color: #cc66cc;">5</span>                                                           <span style="color: #ff0000;">'AAAAAAAAAA'</span><span style="color: #66cc66;">,</span>
  <span style="color: #cc66cc;">6</span>                                                           rpad<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'*'</span><span style="color: #66cc66;">,</span><span style="color: #cc66cc;">200</span><span style="color: #66cc66;">,</span><span style="color: #ff0000;">'*'</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;
  <span style="color: #cc66cc;">7</span>  end loop;
  <span style="color: #cc66cc;">8</span>
  <span style="color: #cc66cc;">9</span>  <span style="color: #993333; font-weight: bold;">FOR</span> i <span style="color: #993333; font-weight: bold;">IN</span> 1<span style="color: #66cc66;">..</span>1000
 <span style="color: #cc66cc;">10</span>  loop
 <span style="color: #cc66cc;">11</span>          <span style="color: #993333; font-weight: bold;">INSERT</span> <span style="color: #993333; font-weight: bold;">INTO</span> tab1 <span style="color: #993333; font-weight: bold;">VALUES</span> <span style="color: #66cc66;">&#40;</span>myid<span style="color: #66cc66;">.</span><span style="color: #993333; font-weight: bold;">NEXTVAL</span><span style="color: #66cc66;">,</span>
 <span style="color: #cc66cc;">12</span>                                                           <span style="color: #ff0000;">'BBBBBBBBBB'</span><span style="color: #66cc66;">,</span>
 <span style="color: #cc66cc;">13</span>                                                           rpad<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'*'</span><span style="color: #66cc66;">,</span><span style="color: #cc66cc;">200</span><span style="color: #66cc66;">,</span><span style="color: #ff0000;">'*'</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;
 <span style="color: #cc66cc;">14</span>  end loop;
 <span style="color: #cc66cc;">15</span>
 <span style="color: #cc66cc;">16</span>  <span style="color: #993333; font-weight: bold;">FOR</span> i <span style="color: #993333; font-weight: bold;">IN</span> 1<span style="color: #66cc66;">..</span>1000
 <span style="color: #cc66cc;">17</span>  loop
 <span style="color: #cc66cc;">18</span>          <span style="color: #993333; font-weight: bold;">INSERT</span> <span style="color: #993333; font-weight: bold;">INTO</span> tab1 <span style="color: #993333; font-weight: bold;">VALUES</span> <span style="color: #66cc66;">&#40;</span>myid<span style="color: #66cc66;">.</span><span style="color: #993333; font-weight: bold;">NEXTVAL</span><span style="color: #66cc66;">,</span>
 <span style="color: #cc66cc;">19</span>                                                           <span style="color: #ff0000;">'CCCCCCCCCC'</span><span style="color: #66cc66;">,</span>
 <span style="color: #cc66cc;">20</span>                                                           rpad<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'*'</span><span style="color: #66cc66;">,</span><span style="color: #cc66cc;">200</span><span style="color: #66cc66;">,</span><span style="color: #ff0000;">'*'</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;
 <span style="color: #cc66cc;">21</span>  end loop;
 <span style="color: #cc66cc;">22</span>
 <span style="color: #cc66cc;">23</span>  <span style="color: #993333; font-weight: bold;">FOR</span> i <span style="color: #993333; font-weight: bold;">IN</span> 1<span style="color: #66cc66;">..</span>100
 <span style="color: #cc66cc;">24</span>  loop
 <span style="color: #cc66cc;">25</span>          <span style="color: #993333; font-weight: bold;">INSERT</span> <span style="color: #993333; font-weight: bold;">INTO</span> tab1 <span style="color: #993333; font-weight: bold;">VALUES</span> <span style="color: #66cc66;">&#40;</span>myid<span style="color: #66cc66;">.</span><span style="color: #993333; font-weight: bold;">NEXTVAL</span><span style="color: #66cc66;">,</span>
 <span style="color: #cc66cc;">26</span>                                                           <span style="color: #ff0000;">'DDDDDDDDDD'</span><span style="color: #66cc66;">,</span>
 <span style="color: #cc66cc;">27</span>                                                           rpad<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'*'</span><span style="color: #66cc66;">,</span><span style="color: #cc66cc;">200</span><span style="color: #66cc66;">,</span><span style="color: #ff0000;">'*'</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;
 <span style="color: #cc66cc;">28</span>  end loop;
 <span style="color: #cc66cc;">29</span>
 <span style="color: #cc66cc;">30</span>  <span style="color: #993333; font-weight: bold;">FOR</span> i <span style="color: #993333; font-weight: bold;">IN</span> 1<span style="color: #66cc66;">..</span>10
 <span style="color: #cc66cc;">31</span>  loop
 <span style="color: #cc66cc;">32</span>          <span style="color: #993333; font-weight: bold;">INSERT</span> <span style="color: #993333; font-weight: bold;">INTO</span> tab1 <span style="color: #993333; font-weight: bold;">VALUES</span> <span style="color: #66cc66;">&#40;</span>myid<span style="color: #66cc66;">.</span><span style="color: #993333; font-weight: bold;">NEXTVAL</span><span style="color: #66cc66;">,</span>
 <span style="color: #cc66cc;">33</span>                                                           <span style="color: #ff0000;">'EEEEEEEEEE'</span><span style="color: #66cc66;">,</span>
 <span style="color: #cc66cc;">34</span>                                                           rpad<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'*'</span><span style="color: #66cc66;">,</span><span style="color: #cc66cc;">200</span><span style="color: #66cc66;">,</span><span style="color: #ff0000;">'*'</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;
 <span style="color: #cc66cc;">35</span>  end loop;
 <span style="color: #cc66cc;">36</span>
 <span style="color: #cc66cc;">37</span>  <span style="color: #993333; font-weight: bold;">INSERT</span> <span style="color: #993333; font-weight: bold;">INTO</span> tab1 <span style="color: #993333; font-weight: bold;">VALUES</span> <span style="color: #66cc66;">&#40;</span>myid<span style="color: #66cc66;">.</span><span style="color: #993333; font-weight: bold;">NEXTVAL</span><span style="color: #66cc66;">,</span>
 <span style="color: #cc66cc;">38</span>                                                           <span style="color: #ff0000;">'FFFFFFFFFF'</span><span style="color: #66cc66;">,</span>
 <span style="color: #cc66cc;">39</span>                                                           rpad<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'*'</span><span style="color: #66cc66;">,</span><span style="color: #cc66cc;">200</span><span style="color: #66cc66;">,</span><span style="color: #ff0000;">'*'</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;
 <span style="color: #cc66cc;">40</span>
 <span style="color: #cc66cc;">41</span>  commit;
 <span style="color: #cc66cc;">42</span>  end;
 <span style="color: #cc66cc;">43</span>  <span style="color: #66cc66;">/</span>
&nbsp;
PL<span style="color: #66cc66;">/</span>SQL procedure successfully completed<span style="color: #66cc66;">.</span>
&nbsp;
SQL<span style="color: #66cc66;">&gt;</span>
SQL<span style="color: #66cc66;">&gt;</span> <span style="color: #993333; font-weight: bold;">CREATE</span> <span style="color: #993333; font-weight: bold;">INDEX</span> tab1_idx1 <span style="color: #993333; font-weight: bold;">ON</span> tab1 <span style="color: #66cc66;">&#40;</span>b<span style="color: #66cc66;">&#41;</span>;
&nbsp;
<span style="color: #993333; font-weight: bold;">INDEX</span> created<span style="color: #66cc66;">.</span>
&nbsp;
SQL<span style="color: #66cc66;">&gt;</span>
SQL<span style="color: #66cc66;">&gt;</span> begin dbms_stats<span style="color: #66cc66;">.</span>gather_table_stats<span style="color: #66cc66;">&#40;</span>ownname <span style="color: #66cc66;">=&gt;</span> <span style="color: #ff0000;">'MDECKER'</span><span style="color: #66cc66;">,</span>
  <span style="color: #cc66cc;">2</span>                                          tabname <span style="color: #66cc66;">=&gt;</span> <span style="color: #ff0000;">'TAB1'</span><span style="color: #66cc66;">,</span>
  <span style="color: #cc66cc;">3</span>                                          method_opt <span style="color: #66cc66;">=&gt;</span><span style="color: #ff0000;">'FOR ALL COLUMNS SIZE 254'</span><span style="color: #66cc66;">,</span>
  <span style="color: #cc66cc;">4</span>                                          cascade<span style="color: #66cc66;">=&gt;</span> TRUE<span style="color: #66cc66;">,</span>
  <span style="color: #cc66cc;">5</span>                                          estimate_percent <span style="color: #66cc66;">=&gt;</span> <span style="color: #cc66cc;">100</span><span style="color: #66cc66;">,</span>
  <span style="color: #cc66cc;">6</span>                                          no_invalidate <span style="color: #66cc66;">=&gt;</span> FALSE<span style="color: #66cc66;">&#41;</span>;
  <span style="color: #cc66cc;">7</span>  end;
  <span style="color: #cc66cc;">8</span>  <span style="color: #66cc66;">/</span>
&nbsp;
PL<span style="color: #66cc66;">/</span>SQL procedure successfully completed<span style="color: #66cc66;">.</span>
&nbsp;
SQL<span style="color: #66cc66;">&gt;</span>
SQL<span style="color: #66cc66;">&gt;</span> <span style="color: #993333; font-weight: bold;">SET</span> <span style="color: #993333; font-weight: bold;">LINES</span> <span style="color: #cc66cc;">300</span>
SQL<span style="color: #66cc66;">&gt;</span> col table_name format a10
SQL<span style="color: #66cc66;">&gt;</span> col owner format a8
SQL<span style="color: #66cc66;">&gt;</span> <span style="color: #993333; font-weight: bold;">SELECT</span> owner<span style="color: #66cc66;">,</span> table_name<span style="color: #66cc66;">,</span>num_rows<span style="color: #66cc66;">,</span> blocks<span style="color: #66cc66;">,</span> round<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#40;</span>blocks<span style="color: #66cc66;">*</span><span style="color: #cc66cc;">8192</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">/</span><span style="color: #cc66cc;">1024</span><span style="color: #66cc66;">/</span><span style="color: #cc66cc;">1024</span><span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">AS</span> MB
  <span style="color: #cc66cc;">2</span>  <span style="color: #993333; font-weight: bold;">FROM</span> dba_tables <span style="color: #993333; font-weight: bold;">WHERE</span> table_name <span style="color: #66cc66;">=</span> <span style="color: #ff0000;">'TAB1'</span> <span style="color: #993333; font-weight: bold;">AND</span> owner <span style="color: #66cc66;">=</span> <span style="color: #ff0000;">'MDECKER'</span>;
&nbsp;
OWNER    TABLE_NAME   NUM_ROWS     BLOCKS         MB
<span style="color: #808080; font-style: italic;">-------- ---------- ---------- ---------- ----------</span>
MDECKER  TAB1           <span style="color: #cc66cc;">102111</span>       <span style="color: #cc66cc;">3268</span>         <span style="color: #cc66cc;">26</span>
&nbsp;
SQL<span style="color: #66cc66;">&gt;</span>
SQL<span style="color: #66cc66;">&gt;</span> prompt <span style="color: #ff0000;">&quot;Press Enter to continue&quot;</span>
<span style="color: #ff0000;">&quot;Press Enter to continue&quot;</span>
SQL<span style="color: #66cc66;">&gt;</span> pause
&nbsp;
SQL<span style="color: #66cc66;">&gt;</span>
SQL<span style="color: #66cc66;">&gt;</span> <span style="color: #808080; font-style: italic;">/*
SQL&gt; OWNER       TABLE_NAME   NUM_ROWS  BLOCKS         MB
SQL&gt; -------- ---------- ---------- ---------- ----------
SQL&gt; MDECKER  TAB1           102111       3268         26
SQL&gt;
SQL&gt; */</span>
SQL<span style="color: #66cc66;">&gt;</span>
SQL<span style="color: #66cc66;">&gt;</span>
SQL<span style="color: #66cc66;">&gt;</span>
SQL<span style="color: #66cc66;">&gt;</span> <span style="color: #993333; font-weight: bold;">SELECT</span> b <span style="color: #66cc66;">,</span> count<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">*</span><span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">FROM</span> mdecker<span style="color: #66cc66;">.</span>tab1 <span style="color: #993333; font-weight: bold;">GROUP</span> <span style="color: #993333; font-weight: bold;">BY</span> b <span style="color: #993333; font-weight: bold;">ORDER</span> <span style="color: #993333; font-weight: bold;">BY</span> <span style="color: #cc66cc;">1</span> <span style="color: #993333; font-weight: bold;">DESC</span>;
&nbsp;
B                      COUNT<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">*</span><span style="color: #66cc66;">&#41;</span>
<span style="color: #808080; font-style: italic;">-------------------- ----------</span>
FFFFFFFFFF                    <span style="color: #cc66cc;">1</span>
EEEEEEEEEE                   <span style="color: #cc66cc;">10</span>
DDDDDDDDDD                  <span style="color: #cc66cc;">100</span>
CCCCCCCCCC                 <span style="color: #cc66cc;">1000</span>
BBBBBBBBBB                 <span style="color: #cc66cc;">1000</span>
AAAAAAAAAA               <span style="color: #cc66cc;">100000</span>
&nbsp;
<span style="color: #cc66cc;">6</span> rows selected<span style="color: #66cc66;">.</span>
&nbsp;
SQL<span style="color: #66cc66;">&gt;</span>
SQL<span style="color: #66cc66;">&gt;</span> <span style="color: #808080; font-style: italic;">/*
SQL&gt; B                      COUNT(*)
SQL&gt; -------------------- ----------
SQL&gt; FFFFFFFFFF                    1
SQL&gt; EEEEEEEEEE                   10
SQL&gt; DDDDDDDDDD                  100
SQL&gt; CCCCCCCCCC                 1000
SQL&gt; BBBBBBBBBB                 1000
SQL&gt; AAAAAAAAAA               100000
SQL&gt;
SQL&gt; 6 rows selected.
SQL&gt;
SQL&gt; */</span>
SQL<span style="color: #66cc66;">&gt;</span>
SQL<span style="color: #66cc66;">&gt;</span> prompt <span style="color: #ff0000;">&quot;Press Enter to continue&quot;</span>
<span style="color: #ff0000;">&quot;Press Enter to continue&quot;</span>
SQL<span style="color: #66cc66;">&gt;</span> pause
&nbsp;
SQL<span style="color: #66cc66;">&gt;</span> <span style="color: #993333; font-weight: bold;">SELECT</span> num_buckets<span style="color: #66cc66;">,</span> histogram <span style="color: #993333; font-weight: bold;">FROM</span> dba_tab_col_statistics <span style="color: #993333; font-weight: bold;">WHERE</span> table_name <span style="color: #66cc66;">=</span> <span style="color: #ff0000;">'TAB1'</span> <span style="color: #993333; font-weight: bold;">AND</span> column_name <span style="color: #66cc66;">=</span> <span style="color: #ff0000;">'B'</span>;
&nbsp;
NUM_BUCKETS HISTOGRAM
<span style="color: #808080; font-style: italic;">----------- ---------------</span>
          <span style="color: #cc66cc;">6</span> FREQUENCY
&nbsp;
SQL<span style="color: #66cc66;">&gt;</span>
SQL<span style="color: #66cc66;">&gt;</span> <span style="color: #808080; font-style: italic;">/*
SQL&gt; NUM_BUCKETS HISTOGRAM
SQL&gt; ----------- ---------------
SQL&gt;           6 FREQUENCY
SQL&gt; */</span>
SQL<span style="color: #66cc66;">&gt;</span>
SQL<span style="color: #66cc66;">&gt;</span>
SQL<span style="color: #66cc66;">&gt;</span>
SQL<span style="color: #66cc66;">&gt;</span>
SQL<span style="color: #66cc66;">&gt;</span>
SQL<span style="color: #66cc66;">&gt;</span> <span style="color: #993333; font-weight: bold;">SHOW</span> user
USER <span style="color: #993333; font-weight: bold;">IS</span> <span style="color: #ff0000;">&quot;MDECKER&quot;</span>
SQL<span style="color: #66cc66;">&gt;</span> @<span style="color: #66cc66;">/</span>tmp<span style="color: #66cc66;">/</span>sql1<span style="color: #66cc66;">.</span>txt
SQL<span style="color: #66cc66;">&gt;</span> <span style="color: #993333; font-weight: bold;">SET</span> <span style="color: #993333; font-weight: bold;">LINES</span> <span style="color: #cc66cc;">300</span>
SQL<span style="color: #66cc66;">&gt;</span> <span style="color: #993333; font-weight: bold;">SET</span> echo <span style="color: #993333; font-weight: bold;">ON</span>
SQL<span style="color: #66cc66;">&gt;</span> <span style="color: #993333; font-weight: bold;">SET</span> pages <span style="color: #cc66cc;">10000</span>
SQL<span style="color: #66cc66;">&gt;</span> col bind format a120
SQL<span style="color: #66cc66;">&gt;</span> prompt <span style="color: #ff0000;">&quot;Press enter to run&quot;</span>
<span style="color: #ff0000;">&quot;Press enter to run&quot;</span>
SQL<span style="color: #66cc66;">&gt;</span> pause
&nbsp;
SQL<span style="color: #66cc66;">&gt;</span>
SQL<span style="color: #66cc66;">&gt;</span> variable myvar varchar2<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">20</span><span style="color: #66cc66;">&#41;</span>
SQL<span style="color: #66cc66;">&gt;</span> exec :myvar :<span style="color: #66cc66;">=</span> <span style="color: #ff0000;">'AAAAAAAAAA'</span>;
&nbsp;
PL<span style="color: #66cc66;">/</span>SQL procedure successfully completed<span style="color: #66cc66;">.</span>
&nbsp;
SQL<span style="color: #66cc66;">&gt;</span> <span style="color: #993333; font-weight: bold;">SET</span> termout off
SQL<span style="color: #66cc66;">&gt;</span> <span style="color: #993333; font-weight: bold;">SELECT</span> <span style="color: #66cc66;">*</span> <span style="color: #993333; font-weight: bold;">FROM</span> <span style="color: #993333; font-weight: bold;">TABLE</span><span style="color: #66cc66;">&#40;</span>dbms_xplan<span style="color: #66cc66;">.</span>display_cursor<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
PLAN_TABLE_OUTPUT
<span style="color: #808080; font-style: italic;">-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------   -----------------------------------------------------------------</span>
SQL_ID  fhtgpcv2m2j4s<span style="color: #66cc66;">,</span> child number <span style="color: #cc66cc;">0</span>
<span style="color: #808080; font-style: italic;">-------------------------------------</span>
<span style="color: #993333; font-weight: bold;">SELECT</span> <span style="color: #808080; font-style: italic;">/* MD_TESTCASE */</span> <span style="color: #66cc66;">*</span> <span style="color: #993333; font-weight: bold;">FROM</span> tab1 <span style="color: #993333; font-weight: bold;">WHERE</span> b <span style="color: #66cc66;">=</span> :myvar
&nbsp;
Plan hash value: <span style="color: #cc66cc;">2211052296</span>
&nbsp;
<span style="color: #808080; font-style: italic;">--------------------------------------------------------------------------</span>
<span style="color: #66cc66;">|</span> Id  <span style="color: #66cc66;">|</span> Operation         <span style="color: #66cc66;">|</span> Name <span style="color: #66cc66;">|</span> Rows  <span style="color: #66cc66;">|</span> Bytes <span style="color: #66cc66;">|</span> Cost <span style="color: #66cc66;">&#40;</span>%CPU<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">|</span> Time     <span style="color: #66cc66;">|</span>
<span style="color: #808080; font-style: italic;">--------------------------------------------------------------------------</span>
<span style="color: #66cc66;">|</span>   <span style="color: #cc66cc;">0</span> <span style="color: #66cc66;">|</span> <span style="color: #993333; font-weight: bold;">SELECT</span> STATEMENT  <span style="color: #66cc66;">|</span>      <span style="color: #66cc66;">|</span>       <span style="color: #66cc66;">|</span>       <span style="color: #66cc66;">|</span>   <span style="color: #cc66cc;">889</span> <span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">100</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">|</span>          <span style="color: #66cc66;">|</span>
<span style="color: #66cc66;">|*</span>  <span style="color: #cc66cc;">1</span> <span style="color: #66cc66;">|</span>  <span style="color: #993333; font-weight: bold;">TABLE</span> ACCESS <span style="color: #993333; font-weight: bold;">FULL</span><span style="color: #66cc66;">|</span> TAB1 <span style="color: #66cc66;">|</span>   100K<span style="color: #66cc66;">|</span>    20M<span style="color: #66cc66;">|</span>   <span style="color: #cc66cc;">889</span>   <span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">|</span> 00:00:<span style="color: #cc66cc;">11</span> <span style="color: #66cc66;">|</span>
<span style="color: #808080; font-style: italic;">--------------------------------------------------------------------------</span>
&nbsp;
Predicate Information <span style="color: #66cc66;">&#40;</span><span style="color: #993333; font-weight: bold;">IDENTIFIED</span> <span style="color: #993333; font-weight: bold;">BY</span> operation id<span style="color: #66cc66;">&#41;</span>:
<span style="color: #808080; font-style: italic;">---------------------------------------------------</span>
&nbsp;
   <span style="color: #cc66cc;">1</span> <span style="color: #66cc66;">-</span> filter<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;B&quot;</span><span style="color: #66cc66;">=</span>:MYVAR<span style="color: #66cc66;">&#41;</span>
&nbsp;
&nbsp;
<span style="color: #cc66cc;">18</span> rows selected<span style="color: #66cc66;">.</span>
&nbsp;
SQL<span style="color: #66cc66;">&gt;</span> <span style="color: #993333; font-weight: bold;">SELECT</span> sql_id<span style="color: #66cc66;">,</span> is_obsolete<span style="color: #66cc66;">,</span> is_bind_sensitive<span style="color: #66cc66;">,</span> is_bind_aware<span style="color: #66cc66;">,</span> is_shareable<span style="color: #66cc66;">,</span> dbms_sqltune<span style="color: #66cc66;">.</span>extract_binds<span style="color: #66cc66;">&#40;</span>bind_data<span style="color: #66cc66;">&#41;</span> bind<span style="color: #66cc66;">,</span> plan_hash_value<span style="color: #66cc66;">,</span> child_number <span style="color: #993333; font-weight: bold;">FROM</span>
  <span style="color: #cc66cc;">2</span>   v$sql <span style="color: #993333; font-weight: bold;">WHERE</span> sql_id <span style="color: #66cc66;">=</span> <span style="color: #ff0000;">'fhtgpcv2m2j4s'</span>;
&nbsp;
SQL_ID        I I I I BIND<span style="color: #66cc66;">&#40;</span>NAME<span style="color: #66cc66;">,</span> POSITION<span style="color: #66cc66;">,</span> DUP_POSITION<span style="color: #66cc66;">,</span> DATATYPE<span style="color: #66cc66;">,</span> DATATYPE_STRING<span style="color: #66cc66;">,</span> CHARACTER_SID<span style="color: #66cc66;">,</span> PRECISION<span style="color: #66cc66;">,</span> SCALE<span style="color: #66cc66;">,</span> MAX_LENGTH<span style="color: #66cc66;">,</span> LAST_CAPTURED PLAN_HASH_VALUE CHILD_NUMBER
<span style="color: #808080; font-style: italic;">------------- - - - - ------------------------------------------------------------------------------------------------------------------------ --------------- ------------</span>
fhtgpcv2m2j4s N Y N Y SQL_BIND_SET<span style="color: #66cc66;">&#40;</span>SQL_BIND<span style="color: #66cc66;">&#40;</span><span style="color: #993333; font-weight: bold;">NULL</span><span style="color: #66cc66;">,</span> <span style="color: #cc66cc;">1</span><span style="color: #66cc66;">,</span> <span style="color: #993333; font-weight: bold;">NULL</span><span style="color: #66cc66;">,</span> <span style="color: #cc66cc;">1</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'VARCHAR2(32)'</span><span style="color: #66cc66;">,</span> <span style="color: #cc66cc;">178</span><span style="color: #66cc66;">,</span> <span style="color: #993333; font-weight: bold;">NULL</span><span style="color: #66cc66;">,</span> <span style="color: #993333; font-weight: bold;">NULL</span><span style="color: #66cc66;">,</span> <span style="color: #cc66cc;">32</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'12-MAR-09'</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'AAAAAAAAAA'</span><span style="color: #66cc66;">,</span> ANYDATA<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>           <span style="color: #cc66cc;">2211052296</span>            <span style="color: #cc66cc;">0</span>
&nbsp;
SQL<span style="color: #66cc66;">&gt;</span>
SQL<span style="color: #66cc66;">&gt;</span> prompt <span style="color: #ff0000;">&quot;Press enter to run&quot;</span>
<span style="color: #ff0000;">&quot;Press enter to run&quot;</span>
SQL<span style="color: #66cc66;">&gt;</span> pause
&nbsp;
SQL<span style="color: #66cc66;">&gt;</span> exec :myvar :<span style="color: #66cc66;">=</span> <span style="color: #ff0000;">'BBBBBBBBBB'</span>;
&nbsp;
PL<span style="color: #66cc66;">/</span>SQL procedure successfully completed<span style="color: #66cc66;">.</span>
&nbsp;
SQL<span style="color: #66cc66;">&gt;</span> <span style="color: #993333; font-weight: bold;">SET</span> termout off
SQL<span style="color: #66cc66;">&gt;</span> <span style="color: #993333; font-weight: bold;">SELECT</span> <span style="color: #66cc66;">*</span> <span style="color: #993333; font-weight: bold;">FROM</span> <span style="color: #993333; font-weight: bold;">TABLE</span><span style="color: #66cc66;">&#40;</span>dbms_xplan<span style="color: #66cc66;">.</span>display_cursor<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
PLAN_TABLE_OUTPUT
<span style="color: #808080; font-style: italic;">-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------   -----------------------------------------------------------------</span>
SQL_ID  fhtgpcv2m2j4s<span style="color: #66cc66;">,</span> child number <span style="color: #cc66cc;">0</span>
<span style="color: #808080; font-style: italic;">-------------------------------------</span>
<span style="color: #993333; font-weight: bold;">SELECT</span> <span style="color: #808080; font-style: italic;">/* MD_TESTCASE */</span> <span style="color: #66cc66;">*</span> <span style="color: #993333; font-weight: bold;">FROM</span> tab1 <span style="color: #993333; font-weight: bold;">WHERE</span> b <span style="color: #66cc66;">=</span> :myvar
&nbsp;
Plan hash value: <span style="color: #cc66cc;">2211052296</span>
&nbsp;
<span style="color: #808080; font-style: italic;">--------------------------------------------------------------------------</span>
<span style="color: #66cc66;">|</span> Id  <span style="color: #66cc66;">|</span> Operation         <span style="color: #66cc66;">|</span> Name <span style="color: #66cc66;">|</span> Rows  <span style="color: #66cc66;">|</span> Bytes <span style="color: #66cc66;">|</span> Cost <span style="color: #66cc66;">&#40;</span>%CPU<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">|</span> Time     <span style="color: #66cc66;">|</span>
<span style="color: #808080; font-style: italic;">--------------------------------------------------------------------------</span>
<span style="color: #66cc66;">|</span>   <span style="color: #cc66cc;">0</span> <span style="color: #66cc66;">|</span> <span style="color: #993333; font-weight: bold;">SELECT</span> STATEMENT  <span style="color: #66cc66;">|</span>      <span style="color: #66cc66;">|</span>       <span style="color: #66cc66;">|</span>       <span style="color: #66cc66;">|</span>   <span style="color: #cc66cc;">889</span> <span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">100</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">|</span>          <span style="color: #66cc66;">|</span>
<span style="color: #66cc66;">|*</span>  <span style="color: #cc66cc;">1</span> <span style="color: #66cc66;">|</span>  <span style="color: #993333; font-weight: bold;">TABLE</span> ACCESS <span style="color: #993333; font-weight: bold;">FULL</span><span style="color: #66cc66;">|</span> TAB1 <span style="color: #66cc66;">|</span>   100K<span style="color: #66cc66;">|</span>    20M<span style="color: #66cc66;">|</span>   <span style="color: #cc66cc;">889</span>   <span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">|</span> 00:00:<span style="color: #cc66cc;">11</span> <span style="color: #66cc66;">|</span>
<span style="color: #808080; font-style: italic;">--------------------------------------------------------------------------</span>
&nbsp;
Predicate Information <span style="color: #66cc66;">&#40;</span><span style="color: #993333; font-weight: bold;">IDENTIFIED</span> <span style="color: #993333; font-weight: bold;">BY</span> operation id<span style="color: #66cc66;">&#41;</span>:
<span style="color: #808080; font-style: italic;">---------------------------------------------------</span>
&nbsp;
   <span style="color: #cc66cc;">1</span> <span style="color: #66cc66;">-</span> filter<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;B&quot;</span><span style="color: #66cc66;">=</span>:MYVAR<span style="color: #66cc66;">&#41;</span>
&nbsp;
&nbsp;
<span style="color: #cc66cc;">18</span> rows selected<span style="color: #66cc66;">.</span>
&nbsp;
SQL<span style="color: #66cc66;">&gt;</span> <span style="color: #993333; font-weight: bold;">SELECT</span> sql_id<span style="color: #66cc66;">,</span> is_obsolete<span style="color: #66cc66;">,</span> is_bind_sensitive<span style="color: #66cc66;">,</span> is_bind_aware<span style="color: #66cc66;">,</span> is_shareable<span style="color: #66cc66;">,</span> dbms_sqltune<span style="color: #66cc66;">.</span>extract_binds<span style="color: #66cc66;">&#40;</span>bind_data<span style="color: #66cc66;">&#41;</span> bind<span style="color: #66cc66;">,</span> plan_hash_value<span style="color: #66cc66;">,</span> child_number <span style="color: #993333; font-weight: bold;">FROM</span>
  <span style="color: #cc66cc;">2</span>   v$sql <span style="color: #993333; font-weight: bold;">WHERE</span> sql_id <span style="color: #66cc66;">=</span> <span style="color: #ff0000;">'fhtgpcv2m2j4s'</span>;
&nbsp;
SQL_ID        I I I I BIND<span style="color: #66cc66;">&#40;</span>NAME<span style="color: #66cc66;">,</span> POSITION<span style="color: #66cc66;">,</span> DUP_POSITION<span style="color: #66cc66;">,</span> DATATYPE<span style="color: #66cc66;">,</span> DATATYPE_STRING<span style="color: #66cc66;">,</span> CHARACTER_SID<span style="color: #66cc66;">,</span> PRECISION<span style="color: #66cc66;">,</span> SCALE<span style="color: #66cc66;">,</span> MAX_LENGTH<span style="color: #66cc66;">,</span> LAST_CAPTURED PLAN_HASH_VALUE CHILD_NUMBER
<span style="color: #808080; font-style: italic;">------------- - - - - ------------------------------------------------------------------------------------------------------------------------ --------------- ------------</span>
fhtgpcv2m2j4s N Y N Y SQL_BIND_SET<span style="color: #66cc66;">&#40;</span>SQL_BIND<span style="color: #66cc66;">&#40;</span><span style="color: #993333; font-weight: bold;">NULL</span><span style="color: #66cc66;">,</span> <span style="color: #cc66cc;">1</span><span style="color: #66cc66;">,</span> <span style="color: #993333; font-weight: bold;">NULL</span><span style="color: #66cc66;">,</span> <span style="color: #cc66cc;">1</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'VARCHAR2(32)'</span><span style="color: #66cc66;">,</span> <span style="color: #cc66cc;">178</span><span style="color: #66cc66;">,</span> <span style="color: #993333; font-weight: bold;">NULL</span><span style="color: #66cc66;">,</span> <span style="color: #993333; font-weight: bold;">NULL</span><span style="color: #66cc66;">,</span> <span style="color: #cc66cc;">32</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'12-MAR-09'</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'AAAAAAAAAA'</span><span style="color: #66cc66;">,</span> ANYDATA<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>           <span style="color: #cc66cc;">2211052296</span>            <span style="color: #cc66cc;">0</span>
&nbsp;
SQL<span style="color: #66cc66;">&gt;</span>
SQL<span style="color: #66cc66;">&gt;</span> exec :myvar :<span style="color: #66cc66;">=</span> <span style="color: #ff0000;">'CCCCCCCCCC'</span>;
&nbsp;
PL<span style="color: #66cc66;">/</span>SQL procedure successfully completed<span style="color: #66cc66;">.</span>
&nbsp;
SQL<span style="color: #66cc66;">&gt;</span> prompt <span style="color: #ff0000;">&quot;Press enter to run&quot;</span>
<span style="color: #ff0000;">&quot;Press enter to run&quot;</span>
SQL<span style="color: #66cc66;">&gt;</span> pause
&nbsp;
SQL<span style="color: #66cc66;">&gt;</span> <span style="color: #993333; font-weight: bold;">SET</span> termout off
SQL<span style="color: #66cc66;">&gt;</span> <span style="color: #993333; font-weight: bold;">SELECT</span> <span style="color: #66cc66;">*</span> <span style="color: #993333; font-weight: bold;">FROM</span> <span style="color: #993333; font-weight: bold;">TABLE</span><span style="color: #66cc66;">&#40;</span>dbms_xplan<span style="color: #66cc66;">.</span>display_cursor<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
PLAN_TABLE_OUTPUT
<span style="color: #808080; font-style: italic;">-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------   -----------------------------------------------------------------</span>
SQL_ID  fhtgpcv2m2j4s<span style="color: #66cc66;">,</span> child number <span style="color: #cc66cc;">1</span>
<span style="color: #808080; font-style: italic;">-------------------------------------</span>
<span style="color: #993333; font-weight: bold;">SELECT</span> <span style="color: #808080; font-style: italic;">/* MD_TESTCASE */</span> <span style="color: #66cc66;">*</span> <span style="color: #993333; font-weight: bold;">FROM</span> tab1 <span style="color: #993333; font-weight: bold;">WHERE</span> b <span style="color: #66cc66;">=</span> :myvar
&nbsp;
Plan hash value: <span style="color: #cc66cc;">1918680838</span>
&nbsp;
<span style="color: #808080; font-style: italic;">-----------------------------------------------------------------------------------------</span>
<span style="color: #66cc66;">|</span> Id  <span style="color: #66cc66;">|</span> Operation                   <span style="color: #66cc66;">|</span> Name      <span style="color: #66cc66;">|</span> Rows  <span style="color: #66cc66;">|</span> Bytes <span style="color: #66cc66;">|</span> Cost <span style="color: #66cc66;">&#40;</span>%CPU<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">|</span> Time     <span style="color: #66cc66;">|</span>
<span style="color: #808080; font-style: italic;">-----------------------------------------------------------------------------------------</span>
<span style="color: #66cc66;">|</span>   <span style="color: #cc66cc;">0</span> <span style="color: #66cc66;">|</span> <span style="color: #993333; font-weight: bold;">SELECT</span> STATEMENT            <span style="color: #66cc66;">|</span>           <span style="color: #66cc66;">|</span>       <span style="color: #66cc66;">|</span>       <span style="color: #66cc66;">|</span>    <span style="color: #cc66cc;">36</span> <span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">100</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">|</span>          <span style="color: #66cc66;">|</span>
<span style="color: #66cc66;">|</span>   <span style="color: #cc66cc;">1</span> <span style="color: #66cc66;">|</span>  <span style="color: #993333; font-weight: bold;">TABLE</span> ACCESS <span style="color: #993333; font-weight: bold;">BY</span> <span style="color: #993333; font-weight: bold;">INDEX</span> ROWID<span style="color: #66cc66;">|</span> TAB1      <span style="color: #66cc66;">|</span>  <span style="color: #cc66cc;">1000</span> <span style="color: #66cc66;">|</span>   210K<span style="color: #66cc66;">|</span>    <span style="color: #cc66cc;">36</span>   <span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">|</span> 00:00:01 <span style="color: #66cc66;">|</span>
<span style="color: #66cc66;">|*</span>  <span style="color: #cc66cc;">2</span> <span style="color: #66cc66;">|</span>   <span style="color: #993333; font-weight: bold;">INDEX</span> RANGE SCAN          <span style="color: #66cc66;">|</span> TAB1_IDX1 <span style="color: #66cc66;">|</span>  <span style="color: #cc66cc;">1000</span> <span style="color: #66cc66;">|</span>       <span style="color: #66cc66;">|</span>     <span style="color: #cc66cc;">4</span>   <span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">|</span> 00:00:01 <span style="color: #66cc66;">|</span>
<span style="color: #808080; font-style: italic;">-----------------------------------------------------------------------------------------</span>
&nbsp;
Predicate Information <span style="color: #66cc66;">&#40;</span><span style="color: #993333; font-weight: bold;">IDENTIFIED</span> <span style="color: #993333; font-weight: bold;">BY</span> operation id<span style="color: #66cc66;">&#41;</span>:
<span style="color: #808080; font-style: italic;">---------------------------------------------------</span>
&nbsp;
   <span style="color: #cc66cc;">2</span> <span style="color: #66cc66;">-</span> access<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;B&quot;</span><span style="color: #66cc66;">=</span>:MYVAR<span style="color: #66cc66;">&#41;</span>
&nbsp;
&nbsp;
<span style="color: #cc66cc;">19</span> rows selected<span style="color: #66cc66;">.</span>
&nbsp;
SQL<span style="color: #66cc66;">&gt;</span> <span style="color: #993333; font-weight: bold;">SELECT</span> sql_id<span style="color: #66cc66;">,</span> is_obsolete<span style="color: #66cc66;">,</span> is_bind_sensitive<span style="color: #66cc66;">,</span> is_bind_aware<span style="color: #66cc66;">,</span> is_shareable<span style="color: #66cc66;">,</span> dbms_sqltune<span style="color: #66cc66;">.</span>extract_binds<span style="color: #66cc66;">&#40;</span>bind_data<span style="color: #66cc66;">&#41;</span> bind<span style="color: #66cc66;">,</span> plan_hash_value<span style="color: #66cc66;">,</span> child_number <span style="color: #993333; font-weight: bold;">FROM</span>
  <span style="color: #cc66cc;">2</span>   v$sql <span style="color: #993333; font-weight: bold;">WHERE</span> sql_id <span style="color: #66cc66;">=</span> <span style="color: #ff0000;">'fhtgpcv2m2j4s'</span>;
&nbsp;
SQL_ID        I I I I BIND<span style="color: #66cc66;">&#40;</span>NAME<span style="color: #66cc66;">,</span> POSITION<span style="color: #66cc66;">,</span> DUP_POSITION<span style="color: #66cc66;">,</span> DATATYPE<span style="color: #66cc66;">,</span> DATATYPE_STRING<span style="color: #66cc66;">,</span> CHARACTER_SID<span style="color: #66cc66;">,</span> PRECISION<span style="color: #66cc66;">,</span> SCALE<span style="color: #66cc66;">,</span> MAX_LENGTH<span style="color: #66cc66;">,</span> LAST_CAPTURED PLAN_HASH_VALUE CHILD_NUMBER
<span style="color: #808080; font-style: italic;">------------- - - - - ------------------------------------------------------------------------------------------------------------------------ --------------- ------------</span>
fhtgpcv2m2j4s N Y N Y SQL_BIND_SET<span style="color: #66cc66;">&#40;</span>SQL_BIND<span style="color: #66cc66;">&#40;</span><span style="color: #993333; font-weight: bold;">NULL</span><span style="color: #66cc66;">,</span> <span style="color: #cc66cc;">1</span><span style="color: #66cc66;">,</span> <span style="color: #993333; font-weight: bold;">NULL</span><span style="color: #66cc66;">,</span> <span style="color: #cc66cc;">1</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'VARCHAR2(32)'</span><span style="color: #66cc66;">,</span> <span style="color: #cc66cc;">178</span><span style="color: #66cc66;">,</span> <span style="color: #993333; font-weight: bold;">NULL</span><span style="color: #66cc66;">,</span> <span style="color: #993333; font-weight: bold;">NULL</span><span style="color: #66cc66;">,</span> <span style="color: #cc66cc;">32</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'12-MAR-09'</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'AAAAAAAAAA'</span><span style="color: #66cc66;">,</span> ANYDATA<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>           <span style="color: #cc66cc;">2211052296</span>            <span style="color: #cc66cc;">0</span>
fhtgpcv2m2j4s N Y Y Y SQL_BIND_SET<span style="color: #66cc66;">&#40;</span>SQL_BIND<span style="color: #66cc66;">&#40;</span><span style="color: #993333; font-weight: bold;">NULL</span><span style="color: #66cc66;">,</span> <span style="color: #cc66cc;">1</span><span style="color: #66cc66;">,</span> <span style="color: #993333; font-weight: bold;">NULL</span><span style="color: #66cc66;">,</span> <span style="color: #cc66cc;">1</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'VARCHAR2(32)'</span><span style="color: #66cc66;">,</span> <span style="color: #cc66cc;">178</span><span style="color: #66cc66;">,</span> <span style="color: #993333; font-weight: bold;">NULL</span><span style="color: #66cc66;">,</span> <span style="color: #993333; font-weight: bold;">NULL</span><span style="color: #66cc66;">,</span> <span style="color: #cc66cc;">32</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'12-MAR-09'</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'CCCCCCCCCC'</span><span style="color: #66cc66;">,</span> ANYDATA<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>           <span style="color: #cc66cc;">1918680838</span>            <span style="color: #cc66cc;">1</span>
&nbsp;
SQL<span style="color: #66cc66;">&gt;</span>
SQL<span style="color: #66cc66;">&gt;</span> exec :myvar :<span style="color: #66cc66;">=</span> <span style="color: #ff0000;">'DDDDDDDDDD'</span>;
&nbsp;
PL<span style="color: #66cc66;">/</span>SQL procedure successfully completed<span style="color: #66cc66;">.</span>
&nbsp;
SQL<span style="color: #66cc66;">&gt;</span> prompt <span style="color: #ff0000;">&quot;Press enter to run&quot;</span>
<span style="color: #ff0000;">&quot;Press enter to run&quot;</span>
SQL<span style="color: #66cc66;">&gt;</span> pause
&nbsp;
SQL<span style="color: #66cc66;">&gt;</span> <span style="color: #993333; font-weight: bold;">SET</span> termout off
SQL<span style="color: #66cc66;">&gt;</span> <span style="color: #993333; font-weight: bold;">SELECT</span> <span style="color: #66cc66;">*</span> <span style="color: #993333; font-weight: bold;">FROM</span> <span style="color: #993333; font-weight: bold;">TABLE</span><span style="color: #66cc66;">&#40;</span>dbms_xplan<span style="color: #66cc66;">.</span>display_cursor<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
PLAN_TABLE_OUTPUT
<span style="color: #808080; font-style: italic;">-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------   -----------------------------------------------------------------</span>
SQL_ID  fhtgpcv2m2j4s<span style="color: #66cc66;">,</span> child number <span style="color: #cc66cc;">2</span>
<span style="color: #808080; font-style: italic;">-------------------------------------</span>
<span style="color: #993333; font-weight: bold;">SELECT</span> <span style="color: #808080; font-style: italic;">/* MD_TESTCASE */</span> <span style="color: #66cc66;">*</span> <span style="color: #993333; font-weight: bold;">FROM</span> tab1 <span style="color: #993333; font-weight: bold;">WHERE</span> b <span style="color: #66cc66;">=</span> :myvar
&nbsp;
Plan hash value: <span style="color: #cc66cc;">1918680838</span>
&nbsp;
<span style="color: #808080; font-style: italic;">-----------------------------------------------------------------------------------------</span>
<span style="color: #66cc66;">|</span> Id  <span style="color: #66cc66;">|</span> Operation                   <span style="color: #66cc66;">|</span> Name      <span style="color: #66cc66;">|</span> Rows  <span style="color: #66cc66;">|</span> Bytes <span style="color: #66cc66;">|</span> Cost <span style="color: #66cc66;">&#40;</span>%CPU<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">|</span> Time     <span style="color: #66cc66;">|</span>
<span style="color: #808080; font-style: italic;">-----------------------------------------------------------------------------------------</span>
<span style="color: #66cc66;">|</span>   <span style="color: #cc66cc;">0</span> <span style="color: #66cc66;">|</span> <span style="color: #993333; font-weight: bold;">SELECT</span> STATEMENT            <span style="color: #66cc66;">|</span>           <span style="color: #66cc66;">|</span>       <span style="color: #66cc66;">|</span>       <span style="color: #66cc66;">|</span>     <span style="color: #cc66cc;">5</span> <span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">100</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">|</span>          <span style="color: #66cc66;">|</span>
<span style="color: #66cc66;">|</span>   <span style="color: #cc66cc;">1</span> <span style="color: #66cc66;">|</span>  <span style="color: #993333; font-weight: bold;">TABLE</span> ACCESS <span style="color: #993333; font-weight: bold;">BY</span> <span style="color: #993333; font-weight: bold;">INDEX</span> ROWID<span style="color: #66cc66;">|</span> TAB1      <span style="color: #66cc66;">|</span>   <span style="color: #cc66cc;">100</span> <span style="color: #66cc66;">|</span> <span style="color: #cc66cc;">21600</span> <span style="color: #66cc66;">|</span>     <span style="color: #cc66cc;">5</span>   <span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">|</span> 00:00:01 <span style="color: #66cc66;">|</span>
<span style="color: #66cc66;">|*</span>  <span style="color: #cc66cc;">2</span> <span style="color: #66cc66;">|</span>   <span style="color: #993333; font-weight: bold;">INDEX</span> RANGE SCAN          <span style="color: #66cc66;">|</span> TAB1_IDX1 <span style="color: #66cc66;">|</span>   <span style="color: #cc66cc;">100</span> <span style="color: #66cc66;">|</span>       <span style="color: #66cc66;">|</span>     <span style="color: #cc66cc;">1</span>   <span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">|</span> 00:00:01 <span style="color: #66cc66;">|</span>
<span style="color: #808080; font-style: italic;">-----------------------------------------------------------------------------------------</span>
&nbsp;
Predicate Information <span style="color: #66cc66;">&#40;</span><span style="color: #993333; font-weight: bold;">IDENTIFIED</span> <span style="color: #993333; font-weight: bold;">BY</span> operation id<span style="color: #66cc66;">&#41;</span>:
<span style="color: #808080; font-style: italic;">---------------------------------------------------</span>
&nbsp;
   <span style="color: #cc66cc;">2</span> <span style="color: #66cc66;">-</span> access<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;B&quot;</span><span style="color: #66cc66;">=</span>:MYVAR<span style="color: #66cc66;">&#41;</span>
&nbsp;
&nbsp;
<span style="color: #cc66cc;">19</span> rows selected<span style="color: #66cc66;">.</span>
&nbsp;
SQL<span style="color: #66cc66;">&gt;</span> <span style="color: #993333; font-weight: bold;">SELECT</span> sql_id<span style="color: #66cc66;">,</span> is_obsolete<span style="color: #66cc66;">,</span> is_bind_sensitive<span style="color: #66cc66;">,</span> is_bind_aware<span style="color: #66cc66;">,</span> is_shareable<span style="color: #66cc66;">,</span> dbms_sqltune<span style="color: #66cc66;">.</span>extract_binds<span style="color: #66cc66;">&#40;</span>bind_data<span style="color: #66cc66;">&#41;</span> bind<span style="color: #66cc66;">,</span> plan_hash_value<span style="color: #66cc66;">,</span> child_number <span style="color: #993333; font-weight: bold;">FROM</span>
  <span style="color: #cc66cc;">2</span>   v$sql <span style="color: #993333; font-weight: bold;">WHERE</span> sql_id <span style="color: #66cc66;">=</span> <span style="color: #ff0000;">'fhtgpcv2m2j4s'</span>;
&nbsp;
SQL_ID        I I I I BIND<span style="color: #66cc66;">&#40;</span>NAME<span style="color: #66cc66;">,</span> POSITION<span style="color: #66cc66;">,</span> DUP_POSITION<span style="color: #66cc66;">,</span> DATATYPE<span style="color: #66cc66;">,</span> DATATYPE_STRING<span style="color: #66cc66;">,</span> CHARACTER_SID<span style="color: #66cc66;">,</span> PRECISION<span style="color: #66cc66;">,</span> SCALE<span style="color: #66cc66;">,</span> MAX_LENGTH<span style="color: #66cc66;">,</span> LAST_CAPTURED PLAN_HASH_VALUE CHILD_NUMBER
<span style="color: #808080; font-style: italic;">------------- - - - - ------------------------------------------------------------------------------------------------------------------------ --------------- ------------</span>
fhtgpcv2m2j4s N Y N Y SQL_BIND_SET<span style="color: #66cc66;">&#40;</span>SQL_BIND<span style="color: #66cc66;">&#40;</span><span style="color: #993333; font-weight: bold;">NULL</span><span style="color: #66cc66;">,</span> <span style="color: #cc66cc;">1</span><span style="color: #66cc66;">,</span> <span style="color: #993333; font-weight: bold;">NULL</span><span style="color: #66cc66;">,</span> <span style="color: #cc66cc;">1</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'VARCHAR2(32)'</span><span style="color: #66cc66;">,</span> <span style="color: #cc66cc;">178</span><span style="color: #66cc66;">,</span> <span style="color: #993333; font-weight: bold;">NULL</span><span style="color: #66cc66;">,</span> <span style="color: #993333; font-weight: bold;">NULL</span><span style="color: #66cc66;">,</span> <span style="color: #cc66cc;">32</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'12-MAR-09'</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'AAAAAAAAAA'</span><span style="color: #66cc66;">,</span> ANYDATA<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>           <span style="color: #cc66cc;">2211052296</span>            <span style="color: #cc66cc;">0</span>
fhtgpcv2m2j4s N Y Y N SQL_BIND_SET<span style="color: #66cc66;">&#40;</span>SQL_BIND<span style="color: #66cc66;">&#40;</span><span style="color: #993333; font-weight: bold;">NULL</span><span style="color: #66cc66;">,</span> <span style="color: #cc66cc;">1</span><span style="color: #66cc66;">,</span> <span style="color: #993333; font-weight: bold;">NULL</span><span style="color: #66cc66;">,</span> <span style="color: #cc66cc;">1</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'VARCHAR2(32)'</span><span style="color: #66cc66;">,</span> <span style="color: #cc66cc;">178</span><span style="color: #66cc66;">,</span> <span style="color: #993333; font-weight: bold;">NULL</span><span style="color: #66cc66;">,</span> <span style="color: #993333; font-weight: bold;">NULL</span><span style="color: #66cc66;">,</span> <span style="color: #cc66cc;">32</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'12-MAR-09'</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'CCCCCCCCCC'</span><span style="color: #66cc66;">,</span> ANYDATA<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>           <span style="color: #cc66cc;">1918680838</span>            <span style="color: #cc66cc;">1</span>
fhtgpcv2m2j4s N Y Y Y SQL_BIND_SET<span style="color: #66cc66;">&#40;</span>SQL_BIND<span style="color: #66cc66;">&#40;</span><span style="color: #993333; font-weight: bold;">NULL</span><span style="color: #66cc66;">,</span> <span style="color: #cc66cc;">1</span><span style="color: #66cc66;">,</span> <span style="color: #993333; font-weight: bold;">NULL</span><span style="color: #66cc66;">,</span> <span style="color: #cc66cc;">1</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'VARCHAR2(32)'</span><span style="color: #66cc66;">,</span> <span style="color: #cc66cc;">178</span><span style="color: #66cc66;">,</span> <span style="color: #993333; font-weight: bold;">NULL</span><span style="color: #66cc66;">,</span> <span style="color: #993333; font-weight: bold;">NULL</span><span style="color: #66cc66;">,</span> <span style="color: #cc66cc;">32</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'12-MAR-09'</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'DDDDDDDDDD'</span><span style="color: #66cc66;">,</span> ANYDATA<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>           <span style="color: #cc66cc;">1918680838</span>            <span style="color: #cc66cc;">2</span>
&nbsp;
SQL<span style="color: #66cc66;">&gt;</span>
SQL<span style="color: #66cc66;">&gt;</span> exec :myvar :<span style="color: #66cc66;">=</span> <span style="color: #ff0000;">'EEEEEEEEEE'</span>;
&nbsp;
PL<span style="color: #66cc66;">/</span>SQL procedure successfully completed<span style="color: #66cc66;">.</span>
&nbsp;
SQL<span style="color: #66cc66;">&gt;</span> prompt <span style="color: #ff0000;">&quot;Press enter to run&quot;</span>
<span style="color: #ff0000;">&quot;Press enter to run&quot;</span>
SQL<span style="color: #66cc66;">&gt;</span> pause
&nbsp;
SQL<span style="color: #66cc66;">&gt;</span> <span style="color: #993333; font-weight: bold;">SET</span> termout off
SQL<span style="color: #66cc66;">&gt;</span> <span style="color: #993333; font-weight: bold;">SELECT</span> <span style="color: #66cc66;">*</span> <span style="color: #993333; font-weight: bold;">FROM</span> <span style="color: #993333; font-weight: bold;">TABLE</span><span style="color: #66cc66;">&#40;</span>dbms_xplan<span style="color: #66cc66;">.</span>display_cursor<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
PLAN_TABLE_OUTPUT
<span style="color: #808080; font-style: italic;">-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------   -----------------------------------------------------------------</span>
SQL_ID  fhtgpcv2m2j4s<span style="color: #66cc66;">,</span> child number <span style="color: #cc66cc;">3</span>
<span style="color: #808080; font-style: italic;">-------------------------------------</span>
<span style="color: #993333; font-weight: bold;">SELECT</span> <span style="color: #808080; font-style: italic;">/* MD_TESTCASE */</span> <span style="color: #66cc66;">*</span> <span style="color: #993333; font-weight: bold;">FROM</span> tab1 <span style="color: #993333; font-weight: bold;">WHERE</span> b <span style="color: #66cc66;">=</span> :myvar
&nbsp;
Plan hash value: <span style="color: #cc66cc;">1918680838</span>
&nbsp;
<span style="color: #808080; font-style: italic;">-----------------------------------------------------------------------------------------</span>
<span style="color: #66cc66;">|</span> Id  <span style="color: #66cc66;">|</span> Operation                   <span style="color: #66cc66;">|</span> Name      <span style="color: #66cc66;">|</span> Rows  <span style="color: #66cc66;">|</span> Bytes <span style="color: #66cc66;">|</span> Cost <span style="color: #66cc66;">&#40;</span>%CPU<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">|</span> Time     <span style="color: #66cc66;">|</span>
<span style="color: #808080; font-style: italic;">-----------------------------------------------------------------------------------------</span>
<span style="color: #66cc66;">|</span>   <span style="color: #cc66cc;">0</span> <span style="color: #66cc66;">|</span> <span style="color: #993333; font-weight: bold;">SELECT</span> STATEMENT            <span style="color: #66cc66;">|</span>           <span style="color: #66cc66;">|</span>       <span style="color: #66cc66;">|</span>       <span style="color: #66cc66;">|</span>     <span style="color: #cc66cc;">2</span> <span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">100</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">|</span>          <span style="color: #66cc66;">|</span>
<span style="color: #66cc66;">|</span>   <span style="color: #cc66cc;">1</span> <span style="color: #66cc66;">|</span>  <span style="color: #993333; font-weight: bold;">TABLE</span> ACCESS <span style="color: #993333; font-weight: bold;">BY</span> <span style="color: #993333; font-weight: bold;">INDEX</span> ROWID<span style="color: #66cc66;">|</span> TAB1      <span style="color: #66cc66;">|</span>    <span style="color: #cc66cc;">10</span> <span style="color: #66cc66;">|</span>  <span style="color: #cc66cc;">2160</span> <span style="color: #66cc66;">|</span>     <span style="color: #cc66cc;">2</span>   <span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">|</span> 00:00:01 <span style="color: #66cc66;">|</span>
<span style="color: #66cc66;">|*</span>  <span style="color: #cc66cc;">2</span> <span style="color: #66cc66;">|</span>   <span style="color: #993333; font-weight: bold;">INDEX</span> RANGE SCAN          <span style="color: #66cc66;">|</span> TAB1_IDX1 <span style="color: #66cc66;">|</span>    <span style="color: #cc66cc;">10</span> <span style="color: #66cc66;">|</span>       <span style="color: #66cc66;">|</span>     <span style="color: #cc66cc;">1</span>   <span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">|</span> 00:00:01 <span style="color: #66cc66;">|</span>
<span style="color: #808080; font-style: italic;">-----------------------------------------------------------------------------------------</span>
&nbsp;
Predicate Information <span style="color: #66cc66;">&#40;</span><span style="color: #993333; font-weight: bold;">IDENTIFIED</span> <span style="color: #993333; font-weight: bold;">BY</span> operation id<span style="color: #66cc66;">&#41;</span>:
<span style="color: #808080; font-style: italic;">---------------------------------------------------</span>
&nbsp;
   <span style="color: #cc66cc;">2</span> <span style="color: #66cc66;">-</span> access<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;B&quot;</span><span style="color: #66cc66;">=</span>:MYVAR<span style="color: #66cc66;">&#41;</span>
&nbsp;
&nbsp;
<span style="color: #cc66cc;">19</span> rows selected<span style="color: #66cc66;">.</span>
&nbsp;
SQL<span style="color: #66cc66;">&gt;</span> <span style="color: #993333; font-weight: bold;">SELECT</span> sql_id<span style="color: #66cc66;">,</span> is_obsolete<span style="color: #66cc66;">,</span> is_bind_sensitive<span style="color: #66cc66;">,</span> is_bind_aware<span style="color: #66cc66;">,</span> is_shareable<span style="color: #66cc66;">,</span> dbms_sqltune<span style="color: #66cc66;">.</span>extract_binds<span style="color: #66cc66;">&#40;</span>bind_data<span style="color: #66cc66;">&#41;</span> bind<span style="color: #66cc66;">,</span> plan_hash_value<span style="color: #66cc66;">,</span> child_number <span style="color: #993333; font-weight: bold;">FROM</span>
  <span style="color: #cc66cc;">2</span>   v$sql <span style="color: #993333; font-weight: bold;">WHERE</span> sql_id <span style="color: #66cc66;">=</span> <span style="color: #ff0000;">'fhtgpcv2m2j4s'</span>;
&nbsp;
SQL_ID        I I I I BIND<span style="color: #66cc66;">&#40;</span>NAME<span style="color: #66cc66;">,</span> POSITION<span style="color: #66cc66;">,</span> DUP_POSITION<span style="color: #66cc66;">,</span> DATATYPE<span style="color: #66cc66;">,</span> DATATYPE_STRING<span style="color: #66cc66;">,</span> CHARACTER_SID<span style="color: #66cc66;">,</span> PRECISION<span style="color: #66cc66;">,</span> SCALE<span style="color: #66cc66;">,</span> MAX_LENGTH<span style="color: #66cc66;">,</span> LAST_CAPTURED PLAN_HASH_VALUE CHILD_NUMBER
<span style="color: #808080; font-style: italic;">------------- - - - - ------------------------------------------------------------------------------------------------------------------------ --------------- ------------</span>
fhtgpcv2m2j4s N Y N Y SQL_BIND_SET<span style="color: #66cc66;">&#40;</span>SQL_BIND<span style="color: #66cc66;">&#40;</span><span style="color: #993333; font-weight: bold;">NULL</span><span style="color: #66cc66;">,</span> <span style="color: #cc66cc;">1</span><span style="color: #66cc66;">,</span> <span style="color: #993333; font-weight: bold;">NULL</span><span style="color: #66cc66;">,</span> <span style="color: #cc66cc;">1</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'VARCHAR2(32)'</span><span style="color: #66cc66;">,</span> <span style="color: #cc66cc;">178</span><span style="color: #66cc66;">,</span> <span style="color: #993333; font-weight: bold;">NULL</span><span style="color: #66cc66;">,</span> <span style="color: #993333; font-weight: bold;">NULL</span><span style="color: #66cc66;">,</span> <span style="color: #cc66cc;">32</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'12-MAR-09'</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'AAAAAAAAAA'</span><span style="color: #66cc66;">,</span> ANYDATA<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>           <span style="color: #cc66cc;">2211052296</span>            <span style="color: #cc66cc;">0</span>
fhtgpcv2m2j4s N Y Y N SQL_BIND_SET<span style="color: #66cc66;">&#40;</span>SQL_BIND<span style="color: #66cc66;">&#40;</span><span style="color: #993333; font-weight: bold;">NULL</span><span style="color: #66cc66;">,</span> <span style="color: #cc66cc;">1</span><span style="color: #66cc66;">,</span> <span style="color: #993333; font-weight: bold;">NULL</span><span style="color: #66cc66;">,</span> <span style="color: #cc66cc;">1</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'VARCHAR2(32)'</span><span style="color: #66cc66;">,</span> <span style="color: #cc66cc;">178</span><span style="color: #66cc66;">,</span> <span style="color: #993333; font-weight: bold;">NULL</span><span style="color: #66cc66;">,</span> <span style="color: #993333; font-weight: bold;">NULL</span><span style="color: #66cc66;">,</span> <span style="color: #cc66cc;">32</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'12-MAR-09'</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'CCCCCCCCCC'</span><span style="color: #66cc66;">,</span> ANYDATA<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>           <span style="color: #cc66cc;">1918680838</span>            <span style="color: #cc66cc;">1</span>
fhtgpcv2m2j4s N Y Y N SQL_BIND_SET<span style="color: #66cc66;">&#40;</span>SQL_BIND<span style="color: #66cc66;">&#40;</span><span style="color: #993333; font-weight: bold;">NULL</span><span style="color: #66cc66;">,</span> <span style="color: #cc66cc;">1</span><span style="color: #66cc66;">,</span> <span style="color: #993333; font-weight: bold;">NULL</span><span style="color: #66cc66;">,</span> <span style="color: #cc66cc;">1</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'VARCHAR2(32)'</span><span style="color: #66cc66;">,</span> <span style="color: #cc66cc;">178</span><span style="color: #66cc66;">,</span> <span style="color: #993333; font-weight: bold;">NULL</span><span style="color: #66cc66;">,</span> <span style="color: #993333; font-weight: bold;">NULL</span><span style="color: #66cc66;">,</span> <span style="color: #cc66cc;">32</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'12-MAR-09'</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'DDDDDDDDDD'</span><span style="color: #66cc66;">,</span> ANYDATA<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>           <span style="color: #cc66cc;">1918680838</span>            <span style="color: #cc66cc;">2</span>
fhtgpcv2m2j4s N Y Y Y SQL_BIND_SET<span style="color: #66cc66;">&#40;</span>SQL_BIND<span style="color: #66cc66;">&#40;</span><span style="color: #993333; font-weight: bold;">NULL</span><span style="color: #66cc66;">,</span> <span style="color: #cc66cc;">1</span><span style="color: #66cc66;">,</span> <span style="color: #993333; font-weight: bold;">NULL</span><span style="color: #66cc66;">,</span> <span style="color: #cc66cc;">1</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'VARCHAR2(32)'</span><span style="color: #66cc66;">,</span> <span style="color: #cc66cc;">178</span><span style="color: #66cc66;">,</span> <span style="color: #993333; font-weight: bold;">NULL</span><span style="color: #66cc66;">,</span> <span style="color: #993333; font-weight: bold;">NULL</span><span style="color: #66cc66;">,</span> <span style="color: #cc66cc;">32</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'12-MAR-09'</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'EEEEEEEEEE'</span><span style="color: #66cc66;">,</span> ANYDATA<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>           <span style="color: #cc66cc;">1918680838</span>            <span style="color: #cc66cc;">3</span>
&nbsp;
SQL<span style="color: #66cc66;">&gt;</span>
SQL<span style="color: #66cc66;">&gt;</span> exec :myvar :<span style="color: #66cc66;">=</span> <span style="color: #ff0000;">'FFFFFFFFFF'</span>;
&nbsp;
PL<span style="color: #66cc66;">/</span>SQL procedure successfully completed<span style="color: #66cc66;">.</span>
&nbsp;
SQL<span style="color: #66cc66;">&gt;</span> prompt <span style="color: #ff0000;">&quot;Press enter to run&quot;</span>
<span style="color: #ff0000;">&quot;Press enter to run&quot;</span>
SQL<span style="color: #66cc66;">&gt;</span> pause
&nbsp;
SQL<span style="color: #66cc66;">&gt;</span> <span style="color: #993333; font-weight: bold;">SET</span> termout off
SQL<span style="color: #66cc66;">&gt;</span> <span style="color: #993333; font-weight: bold;">SELECT</span> <span style="color: #66cc66;">*</span> <span style="color: #993333; font-weight: bold;">FROM</span> <span style="color: #993333; font-weight: bold;">TABLE</span><span style="color: #66cc66;">&#40;</span>dbms_xplan<span style="color: #66cc66;">.</span>display_cursor<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
PLAN_TABLE_OUTPUT
<span style="color: #808080; font-style: italic;">-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------   -----------------------------------------------------------------</span>
SQL_ID  fhtgpcv2m2j4s<span style="color: #66cc66;">,</span> child number <span style="color: #cc66cc;">4</span>
<span style="color: #808080; font-style: italic;">-------------------------------------</span>
<span style="color: #993333; font-weight: bold;">SELECT</span> <span style="color: #808080; font-style: italic;">/* MD_TESTCASE */</span> <span style="color: #66cc66;">*</span> <span style="color: #993333; font-weight: bold;">FROM</span> tab1 <span style="color: #993333; font-weight: bold;">WHERE</span> b <span style="color: #66cc66;">=</span> :myvar
&nbsp;
Plan hash value: <span style="color: #cc66cc;">1918680838</span>
&nbsp;
<span style="color: #808080; font-style: italic;">-----------------------------------------------------------------------------------------</span>
<span style="color: #66cc66;">|</span> Id  <span style="color: #66cc66;">|</span> Operation                   <span style="color: #66cc66;">|</span> Name      <span style="color: #66cc66;">|</span> Rows  <span style="color: #66cc66;">|</span> Bytes <span style="color: #66cc66;">|</span> Cost <span style="color: #66cc66;">&#40;</span>%CPU<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">|</span> Time     <span style="color: #66cc66;">|</span>
<span style="color: #808080; font-style: italic;">-----------------------------------------------------------------------------------------</span>
<span style="color: #66cc66;">|</span>   <span style="color: #cc66cc;">0</span> <span style="color: #66cc66;">|</span> <span style="color: #993333; font-weight: bold;">SELECT</span> STATEMENT            <span style="color: #66cc66;">|</span>           <span style="color: #66cc66;">|</span>       <span style="color: #66cc66;">|</span>       <span style="color: #66cc66;">|</span>     <span style="color: #cc66cc;">2</span> <span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">100</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">|</span>          <span style="color: #66cc66;">|</span>
<span style="color: #66cc66;">|</span>   <span style="color: #cc66cc;">1</span> <span style="color: #66cc66;">|</span>  <span style="color: #993333; font-weight: bold;">TABLE</span> ACCESS <span style="color: #993333; font-weight: bold;">BY</span> <span style="color: #993333; font-weight: bold;">INDEX</span> ROWID<span style="color: #66cc66;">|</span> TAB1      <span style="color: #66cc66;">|</span>     <span style="color: #cc66cc;">1</span> <span style="color: #66cc66;">|</span>   <span style="color: #cc66cc;">216</span> <span style="color: #66cc66;">|</span>     <span style="color: #cc66cc;">2</span>   <span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">|</span> 00:00:01 <span style="color: #66cc66;">|</span>
<span style="color: #66cc66;">|*</span>  <span style="color: #cc66cc;">2</span> <span style="color: #66cc66;">|</span>   <span style="color: #993333; font-weight: bold;">INDEX</span> RANGE SCAN          <span style="color: #66cc66;">|</span> TAB1_IDX1 <span style="color: #66cc66;">|</span>     <span style="color: #cc66cc;">1</span> <span style="color: #66cc66;">|</span>       <span style="color: #66cc66;">|</span>     <span style="color: #cc66cc;">1</span>   <span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">|</span> 00:00:01 <span style="color: #66cc66;">|</span>
<span style="color: #808080; font-style: italic;">-----------------------------------------------------------------------------------------</span>
&nbsp;
Predicate Information <span style="color: #66cc66;">&#40;</span><span style="color: #993333; font-weight: bold;">IDENTIFIED</span> <span style="color: #993333; font-weight: bold;">BY</span> operation id<span style="color: #66cc66;">&#41;</span>:
<span style="color: #808080; font-style: italic;">---------------------------------------------------</span>
&nbsp;
   <span style="color: #cc66cc;">2</span> <span style="color: #66cc66;">-</span> access<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;B&quot;</span><span style="color: #66cc66;">=</span>:MYVAR<span style="color: #66cc66;">&#41;</span>
&nbsp;
&nbsp;
<span style="color: #cc66cc;">19</span> rows selected<span style="color: #66cc66;">.</span>
&nbsp;
SQL<span style="color: #66cc66;">&gt;</span> <span style="color: #993333; font-weight: bold;">SELECT</span> sql_id<span style="color: #66cc66;">,</span> is_obsolete<span style="color: #66cc66;">,</span> is_bind_sensitive<span style="color: #66cc66;">,</span> is_bind_aware<span style="color: #66cc66;">,</span> is_shareable<span style="color: #66cc66;">,</span> dbms_sqltune<span style="color: #66cc66;">.</span>extract_binds<span style="color: #66cc66;">&#40;</span>bind_data<span style="color: #66cc66;">&#41;</span> bind<span style="color: #66cc66;">,</span> plan_hash_value<span style="color: #66cc66;">,</span> child_number <span style="color: #993333; font-weight: bold;">FROM</span>
  <span style="color: #cc66cc;">2</span>   v$sql <span style="color: #993333; font-weight: bold;">WHERE</span> sql_id <span style="color: #66cc66;">=</span> <span style="color: #ff0000;">'fhtgpcv2m2j4s'</span>;
&nbsp;
SQL_ID        I I I I BIND<span style="color: #66cc66;">&#40;</span>NAME<span style="color: #66cc66;">,</span> POSITION<span style="color: #66cc66;">,</span> DUP_POSITION<span style="color: #66cc66;">,</span> DATATYPE<span style="color: #66cc66;">,</span> DATATYPE_STRING<span style="color: #66cc66;">,</span> CHARACTER_SID<span style="color: #66cc66;">,</span> PRECISION<span style="color: #66cc66;">,</span> SCALE<span style="color: #66cc66;">,</span> MAX_LENGTH<span style="color: #66cc66;">,</span> LAST_CAPTURED PLAN_HASH_VALUE CHILD_NUMBER
<span style="color: #808080; font-style: italic;">------------- - - - - ------------------------------------------------------------------------------------------------------------------------ --------------- ------------</span>
fhtgpcv2m2j4s N Y N Y SQL_BIND_SET<span style="color: #66cc66;">&#40;</span>SQL_BIND<span style="color: #66cc66;">&#40;</span><span style="color: #993333; font-weight: bold;">NULL</span><span style="color: #66cc66;">,</span> <span style="color: #cc66cc;">1</span><span style="color: #66cc66;">,</span> <span style="color: #993333; font-weight: bold;">NULL</span><span style="color: #66cc66;">,</span> <span style="color: #cc66cc;">1</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'VARCHAR2(32)'</span><span style="color: #66cc66;">,</span> <span style="color: #cc66cc;">178</span><span style="color: #66cc66;">,</span> <span style="color: #993333; font-weight: bold;">NULL</span><span style="color: #66cc66;">,</span> <span style="color: #993333; font-weight: bold;">NULL</span><span style="color: #66cc66;">,</span> <span style="color: #cc66cc;">32</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'12-MAR-09'</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'AAAAAAAAAA'</span><span style="color: #66cc66;">,</span> ANYDATA<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>           <span style="color: #cc66cc;">2211052296</span>            <span style="color: #cc66cc;">0</span>
fhtgpcv2m2j4s N Y Y N SQL_BIND_SET<span style="color: #66cc66;">&#40;</span>SQL_BIND<span style="color: #66cc66;">&#40;</span><span style="color: #993333; font-weight: bold;">NULL</span><span style="color: #66cc66;">,</span> <span style="color: #cc66cc;">1</span><span style="color: #66cc66;">,</span> <span style="color: #993333; font-weight: bold;">NULL</span><span style="color: #66cc66;">,</span> <span style="color: #cc66cc;">1</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'VARCHAR2(32)'</span><span style="color: #66cc66;">,</span> <span style="color: #cc66cc;">178</span><span style="color: #66cc66;">,</span> <span style="color: #993333; font-weight: bold;">NULL</span><span style="color: #66cc66;">,</span> <span style="color: #993333; font-weight: bold;">NULL</span><span style="color: #66cc66;">,</span> <span style="color: #cc66cc;">32</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'12-MAR-09'</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'CCCCCCCCCC'</span><span style="color: #66cc66;">,</span> ANYDATA<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>           <span style="color: #cc66cc;">1918680838</span>            <span style="color: #cc66cc;">1</span>
fhtgpcv2m2j4s N Y Y N SQL_BIND_SET<span style="color: #66cc66;">&#40;</span>SQL_BIND<span style="color: #66cc66;">&#40;</span><span style="color: #993333; font-weight: bold;">NULL</span><span style="color: #66cc66;">,</span> <span style="color: #cc66cc;">1</span><span style="color: #66cc66;">,</span> <span style="color: #993333; font-weight: bold;">NULL</span><span style="color: #66cc66;">,</span> <span style="color: #cc66cc;">1</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'VARCHAR2(32)'</span><span style="color: #66cc66;">,</span> <span style="color: #cc66cc;">178</span><span style="color: #66cc66;">,</span> <span style="color: #993333; font-weight: bold;">NULL</span><span style="color: #66cc66;">,</span> <span style="color: #993333; font-weight: bold;">NULL</span><span style="color: #66cc66;">,</span> <span style="color: #cc66cc;">32</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'12-MAR-09'</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'DDDDDDDDDD'</span><span style="color: #66cc66;">,</span> ANYDATA<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>           <span style="color: #cc66cc;">1918680838</span>            <span style="color: #cc66cc;">2</span>
fhtgpcv2m2j4s N Y Y N SQL_BIND_SET<span style="color: #66cc66;">&#40;</span>SQL_BIND<span style="color: #66cc66;">&#40;</span><span style="color: #993333; font-weight: bold;">NULL</span><span style="color: #66cc66;">,</span> <span style="color: #cc66cc;">1</span><span style="color: #66cc66;">,</span> <span style="color: #993333; font-weight: bold;">NULL</span><span style="color: #66cc66;">,</span> <span style="color: #cc66cc;">1</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'VARCHAR2(32)'</span><span style="color: #66cc66;">,</span> <span style="color: #cc66cc;">178</span><span style="color: #66cc66;">,</span> <span style="color: #993333; font-weight: bold;">NULL</span><span style="color: #66cc66;">,</span> <span style="color: #993333; font-weight: bold;">NULL</span><span style="color: #66cc66;">,</span> <span style="color: #cc66cc;">32</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'12-MAR-09'</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'EEEEEEEEEE'</span><span style="color: #66cc66;">,</span> ANYDATA<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>           <span style="color: #cc66cc;">1918680838</span>            <span style="color: #cc66cc;">3</span>
fhtgpcv2m2j4s N Y Y Y SQL_BIND_SET<span style="color: #66cc66;">&#40;</span>SQL_BIND<span style="color: #66cc66;">&#40;</span><span style="color: #993333; font-weight: bold;">NULL</span><span style="color: #66cc66;">,</span> <span style="color: #cc66cc;">1</span><span style="color: #66cc66;">,</span> <span style="color: #993333; font-weight: bold;">NULL</span><span style="color: #66cc66;">,</span> <span style="color: #cc66cc;">1</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'VARCHAR2(32)'</span><span style="color: #66cc66;">,</span> <span style="color: #cc66cc;">178</span><span style="color: #66cc66;">,</span> <span style="color: #993333; font-weight: bold;">NULL</span><span style="color: #66cc66;">,</span> <span style="color: #993333; font-weight: bold;">NULL</span><span style="color: #66cc66;">,</span> <span style="color: #cc66cc;">32</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'12-MAR-09'</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'FFFFFFFFFF'</span><span style="color: #66cc66;">,</span> ANYDATA<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>           <span style="color: #cc66cc;">1918680838</span>            <span style="color: #cc66cc;">4</span></pre></td></tr></table></div>

<p>You can see that after parsing for bind CCCCCCCC, the execution plan changes from full table scan to index range scan. Moreover child cursor 1 is marked &#8220;is_bind_aware=Y&#8221;. When now bind DDDDDDDD is used, there is a new child (#2) and child 1 is set to is_sharable=N. After using bind EEEEEEEE, child #2 is set to sharable=N and a new child #3 is created. This repeats until there are 5 child cursors, 2 of which are set to is_sharable=Y. When the script is executed multiple times, there is even a sixth child cursor.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
</pre></td><td class="code"><pre class="sql" style="font-family:monospace;">SQL_ID        I I I I BIND<span style="color: #66cc66;">&#40;</span>NAME<span style="color: #66cc66;">,</span> POSITION<span style="color: #66cc66;">,</span> DUP_POSITION<span style="color: #66cc66;">,</span> DATATYPE<span style="color: #66cc66;">,</span> DATATYPE_STRING<span style="color: #66cc66;">,</span> CHARACTER_SID<span style="color: #66cc66;">,</span> PRECISION<span style="color: #66cc66;">,</span> SCALE<span style="color: #66cc66;">,</span> MAX_LENGTH<span style="color: #66cc66;">,</span> LAST_CAPTURED PLAN_HASH_VALUE CHILD_NUMBER EXECUTIONS
<span style="color: #808080; font-style: italic;">------------- - - - - ------------------------------------------------------------------------------------------------------------------------ --------------- ------------ ----------</span>
fhtgpcv2m2j4s N Y N N SQL_BIND_SET<span style="color: #66cc66;">&#40;</span>SQL_BIND<span style="color: #66cc66;">&#40;</span><span style="color: #993333; font-weight: bold;">NULL</span><span style="color: #66cc66;">,</span> <span style="color: #cc66cc;">1</span><span style="color: #66cc66;">,</span> <span style="color: #993333; font-weight: bold;">NULL</span><span style="color: #66cc66;">,</span> <span style="color: #cc66cc;">1</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'VARCHAR2(32)'</span><span style="color: #66cc66;">,</span> <span style="color: #cc66cc;">178</span><span style="color: #66cc66;">,</span> <span style="color: #993333; font-weight: bold;">NULL</span><span style="color: #66cc66;">,</span> <span style="color: #993333; font-weight: bold;">NULL</span><span style="color: #66cc66;">,</span> <span style="color: #cc66cc;">32</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'12-MAR-09'</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'AAAAAAAAAA'</span><span style="color: #66cc66;">,</span> ANYDATA<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>           <span style="color: #cc66cc;">2211052296</span>            <span style="color: #cc66cc;">0</span>          <span style="color: #cc66cc;">2</span>
fhtgpcv2m2j4s N Y Y N SQL_BIND_SET<span style="color: #66cc66;">&#40;</span>SQL_BIND<span style="color: #66cc66;">&#40;</span><span style="color: #993333; font-weight: bold;">NULL</span><span style="color: #66cc66;">,</span> <span style="color: #cc66cc;">1</span><span style="color: #66cc66;">,</span> <span style="color: #993333; font-weight: bold;">NULL</span><span style="color: #66cc66;">,</span> <span style="color: #cc66cc;">1</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'VARCHAR2(32)'</span><span style="color: #66cc66;">,</span> <span style="color: #cc66cc;">178</span><span style="color: #66cc66;">,</span> <span style="color: #993333; font-weight: bold;">NULL</span><span style="color: #66cc66;">,</span> <span style="color: #993333; font-weight: bold;">NULL</span><span style="color: #66cc66;">,</span> <span style="color: #cc66cc;">32</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'12-MAR-09'</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'CCCCCCCCCC'</span><span style="color: #66cc66;">,</span> ANYDATA<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>           <span style="color: #cc66cc;">1918680838</span>            <span style="color: #cc66cc;">1</span>          <span style="color: #cc66cc;">1</span>
fhtgpcv2m2j4s N Y Y N SQL_BIND_SET<span style="color: #66cc66;">&#40;</span>SQL_BIND<span style="color: #66cc66;">&#40;</span><span style="color: #993333; font-weight: bold;">NULL</span><span style="color: #66cc66;">,</span> <span style="color: #cc66cc;">1</span><span style="color: #66cc66;">,</span> <span style="color: #993333; font-weight: bold;">NULL</span><span style="color: #66cc66;">,</span> <span style="color: #cc66cc;">1</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'VARCHAR2(32)'</span><span style="color: #66cc66;">,</span> <span style="color: #cc66cc;">178</span><span style="color: #66cc66;">,</span> <span style="color: #993333; font-weight: bold;">NULL</span><span style="color: #66cc66;">,</span> <span style="color: #993333; font-weight: bold;">NULL</span><span style="color: #66cc66;">,</span> <span style="color: #cc66cc;">32</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'12-MAR-09'</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'DDDDDDDDDD'</span><span style="color: #66cc66;">,</span> ANYDATA<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>           <span style="color: #cc66cc;">1918680838</span>            <span style="color: #cc66cc;">2</span>          <span style="color: #cc66cc;">1</span>
fhtgpcv2m2j4s N Y Y N SQL_BIND_SET<span style="color: #66cc66;">&#40;</span>SQL_BIND<span style="color: #66cc66;">&#40;</span><span style="color: #993333; font-weight: bold;">NULL</span><span style="color: #66cc66;">,</span> <span style="color: #cc66cc;">1</span><span style="color: #66cc66;">,</span> <span style="color: #993333; font-weight: bold;">NULL</span><span style="color: #66cc66;">,</span> <span style="color: #cc66cc;">1</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'VARCHAR2(32)'</span><span style="color: #66cc66;">,</span> <span style="color: #cc66cc;">178</span><span style="color: #66cc66;">,</span> <span style="color: #993333; font-weight: bold;">NULL</span><span style="color: #66cc66;">,</span> <span style="color: #993333; font-weight: bold;">NULL</span><span style="color: #66cc66;">,</span> <span style="color: #cc66cc;">32</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'12-MAR-09'</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'EEEEEEEEEE'</span><span style="color: #66cc66;">,</span> ANYDATA<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>           <span style="color: #cc66cc;">1918680838</span>            <span style="color: #cc66cc;">3</span>          <span style="color: #cc66cc;">1</span>
fhtgpcv2m2j4s N Y Y Y SQL_BIND_SET<span style="color: #66cc66;">&#40;</span>SQL_BIND<span style="color: #66cc66;">&#40;</span><span style="color: #993333; font-weight: bold;">NULL</span><span style="color: #66cc66;">,</span> <span style="color: #cc66cc;">1</span><span style="color: #66cc66;">,</span> <span style="color: #993333; font-weight: bold;">NULL</span><span style="color: #66cc66;">,</span> <span style="color: #cc66cc;">1</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'VARCHAR2(32)'</span><span style="color: #66cc66;">,</span> <span style="color: #cc66cc;">178</span><span style="color: #66cc66;">,</span> <span style="color: #993333; font-weight: bold;">NULL</span><span style="color: #66cc66;">,</span> <span style="color: #993333; font-weight: bold;">NULL</span><span style="color: #66cc66;">,</span> <span style="color: #cc66cc;">32</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'12-MAR-09'</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'FFFFFFFFFF'</span><span style="color: #66cc66;">,</span> ANYDATA<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>           <span style="color: #cc66cc;">1918680838</span>            <span style="color: #cc66cc;">4</span>         <span style="color: #cc66cc;">16</span>
fhtgpcv2m2j4s N Y Y Y SQL_BIND_SET<span style="color: #66cc66;">&#40;</span>SQL_BIND<span style="color: #66cc66;">&#40;</span><span style="color: #993333; font-weight: bold;">NULL</span><span style="color: #66cc66;">,</span> <span style="color: #cc66cc;">1</span><span style="color: #66cc66;">,</span> <span style="color: #993333; font-weight: bold;">NULL</span><span style="color: #66cc66;">,</span> <span style="color: #cc66cc;">1</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'VARCHAR2(32)'</span><span style="color: #66cc66;">,</span> <span style="color: #cc66cc;">178</span><span style="color: #66cc66;">,</span> <span style="color: #993333; font-weight: bold;">NULL</span><span style="color: #66cc66;">,</span> <span style="color: #993333; font-weight: bold;">NULL</span><span style="color: #66cc66;">,</span> <span style="color: #cc66cc;">32</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'12-MAR-09'</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'AAAAAAAAAA'</span><span style="color: #66cc66;">,</span> ANYDATA<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>           <span style="color: #cc66cc;">2211052296</span>            <span style="color: #cc66cc;">5</span>          <span style="color: #cc66cc;">3</span></pre></td></tr></table></div>

<p>I wondered why the cursors are not sharable and queried v$sql_shared_cursor:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
</pre></td><td class="code"><pre class="sql" style="font-family:monospace;">SQL<span style="color: #66cc66;">&gt;</span>   <span style="color: #993333; font-weight: bold;">SELECT</span> <span style="color: #66cc66;">*</span> <span style="color: #993333; font-weight: bold;">FROM</span> v$sql_shared_cursor <span style="color: #993333; font-weight: bold;">WHERE</span> sql_id <span style="color: #66cc66;">=</span> <span style="color: #ff0000;">'fhtgpcv2m2j4s'</span>;
&nbsp;
SQL_ID        ADDRESS  CHILD_AD CHILD_NUMBER U S O O S L F E B P I S T A B D L T R I I R L I O E M U T N F A I T D L D B P C S C P T M B M R O P M F L P L A F L R L H
<span style="color: #808080; font-style: italic;">------------- -------- -------- ------------ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -</span>
fhtgpcv2m2j4s 23F4E438 23F4DAB0            <span style="color: #cc66cc;">0</span> N N N N N N N N N N N N N N N N N N N N N N N N N N N N N N N N N N N N N N N N N N N N N N N N N N N N N N Y N N N N N N
fhtgpcv2m2j4s 23F4E438 23D924D8            <span style="color: #cc66cc;">1</span> N N N N N N N N N N N N N N N N N N Y N N N N N N N N N N N N N N N N N N N N N N N N N N N N N N N N N N N N N N N N N N
fhtgpcv2m2j4s 23F4E438 23D7E888            <span style="color: #cc66cc;">2</span> N N N N N N N N N N N N N N N N N N Y N N N N N N N N N N N N N N N N N N N N N N N N N N N N N N N N N N N N N N N N N N
fhtgpcv2m2j4s 23F4E438 23D6B8C8            <span style="color: #cc66cc;">3</span> N N N N N N N N N N N N N N N N N N Y N N N N N N N N N N N N N N N N N N N N N N N N N N N N N N N N N N N N N N N N N N
fhtgpcv2m2j4s 23F4E438 23D574D8            <span style="color: #cc66cc;">4</span> N N N N N N N N N N N N N N N N N N Y N N N N N N N N N N N N N N N N N N N N N N N N N N N N N N N N N N N N N N N N N N
fhtgpcv2m2j4s 23F4E438 23B983B0            <span style="color: #cc66cc;">5</span> N N N N N N N N N N N N N N N N N N Y N N N N N N N N N N N N N N N N N N N N N N N N N N N N N N N N N N N N N N N N N N
&nbsp;
<span style="color: #cc66cc;">6</span> rows selected<span style="color: #66cc66;">.</span>
&nbsp;
SQL<span style="color: #66cc66;">&gt;</span> <span style="color: #993333; font-weight: bold;">SELECT</span> sql_id<span style="color: #66cc66;">,</span> address<span style="color: #66cc66;">,</span> child_number<span style="color: #66cc66;">,</span> LOAD_OPTIMIZER_STATS<span style="color: #66cc66;">,</span> row_level_sec_mismatch <span style="color: #993333; font-weight: bold;">FROM</span> v$sql_shared_cursor <span style="color: #993333; font-weight: bold;">WHERE</span> sql_id <span style="color: #66cc66;">=</span> <span style="color: #ff0000;">'fhtgpcv2m2j4s'</span>;
&nbsp;
SQL_ID        ADDRESS  CHILD_NUMBER L R
<span style="color: #808080; font-style: italic;">------------- -------- ------------ - -</span>
fhtgpcv2m2j4s 245CE53C            <span style="color: #cc66cc;">0</span> Y N
fhtgpcv2m2j4s 245CE53C            <span style="color: #cc66cc;">1</span> N Y
fhtgpcv2m2j4s 245CE53C            <span style="color: #cc66cc;">2</span> N Y
fhtgpcv2m2j4s 245CE53C            <span style="color: #cc66cc;">3</span> N Y
fhtgpcv2m2j4s 245CE53C            <span style="color: #cc66cc;">4</span> N Y
fhtgpcv2m2j4s 245CE53C            <span style="color: #cc66cc;">5</span> N Y
&nbsp;
SQL<span style="color: #66cc66;">&gt;</span> <span style="color: #993333; font-weight: bold;">SELECT</span> <span style="color: #66cc66;">*</span> <span style="color: #993333; font-weight: bold;">FROM</span> v$sql_cs_statistics <span style="color: #993333; font-weight: bold;">WHERE</span> sql_id <span style="color: #66cc66;">=</span> <span style="color: #ff0000;">'fhtgpcv2m2j4s'</span>;
&nbsp;
ADDRESS  HASH_VALUE SQL_ID        CHILD_NUMBER BIND_SET_HASH_VALUE P EXECUTIONS ROWS_PROCESSED BUFFER_GETS   CPU_TIME
<span style="color: #808080; font-style: italic;">-------- ---------- ------------- ------------ ------------------- - ---------- -------------- ----------- ----------</span>
245CE53C <span style="color: #cc66cc;">3308340376</span> fhtgpcv2m2j4s            <span style="color: #cc66cc;">5</span>          <span style="color: #cc66cc;">3946114705</span> N          <span style="color: #cc66cc;">1</span>              <span style="color: #cc66cc;">0</span>           <span style="color: #cc66cc;">2</span>          <span style="color: #cc66cc;">0</span>
245CE53C <span style="color: #cc66cc;">3308340376</span> fhtgpcv2m2j4s            <span style="color: #cc66cc;">5</span>          <span style="color: #cc66cc;">2785428864</span> Y          <span style="color: #cc66cc;">1</span>              <span style="color: #cc66cc;">0</span>           <span style="color: #cc66cc;">2</span>          <span style="color: #cc66cc;">0</span>
245CE53C <span style="color: #cc66cc;">3308340376</span> fhtgpcv2m2j4s            <span style="color: #cc66cc;">4</span>          <span style="color: #cc66cc;">1680726256</span> Y          <span style="color: #cc66cc;">1</span>              <span style="color: #cc66cc;">2</span>           <span style="color: #cc66cc;">3</span>          <span style="color: #cc66cc;">0</span>
245CE53C <span style="color: #cc66cc;">3308340376</span> fhtgpcv2m2j4s            <span style="color: #cc66cc;">3</span>          <span style="color: #cc66cc;">1438126164</span> Y          <span style="color: #cc66cc;">1</span>             <span style="color: #cc66cc;">20</span>           <span style="color: #cc66cc;">5</span>          <span style="color: #cc66cc;">0</span>
245CE53C <span style="color: #cc66cc;">3308340376</span> fhtgpcv2m2j4s            <span style="color: #cc66cc;">2</span>           <span style="color: #cc66cc;">451655377</span> Y          <span style="color: #cc66cc;">1</span>            <span style="color: #cc66cc;">200</span>          <span style="color: #cc66cc;">21</span>          <span style="color: #cc66cc;">0</span>
245CE53C <span style="color: #cc66cc;">3308340376</span> fhtgpcv2m2j4s            <span style="color: #cc66cc;">1</span>          <span style="color: #cc66cc;">4078512309</span> Y          <span style="color: #cc66cc;">1</span>           <span style="color: #cc66cc;">2000</span>         <span style="color: #cc66cc;">169</span>          <span style="color: #cc66cc;">0</span>
245CE53C <span style="color: #cc66cc;">3308340376</span> fhtgpcv2m2j4s            <span style="color: #cc66cc;">0</span>           <span style="color: #cc66cc;">479772785</span> Y          <span style="color: #cc66cc;">1</span>         <span style="color: #cc66cc;">100000</span>        <span style="color: #cc66cc;">9823</span>          <span style="color: #cc66cc;">0</span>
&nbsp;
<span style="color: #cc66cc;">7</span> rows selected<span style="color: #66cc66;">.</span>
&nbsp;
SQL<span style="color: #66cc66;">&gt;</span> <span style="color: #993333; font-weight: bold;">SELECT</span> <span style="color: #66cc66;">*</span> <span style="color: #993333; font-weight: bold;">FROM</span> v$sql_cs_selectivity <span style="color: #993333; font-weight: bold;">WHERE</span> sql_id <span style="color: #66cc66;">=</span> <span style="color: #ff0000;">'fhtgpcv2m2j4s'</span>;
&nbsp;
ADDRESS  HASH_VALUE SQL_ID        CHILD_NUMBER PREDICATE                                  RANGE_ID LOW        HIGH
<span style="color: #808080; font-style: italic;">-------- ---------- ------------- ------------ ---------------------------------------- ---------- ---------- ----------</span>
245CE53C <span style="color: #cc66cc;">3308340376</span> fhtgpcv2m2j4s            <span style="color: #cc66cc;">5</span> <span style="color: #66cc66;">=</span>MYVAR                                            <span style="color: #cc66cc;">0</span> <span style="color: #cc66cc;">0.000004</span>   <span style="color: #cc66cc;">0.010773</span>
245CE53C <span style="color: #cc66cc;">3308340376</span> fhtgpcv2m2j4s            <span style="color: #cc66cc;">4</span> <span style="color: #66cc66;">=</span>MYVAR                                            <span style="color: #cc66cc;">0</span> <span style="color: #cc66cc;">0.000009</span>   <span style="color: #cc66cc;">0.010773</span>
245CE53C <span style="color: #cc66cc;">3308340376</span> fhtgpcv2m2j4s            <span style="color: #cc66cc;">3</span> <span style="color: #66cc66;">=</span>MYVAR                                            <span style="color: #cc66cc;">0</span> <span style="color: #cc66cc;">0.000088</span>   <span style="color: #cc66cc;">0.010773</span>
245CE53C <span style="color: #cc66cc;">3308340376</span> fhtgpcv2m2j4s            <span style="color: #cc66cc;">2</span> <span style="color: #66cc66;">=</span>MYVAR                                            <span style="color: #cc66cc;">0</span> <span style="color: #cc66cc;">0.000881</span>   <span style="color: #cc66cc;">0.010773</span>
245CE53C <span style="color: #cc66cc;">3308340376</span> fhtgpcv2m2j4s            <span style="color: #cc66cc;">1</span> <span style="color: #66cc66;">=</span>MYVAR                                            <span style="color: #cc66cc;">0</span> <span style="color: #cc66cc;">0.008814</span>   <span style="color: #cc66cc;">0.010773</span></pre></td></tr></table></div>

<p>It is not clear, why the cursors are not shared and why this is expressed in the flag &#8220;row_level_sec_mismatch&#8221;. From these tests we can see that the number of child cursors is still quite high.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ora-solutions.net/web/2009/03/12/intelligent-aka-adaptive-cursor-sharing-problem/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>
