<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments on: Using TKPROF for Analyzing 10046 Extended SQL Trace Files &#8211; What is Wrong with this Quote?</title>
	<atom:link href="http://hoopercharles.wordpress.com/2011/09/21/using-tkprof-for-analyzing-10046-extended-sql-trace-files-what-is-wrong-with-this-quote/feed/" rel="self" type="application/rss+xml" />
	<link>http://hoopercharles.wordpress.com/2011/09/21/using-tkprof-for-analyzing-10046-extended-sql-trace-files-what-is-wrong-with-this-quote/</link>
	<description>Miscellaneous Random Oracle Topics: Stop, Think, ... Understand</description>
	<lastBuildDate>Mon, 13 May 2013 14:10:06 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
	<item>
		<title>By: Charles Hooper</title>
		<link>http://hoopercharles.wordpress.com/2011/09/21/using-tkprof-for-analyzing-10046-extended-sql-trace-files-what-is-wrong-with-this-quote/#comment-3983</link>
		<dc:creator><![CDATA[Charles Hooper]]></dc:creator>
		<pubDate>Wed, 28 Sep 2011 13:06:35 +0000</pubDate>
		<guid isPermaLink="false">http://hoopercharles.wordpress.com/?p=5449#comment-3983</guid>
		<description><![CDATA[Another documentation bug? - I think that would be #5 or #6 that have been mentioned on this blog by various people.  :-)

The book was heading in the right direction, but completely missed the opportunity to demonstrate something that is useful.  This recipe was about 10046 extended SQL traces, and thus apparently could not offer in the recipe format a demonstration of how what was statement might work, or offer an alternative such as that offered by Mladen above.

The multiple interpretations of the quoted section of the book probably was not intentional, but it can lead to some confusion.  I agree that the term &quot;query&quot; is fuzzy.  Does one &quot;query&quot; a witness to determine what happened, or does one &quot;query&quot; a witness to change what happened?]]></description>
		<content:encoded><![CDATA[<p>Another documentation bug? &#8211; I think that would be #5 or #6 that have been mentioned on this blog by various people.  <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>The book was heading in the right direction, but completely missed the opportunity to demonstrate something that is useful.  This recipe was about 10046 extended SQL traces, and thus apparently could not offer in the recipe format a demonstration of how what was statement might work, or offer an alternative such as that offered by Mladen above.</p>
<p>The multiple interpretations of the quoted section of the book probably was not intentional, but it can lead to some confusion.  I agree that the term &#8220;query&#8221; is fuzzy.  Does one &#8220;query&#8221; a witness to determine what happened, or does one &#8220;query&#8221; a witness to change what happened?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Gary Myers (@syd_oracle)</title>
		<link>http://hoopercharles.wordpress.com/2011/09/21/using-tkprof-for-analyzing-10046-extended-sql-trace-files-what-is-wrong-with-this-quote/#comment-3980</link>
		<dc:creator><![CDATA[Gary Myers (@syd_oracle)]]></dc:creator>
		<pubDate>Sun, 25 Sep 2011 03:54:15 +0000</pubDate>
		<guid isPermaLink="false">http://hoopercharles.wordpress.com/?p=5449#comment-3980</guid>
		<description><![CDATA[The term &#039;query&#039;  can be fuzzy. Does it refer to just SELECT or does an UPDATE or DELETE imply the data is being queried. How about the SELECT part of an INSERT ...SELECT ? Is a SELECT...FOR UPDATE &#039;just&#039; a query ? It only requires SELECT permissions, not UPDATE.

The quotes from the documentation are outdated. The RETURNING clause of INSERTs, UPDATEs and DELETEs return a result set as well as success/failure. They&#039;ve always returned the number of rows affected too.

So I think it may be a case of what is wrong with the quotes from the Oracle documentation :)]]></description>
		<content:encoded><![CDATA[<p>The term &#8216;query&#8217;  can be fuzzy. Does it refer to just SELECT or does an UPDATE or DELETE imply the data is being queried. How about the SELECT part of an INSERT &#8230;SELECT ? Is a SELECT&#8230;FOR UPDATE &#8216;just&#8217; a query ? It only requires SELECT permissions, not UPDATE.</p>
<p>The quotes from the documentation are outdated. The RETURNING clause of INSERTs, UPDATEs and DELETEs return a result set as well as success/failure. They&#8217;ve always returned the number of rows affected too.</p>
<p>So I think it may be a case of what is wrong with the quotes from the Oracle documentation <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Charles Hooper</title>
		<link>http://hoopercharles.wordpress.com/2011/09/21/using-tkprof-for-analyzing-10046-extended-sql-trace-files-what-is-wrong-with-this-quote/#comment-3979</link>
		<dc:creator><![CDATA[Charles Hooper]]></dc:creator>
		<pubDate>Thu, 22 Sep 2011 18:02:11 +0000</pubDate>
		<guid isPermaLink="false">http://hoopercharles.wordpress.com/?p=5449#comment-3979</guid>
		<description><![CDATA[I thought for sure that there were be at least ten comments attached to this blog article by now.

As I mentioned, there are a couple of different potential interpretations of the quoted section from the book.  

The book’s recipes jump around a bit, back and forth between topics.  For example, page 340 also discusses using TKPROF to analyze 10046 extended SQL trace files time, where the book states: “time: Total time (in milliseconds) spent processing the operation”.  So, are the “ela” statistics reported in microseconds while the “time” statistics in the Row Source Execution Plan are shown in milliseconds, or do the two time statistics both measure time in 1/1,000,000 of a second (the 1,000,000 could be rounded up to the nearest power of two on some operating system platforms and Oracle Database release versions).  Does it matter if the reader has one Oracle 8i (8.1.7.4, for example) database as well as an assortment of 9i, 10g, and 11g R2 databases?

You could also focus on the phrase “a query was waiting on a lock”… when would a SELECT statement (using the definition from the Oracle Database Concepts guide, query… to ask a question of the database) wait on a lock?  Of course, readers do not block other readers, readers do not block writers, and writers do not block readers.  A SELECT FOR UPDATE might need to wait on an enqueue, but the “FOR UPDATE” clause likely does not represent common usage in a query for most applications.  If you focus on the phrase “where and why a query was waiting”, as Mladen pointed out, the WHY might not be present in a 10046 extended SQL trace for a session (maybe if you compared simultaneously captured 10046 traces for multiple sessions you would find the WHY).

The following shows how I selected to interpret the quoted section, and the &lt;del datetime=&quot;2011-09-25T10:50:03+00:00&quot;&gt;fule&lt;/del&gt; full recipe for that matter, for the book review:
&lt;blockquote&gt;
Recipe 10-6 states the following, “Note that the TKPROF or other profiling tools show the elapsed times for various phases of query execution, but not the information for locks and latches. If you’re trying to find out if any locks are slowing down a query, look at the raw trace files to see if there are any enqueue waits in the WAIT lines of the raw file.”  I might be misinterpreting these two sentences, but the sentences appear to be incorrect assuming that a level 8 or greater (wait events) extended SQL trace, generated by Oracle Database 10.1 (or higher), is passed into TKPROF.  Starting in Oracle Database 10.1 most of the enqueue waits are divided into much more specific wait events that begin with “enq:” (there are 299 wait events in Oracle Database 11.2.0.2 that begin with “enq:”).  The same is true for latches, where the “latch free” wait event is split out into multiple wait events (there are 43 wait events in Oracle Database 11.2.0.2 for latches). (pages 335-336)
&lt;/blockquote&gt;

Any other comments?]]></description>
		<content:encoded><![CDATA[<p>I thought for sure that there were be at least ten comments attached to this blog article by now.</p>
<p>As I mentioned, there are a couple of different potential interpretations of the quoted section from the book.  </p>
<p>The book’s recipes jump around a bit, back and forth between topics.  For example, page 340 also discusses using TKPROF to analyze 10046 extended SQL trace files time, where the book states: “time: Total time (in milliseconds) spent processing the operation”.  So, are the “ela” statistics reported in microseconds while the “time” statistics in the Row Source Execution Plan are shown in milliseconds, or do the two time statistics both measure time in 1/1,000,000 of a second (the 1,000,000 could be rounded up to the nearest power of two on some operating system platforms and Oracle Database release versions).  Does it matter if the reader has one Oracle 8i (8.1.7.4, for example) database as well as an assortment of 9i, 10g, and 11g R2 databases?</p>
<p>You could also focus on the phrase “a query was waiting on a lock”… when would a SELECT statement (using the definition from the Oracle Database Concepts guide, query… to ask a question of the database) wait on a lock?  Of course, readers do not block other readers, readers do not block writers, and writers do not block readers.  A SELECT FOR UPDATE might need to wait on an enqueue, but the “FOR UPDATE” clause likely does not represent common usage in a query for most applications.  If you focus on the phrase “where and why a query was waiting”, as Mladen pointed out, the WHY might not be present in a 10046 extended SQL trace for a session (maybe if you compared simultaneously captured 10046 traces for multiple sessions you would find the WHY).</p>
<p>The following shows how I selected to interpret the quoted section, and the <del datetime="2011-09-25T10:50:03+00:00">fule</del> full recipe for that matter, for the book review:</p>
<blockquote><p>
Recipe 10-6 states the following, “Note that the TKPROF or other profiling tools show the elapsed times for various phases of query execution, but not the information for locks and latches. If you’re trying to find out if any locks are slowing down a query, look at the raw trace files to see if there are any enqueue waits in the WAIT lines of the raw file.”  I might be misinterpreting these two sentences, but the sentences appear to be incorrect assuming that a level 8 or greater (wait events) extended SQL trace, generated by Oracle Database 10.1 (or higher), is passed into TKPROF.  Starting in Oracle Database 10.1 most of the enqueue waits are divided into much more specific wait events that begin with “enq:” (there are 299 wait events in Oracle Database 11.2.0.2 that begin with “enq:”).  The same is true for latches, where the “latch free” wait event is split out into multiple wait events (there are 43 wait events in Oracle Database 11.2.0.2 for latches). (pages 335-336)
</p></blockquote>
<p>Any other comments?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Charles Hooper</title>
		<link>http://hoopercharles.wordpress.com/2011/09/21/using-tkprof-for-analyzing-10046-extended-sql-trace-files-what-is-wrong-with-this-quote/#comment-3977</link>
		<dc:creator><![CDATA[Charles Hooper]]></dc:creator>
		<pubDate>Wed, 21 Sep 2011 20:02:51 +0000</pubDate>
		<guid isPermaLink="false">http://hoopercharles.wordpress.com/?p=5449#comment-3977</guid>
		<description><![CDATA[Maybe some hints for a third possible interpretation of the quoted section from the book, with the help of the Oracle Database documentation library:
http://download.oracle.com/docs/cd/E14072_01/server.112/e10713/consist.htm#BABHIGGC
&lt;blockquote&gt;
•A row is locked only when modified by a writer.
•A writer of a row blocks a concurrent writer of the same row.
•A reader never blocks a writer.
•A writer never blocks a reader.
&lt;/blockquote&gt;

http://download.oracle.com/docs/cd/A57673_01/DOC/server/doc/A48506/sqlconce.htm#1288
&lt;blockquote&gt;
Queries are different from other types of SQL statements because they return data as results if they are successful. Whereas other statements return simply success or failure, a query can return one row or thousands of rows. The results of a query are always in tabular format, and the rows of the result are fetched (retrieved), either a row at a time or in groups. 
&lt;/blockquote&gt;

http://download.oracle.com/docs/cd/B28359_01/server.111/b28318/sqlplsql.htm#CNCPT1914
&lt;blockquote&gt;
Queries are different from other types of SQL statements because, if successful, they return data as results. Whereas other statements simply return success or failure, a query can return one row or thousands of rows. The results of a query are always in tabular format, and the rows of the result are fetched (retrieved), either a row at a time or in groups.
&lt;/blockquote&gt;]]></description>
		<content:encoded><![CDATA[<p>Maybe some hints for a third possible interpretation of the quoted section from the book, with the help of the Oracle Database documentation library:<br />
<a href="http://download.oracle.com/docs/cd/E14072_01/server.112/e10713/consist.htm#BABHIGGC" rel="nofollow">http://download.oracle.com/docs/cd/E14072_01/server.112/e10713/consist.htm#BABHIGGC</a></p>
<blockquote><p>
•A row is locked only when modified by a writer.<br />
•A writer of a row blocks a concurrent writer of the same row.<br />
•A reader never blocks a writer.<br />
•A writer never blocks a reader.
</p></blockquote>
<p><a href="http://download.oracle.com/docs/cd/A57673_01/DOC/server/doc/A48506/sqlconce.htm#1288" rel="nofollow">http://download.oracle.com/docs/cd/A57673_01/DOC/server/doc/A48506/sqlconce.htm#1288</a></p>
<blockquote><p>
Queries are different from other types of SQL statements because they return data as results if they are successful. Whereas other statements return simply success or failure, a query can return one row or thousands of rows. The results of a query are always in tabular format, and the rows of the result are fetched (retrieved), either a row at a time or in groups.
</p></blockquote>
<p><a href="http://download.oracle.com/docs/cd/B28359_01/server.111/b28318/sqlplsql.htm#CNCPT1914" rel="nofollow">http://download.oracle.com/docs/cd/B28359_01/server.111/b28318/sqlplsql.htm#CNCPT1914</a></p>
<blockquote><p>
Queries are different from other types of SQL statements because, if successful, they return data as results. Whereas other statements simply return success or failure, a query can return one row or thousands of rows. The results of a query are always in tabular format, and the rows of the result are fetched (retrieved), either a row at a time or in groups.
</p></blockquote>
]]></content:encoded>
	</item>
	<item>
		<title>By: Charles Hooper</title>
		<link>http://hoopercharles.wordpress.com/2011/09/21/using-tkprof-for-analyzing-10046-extended-sql-trace-files-what-is-wrong-with-this-quote/#comment-3976</link>
		<dc:creator><![CDATA[Charles Hooper]]></dc:creator>
		<pubDate>Wed, 21 Sep 2011 15:09:03 +0000</pubDate>
		<guid isPermaLink="false">http://hoopercharles.wordpress.com/?p=5449#comment-3976</guid>
		<description><![CDATA[Mladen,

Thanks for stopping by and providing a helpful comment on the blog article. You made valid points and backed up those points with a suggested alternative (one of the planned outcomes of these types of blog article). 

I initially read the quote quite a bit differently than you, and thus came up with a very different comment about what is right or wrong about the quote. I will share the portion of my book review for this recipe in roughly 24-48 hours – until then I will try to limit my comments in this article. Obviously, one of the other planned outcomes of these types of articles is to tap into the vast combined knowledge of readers so that we may build a much more complete picture of how things work than I could put together by myself.]]></description>
		<content:encoded><![CDATA[<p>Mladen,</p>
<p>Thanks for stopping by and providing a helpful comment on the blog article. You made valid points and backed up those points with a suggested alternative (one of the planned outcomes of these types of blog article). </p>
<p>I initially read the quote quite a bit differently than you, and thus came up with a very different comment about what is right or wrong about the quote. I will share the portion of my book review for this recipe in roughly 24-48 hours – until then I will try to limit my comments in this article. Obviously, one of the other planned outcomes of these types of articles is to tap into the vast combined knowledge of readers so that we may build a much more complete picture of how things work than I could put together by myself.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mladen Gogala</title>
		<link>http://hoopercharles.wordpress.com/2011/09/21/using-tkprof-for-analyzing-10046-extended-sql-trace-files-what-is-wrong-with-this-quote/#comment-3974</link>
		<dc:creator><![CDATA[Mladen Gogala]]></dc:creator>
		<pubDate>Wed, 21 Sep 2011 14:47:11 +0000</pubDate>
		<guid isPermaLink="false">http://hoopercharles.wordpress.com/?p=5449#comment-3974</guid>
		<description><![CDATA[Charles, 10046 doesn&#039;t show you the reason. It only shows wait events, without any particular details. Locking contention can only be explored while it lasts, by digging into V$LOCK table and V$SESSION to find out the object, file, block and row that is being waited on. This quote is plain wrong. 
PS:
-----
After our little debate on CDOS, I added your blog to my mandatory reading list.]]></description>
		<content:encoded><![CDATA[<p>Charles, 10046 doesn&#8217;t show you the reason. It only shows wait events, without any particular details. Locking contention can only be explored while it lasts, by digging into V$LOCK table and V$SESSION to find out the object, file, block and row that is being waited on. This quote is plain wrong.<br />
PS:<br />
&#8212;&#8211;<br />
After our little debate on CDOS, I added your blog to my mandatory reading list.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
