<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Flush A Single SQL Statement</title>
	<atom:link href="http://kerryosborne.oracle-guy.com/2008/09/flush-a-single-sql-statement/feed/" rel="self" type="application/rss+xml" />
	<link>http://kerryosborne.oracle-guy.com/2008/09/flush-a-single-sql-statement/</link>
	<description>Just another Oracle blog</description>
	<lastBuildDate>Mon, 06 Feb 2012 21:28:20 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: osborne</title>
		<link>http://kerryosborne.oracle-guy.com/2008/09/flush-a-single-sql-statement/#comment-42301</link>
		<dc:creator>osborne</dc:creator>
		<pubDate>Thu, 28 Apr 2011 22:29:05 +0000</pubDate>
		<guid isPermaLink="false">http://kerryosborne.oracle-guy.com/?p=114#comment-42301</guid>
		<description>Lisa,

  No I have not run into that issue. But the dbms_shared_pool.purge procedure is very lightly documented. The last parameter is called HEAPS. I have used a value of 1 which seems to dump everything. It may be that there is something unusual about your particular cursor and that a different HEAPS value would cure. So you might try messing with that. Or it may be that the child cursor is still in use and thus preventing it from being flushed. This is probably more likely.

Kerry</description>
		<content:encoded><![CDATA[<p>Lisa,</p>
<p>  No I have not run into that issue. But the dbms_shared_pool.purge procedure is very lightly documented. The last parameter is called HEAPS. I have used a value of 1 which seems to dump everything. It may be that there is something unusual about your particular cursor and that a different HEAPS value would cure. So you might try messing with that. Or it may be that the child cursor is still in use and thus preventing it from being flushed. This is probably more likely.</p>
<p>Kerry</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: LisaG</title>
		<link>http://kerryosborne.oracle-guy.com/2008/09/flush-a-single-sql-statement/#comment-42292</link>
		<dc:creator>LisaG</dc:creator>
		<pubDate>Thu, 28 Apr 2011 20:43:39 +0000</pubDate>
		<guid isPermaLink="false">http://kerryosborne.oracle-guy.com/?p=114#comment-42292</guid>
		<description>Have you encountered any issues with this in 11.2.0.1?  Oracle seems to flush only the last child cursor, not the original one that parsed the query.  The package body is there an valid and I&#039;m not getting any errors out of the procedure.</description>
		<content:encoded><![CDATA[<p>Have you encountered any issues with this in 11.2.0.1?  Oracle seems to flush only the last child cursor, not the original one that parsed the query.  The package body is there an valid and I&#8217;m not getting any errors out of the procedure.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: DanyC</title>
		<link>http://kerryosborne.oracle-guy.com/2008/09/flush-a-single-sql-statement/#comment-34721</link>
		<dc:creator>DanyC</dc:creator>
		<pubDate>Sat, 22 Jan 2011 21:59:34 +0000</pubDate>
		<guid isPermaLink="false">http://kerryosborne.oracle-guy.com/?p=114#comment-34721</guid>
		<description>Kerry - few words: YOU&#039;re a GENIUS !!

Thanks for sharing your knowledge on this blog.</description>
		<content:encoded><![CDATA[<p>Kerry &#8211; few words: YOU&#8217;re a GENIUS !!</p>
<p>Thanks for sharing your knowledge on this blog.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: osborne</title>
		<link>http://kerryosborne.oracle-guy.com/2008/09/flush-a-single-sql-statement/#comment-18029</link>
		<dc:creator>osborne</dc:creator>
		<pubDate>Thu, 12 Aug 2010 15:59:08 +0000</pubDate>
		<guid isPermaLink="false">http://kerryosborne.oracle-guy.com/?p=114#comment-18029</guid>
		<description>Rich,

  Yes - dbms_shared_pool.keep is supposed to be able to pin individual SQL statements as well. Here&#039;s a couple of scripts. The first one takes a sql_id and pins the statement. The second one shows all the pinned statements.

SYS@LAB112&gt; !cat pin_sql.sql
set serveroutput on
set pagesize 9999
set linesize 155
accept sql_id -
       prompt &#039;Enter value for sql_id: &#039; 

DECLARE
name1 varchar2(30);
sql_string varchar2(300);
BEGIN

select address&#124;&#124;&#039;, &#039;&#124;&#124;hash_value into name1
from v$sqlarea 
where sql_id like &#039;&amp;&amp;sql_id&#039;;
   dbms_output.put_line(name1);

sys.dbms_shared_pool.keep(name1, &#039;C&#039;);

dbms_output.put_line(&#039;SQL_ID &#039;&#124;&#124;&#039;&amp;&amp;sql_id&#039;&#124;&#124;&#039; pinned.&#039;);

END;
/
undef sql_id

======================

SYS@LAB112&gt; !cat fs_pinned.sql
col name for a60 wrap
SELECT distinct sql_id, oc.name, oc.type
FROM v$DB_OBJECT_CACHE oc, v$sql sa
WHERE oc.hash_value = sa.hash_value
and kept = &#039;YES&#039;
AND TYPE = &#039;CURSOR&#039;
/</description>
		<content:encoded><![CDATA[<p>Rich,</p>
<p>  Yes &#8211; dbms_shared_pool.keep is supposed to be able to pin individual SQL statements as well. Here&#8217;s a couple of scripts. The first one takes a sql_id and pins the statement. The second one shows all the pinned statements.</p>
<p>SYS@LAB112> !cat pin_sql.sql<br />
set serveroutput on<br />
set pagesize 9999<br />
set linesize 155<br />
accept sql_id -<br />
       prompt &#8216;Enter value for sql_id: &#8216; </p>
<p>DECLARE<br />
name1 varchar2(30);<br />
sql_string varchar2(300);<br />
BEGIN</p>
<p>select address||&#8217;, &#8216;||hash_value into name1<br />
from v$sqlarea<br />
where sql_id like &#8216;&#038;&#038;sql_id&#8217;;<br />
   dbms_output.put_line(name1);</p>
<p>sys.dbms_shared_pool.keep(name1, &#8216;C&#8217;);</p>
<p>dbms_output.put_line(&#8216;SQL_ID &#8216;||&#8217;&#038;&#038;sql_id&#8217;||&#8217; pinned.&#8217;);</p>
<p>END;<br />
/<br />
undef sql_id</p>
<p>======================</p>
<p>SYS@LAB112> !cat fs_pinned.sql<br />
col name for a60 wrap<br />
SELECT distinct sql_id, oc.name, oc.type<br />
FROM v$DB_OBJECT_CACHE oc, v$sql sa<br />
WHERE oc.hash_value = sa.hash_value<br />
and kept = &#8216;YES&#8217;<br />
AND TYPE = &#8216;CURSOR&#8217;<br />
/</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rich</title>
		<link>http://kerryosborne.oracle-guy.com/2008/09/flush-a-single-sql-statement/#comment-17989</link>
		<dc:creator>Rich</dc:creator>
		<pubDate>Thu, 12 Aug 2010 06:27:27 +0000</pubDate>
		<guid isPermaLink="false">http://kerryosborne.oracle-guy.com/?p=114#comment-17989</guid>
		<description>hi,
this is really nice to know. I have another question, suppose I have sql which I want to keep in shared pool permanently like we pin the procedures.
is it possible ?

Rich</description>
		<content:encoded><![CDATA[<p>hi,<br />
this is really nice to know. I have another question, suppose I have sql which I want to keep in shared pool permanently like we pin the procedures.<br />
is it possible ?</p>
<p>Rich</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Eric Cloutier</title>
		<link>http://kerryosborne.oracle-guy.com/2008/09/flush-a-single-sql-statement/#comment-12273</link>
		<dc:creator>Eric Cloutier</dc:creator>
		<pubDate>Tue, 15 Jun 2010 19:12:19 +0000</pubDate>
		<guid isPermaLink="false">http://kerryosborne.oracle-guy.com/?p=114#comment-12273</guid>
		<description>Thank you for your blog.</description>
		<content:encoded><![CDATA[<p>Thank you for your blog.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: osborne</title>
		<link>http://kerryosborne.oracle-guy.com/2008/09/flush-a-single-sql-statement/#comment-7369</link>
		<dc:creator>osborne</dc:creator>
		<pubDate>Mon, 15 Feb 2010 17:09:54 +0000</pubDate>
		<guid isPermaLink="false">http://kerryosborne.oracle-guy.com/?p=114#comment-7369</guid>
		<description>Thanks David. 

You&#039;re exactly right. There is another script that gets run by dbmspool.sql (prvtpool.plb). 

I see the &quot;Package body created.&quot; message in a previous comment, but at any rate I just re-ran it. Here&#039;s the output I got:

SQL&gt; @dbmspool

Package created.


Grant succeeded.


View created.


Package body created.</description>
		<content:encoded><![CDATA[<p>Thanks David. </p>
<p>You&#8217;re exactly right. There is another script that gets run by dbmspool.sql (prvtpool.plb). </p>
<p>I see the &#8220;Package body created.&#8221; message in a previous comment, but at any rate I just re-ran it. Here&#8217;s the output I got:</p>
<p>SQL> @dbmspool</p>
<p>Package created.</p>
<p>Grant succeeded.</p>
<p>View created.</p>
<p>Package body created.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: David Fitzjarrell</title>
		<link>http://kerryosborne.oracle-guy.com/2008/09/flush-a-single-sql-statement/#comment-7368</link>
		<dc:creator>David Fitzjarrell</dc:creator>
		<pubDate>Mon, 15 Feb 2010 16:53:37 +0000</pubDate>
		<guid isPermaLink="false">http://kerryosborne.oracle-guy.com/?p=114#comment-7368</guid>
		<description>The script dbmspool11g.sql only creates the package specification, not the body, and it does invalidate the current package body because it doesn&#039;t match the current spec.  Look inside the script and you&#039;ll find only a CREATE OR REPLACE PACKAGE ... command; there will also be a .plb file in the same location which will create the package body to match the specification.  The ?/rdbms/admin/dbmspool.sql script which Kerry used creates the package spec and calls the wrapped script to create the corresponding package body.  All I see in your posted output is &#039;Package created.&#039;; there should also be the following messge:

&quot;Package body created.&quot;

for this to function correctly.

If you can&#039;t find a corresponding .plb file for the dbmspool11g.sql script I suggest you run the listed dbmspool.sql script to get the spec and body created correctly.</description>
		<content:encoded><![CDATA[<p>The script dbmspool11g.sql only creates the package specification, not the body, and it does invalidate the current package body because it doesn&#8217;t match the current spec.  Look inside the script and you&#8217;ll find only a CREATE OR REPLACE PACKAGE &#8230; command; there will also be a .plb file in the same location which will create the package body to match the specification.  The ?/rdbms/admin/dbmspool.sql script which Kerry used creates the package spec and calls the wrapped script to create the corresponding package body.  All I see in your posted output is &#8216;Package created.&#8217;; there should also be the following messge:</p>
<p>&#8220;Package body created.&#8221;</p>
<p>for this to function correctly.</p>
<p>If you can&#8217;t find a corresponding .plb file for the dbmspool11g.sql script I suggest you run the listed dbmspool.sql script to get the spec and body created correctly.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: osborne</title>
		<link>http://kerryosborne.oracle-guy.com/2008/09/flush-a-single-sql-statement/#comment-7299</link>
		<dc:creator>osborne</dc:creator>
		<pubDate>Sat, 13 Feb 2010 16:15:55 +0000</pubDate>
		<guid isPermaLink="false">http://kerryosborne.oracle-guy.com/?p=114#comment-7299</guid>
		<description>No, I haven&#039;t run into that problem. Sorry. The file that I executed was called called dbmspool.sql (the back ported version) not dbmspool11g.sql. Might try checking with support or the other &quot;trick&quot; way using the create outline, drop outline method I talked about here: 

http://kerryosborne.oracle-guy.com/2008/12/flush-a-single-sql-statement-take-2/. 

(although that method is a bit flaky due to using Outlines)

Kerry</description>
		<content:encoded><![CDATA[<p>No, I haven&#8217;t run into that problem. Sorry. The file that I executed was called called dbmspool.sql (the back ported version) not dbmspool11g.sql. Might try checking with support or the other &#8220;trick&#8221; way using the create outline, drop outline method I talked about here: </p>
<p><a href="http://kerryosborne.oracle-guy.com/2008/12/flush-a-single-sql-statement-take-2/" rel="nofollow">http://kerryosborne.oracle-guy.com/2008/12/flush-a-single-sql-statement-take-2/</a>. </p>
<p>(although that method is a bit flaky due to using Outlines)</p>
<p>Kerry</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: JMIZE</title>
		<link>http://kerryosborne.oracle-guy.com/2008/09/flush-a-single-sql-statement/#comment-7249</link>
		<dc:creator>JMIZE</dc:creator>
		<pubDate>Thu, 11 Feb 2010 16:11:29 +0000</pubDate>
		<guid isPermaLink="false">http://kerryosborne.oracle-guy.com/?p=114#comment-7249</guid>
		<description>Kerry - has anyone ever indicated that the pbod for dbms_shared_pool becomes invalidated with the 10.2.0.4.0 patch or 11g dbmspool.sql is loaded? I came upon your post during a production issue we are having with bad plans on peeked binds. This seems like the perfect solution if I could get it to work. I have recreated this both on HPUX and Linux. 

sys@BKUP&gt; @dbmspool11g.sql

Package created.


Grant succeeded.

sys@BKUP&gt; exec dbms_shared_pool.purge(&#039;0000000181E6C1F0,3606220645&#039;, &#039;C&#039;, 1);
BEGIN dbms_shared_pool.purge(&#039;0000000181E6C1F0,3606220645&#039;, &#039;C&#039;, 1); END;

*
ERROR at line 1:
ORA-04063: package body &quot;SYS.DBMS_SHARED_POOL&quot; has errors
ORA-06508: PL/SQL: could not find program unit being called: &quot;SYS.DBMS_SHARED_POOL&quot;
ORA-06512: at line 1</description>
		<content:encoded><![CDATA[<p>Kerry &#8211; has anyone ever indicated that the pbod for dbms_shared_pool becomes invalidated with the 10.2.0.4.0 patch or 11g dbmspool.sql is loaded? I came upon your post during a production issue we are having with bad plans on peeked binds. This seems like the perfect solution if I could get it to work. I have recreated this both on HPUX and Linux. </p>
<p>sys@BKUP&gt; @dbmspool11g.sql</p>
<p>Package created.</p>
<p>Grant succeeded.</p>
<p>sys@BKUP&gt; exec dbms_shared_pool.purge(&#8217;0000000181E6C1F0,3606220645&#8242;, &#8216;C&#8217;, 1);<br />
BEGIN dbms_shared_pool.purge(&#8217;0000000181E6C1F0,3606220645&#8242;, &#8216;C&#8217;, 1); END;</p>
<p>*<br />
ERROR at line 1:<br />
ORA-04063: package body &#8220;SYS.DBMS_SHARED_POOL&#8221; has errors<br />
ORA-06508: PL/SQL: could not find program unit being called: &#8220;SYS.DBMS_SHARED_POOL&#8221;<br />
ORA-06512: at line 1</p>
]]></content:encoded>
	</item>
</channel>
</rss>

