<?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: Hidden SQL &#8211; why can&#8217;t I find my SQL Text?</title>
	<atom:link href="http://kerryosborne.oracle-guy.com/2009/04/hidden-sql-why-cant-i-find-my-sql-text/feed/" rel="self" type="application/rss+xml" />
	<link>http://kerryosborne.oracle-guy.com/2009/04/hidden-sql-why-cant-i-find-my-sql-text/</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: Paul</title>
		<link>http://kerryosborne.oracle-guy.com/2009/04/hidden-sql-why-cant-i-find-my-sql-text/#comment-44455</link>
		<dc:creator>Paul</dc:creator>
		<pubDate>Thu, 02 Jun 2011 03:40:15 +0000</pubDate>
		<guid isPermaLink="false">http://kerryosborne.oracle-guy.com/?p=1161#comment-44455</guid>
		<description>Thanks for this great post.   Those darn &quot;table_#~_@%_!?#&quot;  sql statements have really been annoying - they just sit there in v$open_cursor and tell you nothing.. prev_sql_id indeed!</description>
		<content:encoded><![CDATA[<p>Thanks for this great post.   Those darn &#8220;table_#~_@%_!?#&#8221;  sql statements have really been annoying &#8211; they just sit there in v$open_cursor and tell you nothing.. prev_sql_id indeed!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mark</title>
		<link>http://kerryosborne.oracle-guy.com/2009/04/hidden-sql-why-cant-i-find-my-sql-text/#comment-44079</link>
		<dc:creator>Mark</dc:creator>
		<pubDate>Wed, 25 May 2011 17:08:48 +0000</pubDate>
		<guid isPermaLink="false">http://kerryosborne.oracle-guy.com/?p=1161#comment-44079</guid>
		<description>Hi Kerry,
I had a similar case and followed your article. But, if the &quot;unknown&quot; sql took place a while ago:
- the session may be gone, therefore no info on prev_sql_id, or open cursor
- the session may still be connected, so you may still find the open cursor for the sql_id, but even if it&#039;s there, the current sql id and prev sql id may already be for the sql executed long after the one we are looking for
Unless I&#039;m missing somehting, in the above conditions, it is more of a guessing game. The most helpfull for me was that I was able to identify an open cursor with &quot;table_...&quot; and based on that the actual table containing the LOB column. That combined with some knowledge of the application gave me enough info to talk to the developers.</description>
		<content:encoded><![CDATA[<p>Hi Kerry,<br />
I had a similar case and followed your article. But, if the &#8220;unknown&#8221; sql took place a while ago:<br />
- the session may be gone, therefore no info on prev_sql_id, or open cursor<br />
- the session may still be connected, so you may still find the open cursor for the sql_id, but even if it&#8217;s there, the current sql id and prev sql id may already be for the sql executed long after the one we are looking for<br />
Unless I&#8217;m missing somehting, in the above conditions, it is more of a guessing game. The most helpfull for me was that I was able to identify an open cursor with &#8220;table_&#8230;&#8221; and based on that the actual table containing the LOB column. That combined with some knowledge of the application gave me enough info to talk to the developers.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kellyn Pedersen</title>
		<link>http://kerryosborne.oracle-guy.com/2009/04/hidden-sql-why-cant-i-find-my-sql-text/#comment-31247</link>
		<dc:creator>Kellyn Pedersen</dc:creator>
		<pubDate>Thu, 02 Dec 2010 02:09:45 +0000</pubDate>
		<guid isPermaLink="false">http://kerryosborne.oracle-guy.com/?p=1161#comment-31247</guid>
		<description>Great article, Kerry!  I&#039;ve worked through this same problem, but you worked through it efficiently without all the dead-ends I tripped down.  Wish I had found your article before I&#039;d taken this on by myself, would have saved myself a ton of time! :)
Kellyn</description>
		<content:encoded><![CDATA[<p>Great article, Kerry!  I&#8217;ve worked through this same problem, but you worked through it efficiently without all the dead-ends I tripped down.  Wish I had found your article before I&#8217;d taken this on by myself, would have saved myself a ton of time! :)<br />
Kellyn</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: osborne</title>
		<link>http://kerryosborne.oracle-guy.com/2009/04/hidden-sql-why-cant-i-find-my-sql-text/#comment-8369</link>
		<dc:creator>osborne</dc:creator>
		<pubDate>Sat, 20 Mar 2010 05:13:42 +0000</pubDate>
		<guid isPermaLink="false">http://kerryosborne.oracle-guy.com/?p=1161#comment-8369</guid>
		<description>Well, the app servers were several states way from the database servers. And the dedicated network connection between them was pretty slow. The statement was executed a lot. Several options for dealing with it presented themselves. 

1. Get a bigger pipe.
2. Reducing frequency - Because the query was executed multiple times per transaction getting only one row at a time, it should have been possible to collapse it into a single multi-row get.
3. Move the app servers - to the datacenter where the database servers resided.
4. Move the data - to the datacenter where the app servers resided.
5. Alter the code - It turned out that the amount of data in the vast majority of the clob&#039;s was only a couple of hundred bytes, but for some reason, SQL*Net padded the field to appx. 80K. Putting a to_char function around the column in the select statement caused the filed to not be padded. I think this may be related to the java variable type they were selecting into. At any rate, another possible solution would have been to alter the code to add the to_char function.
6. Alter the design to get rid of the XML/Clob - since the clob  rarely had more than a couple of hundred bytes, there were many options. All the way from eliminating the XML altogether in favor of columns and rows, to just changing the clob to a varchar2.

In the end, the decision was number 4, moving the data closer to the app servers. This was done by replicating the data via Streams to another instance in the datacenter where the app servers are located. Not my favorite solution, but it required no code changes. We&#039;re still discussion changing the code via to_char and redesign, but the wheels of justice turn slowly.

Kerry</description>
		<content:encoded><![CDATA[<p>Well, the app servers were several states way from the database servers. And the dedicated network connection between them was pretty slow. The statement was executed a lot. Several options for dealing with it presented themselves. </p>
<p>1. Get a bigger pipe.<br />
2. Reducing frequency &#8211; Because the query was executed multiple times per transaction getting only one row at a time, it should have been possible to collapse it into a single multi-row get.<br />
3. Move the app servers &#8211; to the datacenter where the database servers resided.<br />
4. Move the data &#8211; to the datacenter where the app servers resided.<br />
5. Alter the code &#8211; It turned out that the amount of data in the vast majority of the clob&#8217;s was only a couple of hundred bytes, but for some reason, SQL*Net padded the field to appx. 80K. Putting a to_char function around the column in the select statement caused the filed to not be padded. I think this may be related to the java variable type they were selecting into. At any rate, another possible solution would have been to alter the code to add the to_char function.<br />
6. Alter the design to get rid of the XML/Clob &#8211; since the clob  rarely had more than a couple of hundred bytes, there were many options. All the way from eliminating the XML altogether in favor of columns and rows, to just changing the clob to a varchar2.</p>
<p>In the end, the decision was number 4, moving the data closer to the app servers. This was done by replicating the data via Streams to another instance in the datacenter where the app servers are located. Not my favorite solution, but it required no code changes. We&#8217;re still discussion changing the code via to_char and redesign, but the wheels of justice turn slowly.</p>
<p>Kerry</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: abcd_1234</title>
		<link>http://kerryosborne.oracle-guy.com/2009/04/hidden-sql-why-cant-i-find-my-sql-text/#comment-8367</link>
		<dc:creator>abcd_1234</dc:creator>
		<pubDate>Sat, 20 Mar 2010 03:09:22 +0000</pubDate>
		<guid isPermaLink="false">http://kerryosborne.oracle-guy.com/?p=1161#comment-8367</guid>
		<description>It&#039;s an awesome article .... I am in the same situation in trying to figure out why CPU is getting killed ....and troubleshooted based on your article. I was able to figure out the offending sql.

I am quite interested to know how you tuned that query after finding the bottleneck ... Can you share that information ?...</description>
		<content:encoded><![CDATA[<p>It&#8217;s an awesome article &#8230;. I am in the same situation in trying to figure out why CPU is getting killed &#8230;.and troubleshooted based on your article. I was able to figure out the offending sql.</p>
<p>I am quite interested to know how you tuned that query after finding the bottleneck &#8230; Can you share that information ?&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: LOB vs. SQL*Trace &#171; Dion Cho &#8211; Oracle Performance Storyteller</title>
		<link>http://kerryosborne.oracle-guy.com/2009/04/hidden-sql-why-cant-i-find-my-sql-text/#comment-2619</link>
		<dc:creator>LOB vs. SQL*Trace &#171; Dion Cho &#8211; Oracle Performance Storyteller</dc:creator>
		<pubDate>Fri, 19 Jun 2009 02:22:34 +0000</pubDate>
		<guid isPermaLink="false">http://kerryosborne.oracle-guy.com/?p=1161#comment-2619</guid>
		<description>[...] followings are related posts which describe the same phenomenon in the different ways. http://kerryosborne.oracle-guy.com/2009/04/hidden-sql-why-cant-i-find-my-sql-text/ [...]</description>
		<content:encoded><![CDATA[<p>[...] followings are related posts which describe the same phenomenon in the different ways. <a href="http://kerryosborne.oracle-guy.com/2009/04/hidden-sql-why-cant-i-find-my-sql-text/" rel="nofollow">http://kerryosborne.oracle-guy.com/2009/04/hidden-sql-why-cant-i-find-my-sql-text/</a> [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Log Buffer #143: a Carnival of the Vanities for DBAs &#124; Pythian Group Blog</title>
		<link>http://kerryosborne.oracle-guy.com/2009/04/hidden-sql-why-cant-i-find-my-sql-text/#comment-1010</link>
		<dc:creator>Log Buffer #143: a Carnival of the Vanities for DBAs &#124; Pythian Group Blog</dc:creator>
		<pubDate>Fri, 24 Apr 2009 16:45:03 +0000</pubDate>
		<guid isPermaLink="false">http://kerryosborne.oracle-guy.com/?p=1161#comment-1010</guid>
		<description>[...] Osborne wonders about Hidden SQL - why can’t I find my SQL Text?, beginning, &#8220;A very frequently executed statement on a database was generating some waits on [...]</description>
		<content:encoded><![CDATA[<p>[...] Osborne wonders about Hidden SQL &#8211; why can’t I find my SQL Text?, beginning, &#8220;A very frequently executed statement on a database was generating some waits on [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: osborne</title>
		<link>http://kerryosborne.oracle-guy.com/2009/04/hidden-sql-why-cant-i-find-my-sql-text/#comment-894</link>
		<dc:creator>osborne</dc:creator>
		<pubDate>Mon, 20 Apr 2009 13:47:19 +0000</pubDate>
		<guid isPermaLink="false">http://kerryosborne.oracle-guy.com/?p=1161#comment-894</guid>
		<description>Dion,

  Thanks for the pointer on the x$kglob. I&#039;m with you, I don&#039;t want to look at any dumps unless I have too. I hadn&#039;t tried to reproduce this issue until this morning after your comment. But I didn&#039;t have too many problems doing so. The problems for me were all related to doing the test in SQL*Plus. The first was that SQL*Plus spits out DBMS_OUTPUT calls unless you set serveroutput off (so this wiped out the prev_sql_id field in v$session). The second issue is that when the statement  completes, the sql_id field in v$session is  wiped out. The entries still exist in v$open_cursor and the prev_sql_id field still has the original sql_id of the statement which generated the access to the lob. So in order to see the behavior we had in production, my SQL*Plus test required that I catch the session in the act of executing the statement. I haven&#039;t had time to look into that yet. I have captured the data and will add it to the original post as I&#039;m not sure how the formatting would work in the comments section.

   Thanks for your comments.

Kerry</description>
		<content:encoded><![CDATA[<p>Dion,</p>
<p>  Thanks for the pointer on the x$kglob. I&#8217;m with you, I don&#8217;t want to look at any dumps unless I have too. I hadn&#8217;t tried to reproduce this issue until this morning after your comment. But I didn&#8217;t have too many problems doing so. The problems for me were all related to doing the test in SQL*Plus. The first was that SQL*Plus spits out DBMS_OUTPUT calls unless you set serveroutput off (so this wiped out the prev_sql_id field in v$session). The second issue is that when the statement  completes, the sql_id field in v$session is  wiped out. The entries still exist in v$open_cursor and the prev_sql_id field still has the original sql_id of the statement which generated the access to the lob. So in order to see the behavior we had in production, my SQL*Plus test required that I catch the session in the act of executing the statement. I haven&#8217;t had time to look into that yet. I have captured the data and will add it to the original post as I&#8217;m not sure how the formatting would work in the comments section.</p>
<p>   Thanks for your comments.</p>
<p>Kerry</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: LOB, sql_id and LCO &#171; Dion Cho - Oracle Performance Storyteller</title>
		<link>http://kerryosborne.oracle-guy.com/2009/04/hidden-sql-why-cant-i-find-my-sql-text/#comment-889</link>
		<dc:creator>LOB, sql_id and LCO &#171; Dion Cho - Oracle Performance Storyteller</dc:creator>
		<pubDate>Mon, 20 Apr 2009 10:40:02 +0000</pubDate>
		<guid isPermaLink="false">http://kerryosborne.oracle-guy.com/?p=1161#comment-889</guid>
		<description>[...] leave a comment &#187;  Kerry Osborne wrote an interesting case on LOB here. [...]</description>
		<content:encoded><![CDATA[<p>[...] leave a comment &raquo;  Kerry Osborne wrote an interesting case on LOB here. [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dion Cho</title>
		<link>http://kerryosborne.oracle-guy.com/2009/04/hidden-sql-why-cant-i-find-my-sql-text/#comment-887</link>
		<dc:creator>Dion Cho</dc:creator>
		<pubDate>Mon, 20 Apr 2009 09:08:20 +0000</pubDate>
		<guid isPermaLink="false">http://kerryosborne.oracle-guy.com/?p=1161#comment-887</guid>
		<description>Kerry. 

It&#039;s very interesting case even though I could not reproduce your case(SQL*Net more data from client thing).

Anyway, query on x$kglob would have shown some data like:

select * from sys.x$kglob where kglobt03 = &#039;&#039;;

And library cache dump would show the depedent table for the LOB LCO.

But still, hard to decode. :)</description>
		<content:encoded><![CDATA[<p>Kerry. </p>
<p>It&#8217;s very interesting case even though I could not reproduce your case(SQL*Net more data from client thing).</p>
<p>Anyway, query on x$kglob would have shown some data like:</p>
<p>select * from sys.x$kglob where kglobt03 = &#8221;;</p>
<p>And library cache dump would show the depedent table for the LOB LCO.</p>
<p>But still, hard to decode. :)</p>
]]></content:encoded>
	</item>
</channel>
</rss>

