Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>This appears to be a bug discovered fairly recently. <a href="https://support.oracle.com/CSP/ui/flash.html#tab=KBHome%28page=KBHome&amp;id=%28%29%29,%28page=KBNavigator&amp;id=%28bmDocTitle=PL/SQL%20RETURNING%20REF%20CURSOR%20ACTS%20DIFFERENTLY%20ON%2011.1.0.6%20VS%2010.2.0.5&amp;bmDocID=10425196&amp;bmDocType=BUG&amp;bmDocDsrc=BUG&amp;viewingMode=1143&amp;from=BOOKMARK%29%29" rel="nofollow">Metalink Bug 1045196</a> describes the exact problem. Hopefully a patch will be released soon. For those of you who can't get past the Metalink wall here are a few details:</p> <h2>Metalink</h2> <p>Bug 10425196: PL/SQL RETURNING REF CURSOR ACTS DIFFERENTLY ON 11.1.0.6 VS 10.2.0.5 </p> <p>Type: Defect<br> Severity: 2 - Severe Loss of Service<br> Status: Code Bug Created: 22-Dec-2010 </p> <p><i>DIAGNOSTIC ANALYSIS from original case submission</i>:<br> - 10.2.0.4 Windows Expected Behavior<br> - 10.2.0.5 Solaris Expected Behavior<br> - 11.1.0.6 Solaris Un-Expected Behavior<br> - 11.1.0.7 Windows Un-Expected Behavior<br> - 11.2.0.1 Solaris Un-Expected Behavior<br> - 11.2.0.2 Solaris Un-Expected Behavior </p> <p><i>FURTHER DETAILS I can confirm</i>:<br> - 10.2.0.3 Windows Expected Behavior<br> - 11.2.0.1 Windows Un-Expected Behavior </p> <h2>Additional Details</h2> <p>Changing the <i>OPTIMIZER_FEATURES_ENABLE='10.2.0.4'</i> parameter does not resolve the problem. So it seems to be related more to a design change in the 11g database engine rather than an optimizer tweak.</p> <h2>Code Workaround</h2> <p>This appears to be a result of the use of the index when querying the table and not the act of updating the table and/or committing. Using my example above, here are two ways to ensure the query does not use the index. Both may affect the performance of the query. </p> <p>Affecting the performance of the query might be temporarily acceptable until a patch is released but I believe that using FLASHBACK as @Edgar Chupit suggested could affect the performance of the entire instance (or may not be available on some instances) so that option may not be acceptable for some. Either way, at this point in time code changes appear to be the only known workaround.</p> <p><b>Method 1</b>: Change your code to wrap the column in a function to prevent the unique index on this one column from being used. In my case this is acceptable because although the column is unique it will never contain lower case characters.</p> <pre><code> SELECT col1 FROM tbl1 WHERE UPPER(col1) = 'TEST1' AND col2 = 0; </code></pre> <p><b>Method 2</b>: Change your query to use a hint preventing the index from being used. You might expect the <i>NO_INDEX(unique_col1)</i> hint to work, but it does not. The <i>RULE</i> hint does not work. You can use the <i>FULL(tbl1)</i> hint but it's likely that this may slow down your query more than using <strong>method 1</strong>.</p> <pre><code> SELECT /*+ FULL(tbl1) */ col1 FROM tbl1 WHERE col1 = 'TEST1' AND col2 = 0; </code></pre> <p><br /></p> <h2>Oracle's Response and Proposed Workaround</h2> <p>Oracle support has finally responded with the following Metalink update:</p> <pre> <b>Oracle Support - July 20, 2011 5:51:19 AM GMT-07:00 [ODM Proposed Solution(s)]</b> Development has reported this will be a significant issue to fix and has suggested that the following workaround be applied: edit init.ora/spfile with the following undocumented parameter: "_row_cr" = false <b>Oracle Support - July 20, 2011 5:49:20 AM GMT-07:00 [ODM Cause Justification]</b> Development has determined this to be a defect <b>Oracle Support - July 20, 2011 5:48:27 AM GMT-07:00 [ODM Cause Determination]</b> Cause has been traced to a row source cursor optimization <b>Oracle Support - July 20, 2011 5:47:27 AM GMT-07:00 [ODM Issue Verification]</b> Development has confirmed this to be an issue in 11.2.0.1 </pre> <p>After some further correspondence it sounds as though this isn't being treated as a bug so much as a design decision moving forward:</p> <pre> <b>Oracle Support - July 21, 2011 5:58:07 AM GMT-07:00 [ODM Proposed Solution Justif]</b> From 10.2.0.5 onward (which includes 11.2.0.2) we have an optimization called ROW CR it is only applicable to queries which use an unique index to determine the row in the table. A brief overview of this optimization is that we try to avoid rollbacks while constructing a CR block if the present block has no uncommitted changes. So the difference seen in 11.2.0.2 is because of this optimization. The suggested workaround is to turn off of this optimization so that things will work exactly as they used to work in 10.2.0.4 </pre> <p>In our case, given our client environments and since it is isolated to a single stored procedure we will continue to use our <b>code workaround</b> to prevent any unknown instance-wide side effects from affecting other applications and users.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload