<?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: Advanced Oracle Troubleshooting Guide, Part 5: Sampling V$ stuff with WaitProf. Really fast. Using SQL!</title>
	<atom:link href="http://blog.tanelpoder.com/2008/06/06/advanced-oracle-troubleshooting-guide-part-5-sampling-v-stuff-with-waitprof-really-fast-using-sql/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.tanelpoder.com/2008/06/06/advanced-oracle-troubleshooting-guide-part-5-sampling-v-stuff-with-waitprof-really-fast-using-sql/</link>
	<description>Oracle troubleshooting, internals and performance tuning</description>
	<lastBuildDate>Mon, 15 Mar 2010 01:50:11 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Advanced Oracle Troubleshooting Guide, Part 7: Sampling latch holder statistics using LatchProf &#124; Tanel Poder's blog: Core IT for Geeks and Pros</title>
		<link>http://blog.tanelpoder.com/2008/06/06/advanced-oracle-troubleshooting-guide-part-5-sampling-v-stuff-with-waitprof-really-fast-using-sql/comment-page-1/#comment-2675</link>
		<dc:creator>Advanced Oracle Troubleshooting Guide, Part 7: Sampling latch holder statistics using LatchProf &#124; Tanel Poder's blog: Core IT for Geeks and Pros</dc:creator>
		<pubDate>Thu, 01 Oct 2009 05:51:45 +0000</pubDate>
		<guid isPermaLink="false">http://tanelpoder.wordpress.com/2008/06/06/advanced-oracle-troubleshooting-guide-part-5-sampling-v-stuff-with-waitprof-really-fast-using-sql/#comment-2675</guid>
		<description>[...] is a script similar to WaitProf, only it samples latch holder statistics from V$LATCHHOLDER. As V$LATCHHOLDER contains a SID column [...]</description>
		<content:encoded><![CDATA[<p>[...] is a script similar to WaitProf, only it samples latch holder statistics from V$LATCHHOLDER. As V$LATCHHOLDER contains a SID column [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tanel Poder</title>
		<link>http://blog.tanelpoder.com/2008/06/06/advanced-oracle-troubleshooting-guide-part-5-sampling-v-stuff-with-waitprof-really-fast-using-sql/comment-page-1/#comment-2349</link>
		<dc:creator>Tanel Poder</dc:creator>
		<pubDate>Sat, 22 Aug 2009 07:38:32 +0000</pubDate>
		<guid isPermaLink="false">http://tanelpoder.wordpress.com/2008/06/06/advanced-oracle-troubleshooting-guide-part-5-sampling-v-stuff-with-waitprof-really-fast-using-sql/#comment-2349</guid>
		<description>The object name can be deducted from the file# and block_id (parameter1,parameter2) in dba_extents.

I use a script like this, it takes file# and block# as parameters:

select owner, segment_name, partition_name, tablespace_name, extent_id
from dba_extents
where file_id = &amp;1
and &amp;2 between block_id and block_id + blocks - 1;</description>
		<content:encoded><![CDATA[<p>The object name can be deducted from the file# and block_id (parameter1,parameter2) in dba_extents.</p>
<p>I use a script like this, it takes file# and block# as parameters:</p>
<p>select owner, segment_name, partition_name, tablespace_name, extent_id<br />
from dba_extents<br />
where file_id = &#038;1<br />
and &#038;2 between block_id and block_id + blocks &#8211; 1;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tanel Poder</title>
		<link>http://blog.tanelpoder.com/2008/06/06/advanced-oracle-troubleshooting-guide-part-5-sampling-v-stuff-with-waitprof-really-fast-using-sql/comment-page-1/#comment-2348</link>
		<dc:creator>Tanel Poder</dc:creator>
		<pubDate>Sat, 22 Aug 2009 07:37:07 +0000</pubDate>
		<guid isPermaLink="false">http://tanelpoder.wordpress.com/2008/06/06/advanced-oracle-troubleshooting-guide-part-5-sampling-v-stuff-with-waitprof-really-fast-using-sql/#comment-2348</guid>
		<description>High CPU usage is good in some sense - meaning that the session can do its work on CPU without having to wait for anything much. 

Of course if the job/session is still slow then I would run snapper on the session and see whether its perhaps hard parsing a lot or doing lots of logical IOs. In first case the application code must be changed (or cursor_sharing=force parameter can be used as a dirty workaround), in second case the heavy logical IOs may be due an inappropriate nested loop joins looping through the inner rowsources way too many times (revisiting blocks a lot etc)

Of course there are many more reasons for high CPU usage but these two are the first common ones that come into my mind.</description>
		<content:encoded><![CDATA[<p>High CPU usage is good in some sense &#8211; meaning that the session can do its work on CPU without having to wait for anything much. </p>
<p>Of course if the job/session is still slow then I would run snapper on the session and see whether its perhaps hard parsing a lot or doing lots of logical IOs. In first case the application code must be changed (or cursor_sharing=force parameter can be used as a dirty workaround), in second case the heavy logical IOs may be due an inappropriate nested loop joins looping through the inner rowsources way too many times (revisiting blocks a lot etc)</p>
<p>Of course there are many more reasons for high CPU usage but these two are the first common ones that come into my mind.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Maxx</title>
		<link>http://blog.tanelpoder.com/2008/06/06/advanced-oracle-troubleshooting-guide-part-5-sampling-v-stuff-with-waitprof-really-fast-using-sql/comment-page-1/#comment-2330</link>
		<dc:creator>Maxx</dc:creator>
		<pubDate>Wed, 19 Aug 2009 16:32:49 +0000</pubDate>
		<guid isPermaLink="false">http://tanelpoder.wordpress.com/2008/06/06/advanced-oracle-troubleshooting-guide-part-5-sampling-v-stuff-with-waitprof-really-fast-using-sql/#comment-2330</guid>
		<description>This is a great script.  Needed something like this, as we have very tight change control and getting a trace approve take like 2 days and untill then we are expected to see what the waits are and stuff like that.  Couple of suggestions (maybe)...  Yes the script looks at p1, p2, p3 values and point to the datafile#, and block# which can then tell us what table its waiting on.  It would be nice to someway have the script where it gives you p1,p2,p3 value and also tell you the object name.  Just a thought.

Also you mentioned.  &quot;Even though the CPU usage is in the top of the list, it has only used 21.63% of total response time, so the rest 78% of the IO time is the “problem” here.&quot; -- what are some suggestions if its the other way around ??  Lets say i have 78% of CPU usage..what can I do to get that down?? any suggestions ?</description>
		<content:encoded><![CDATA[<p>This is a great script.  Needed something like this, as we have very tight change control and getting a trace approve take like 2 days and untill then we are expected to see what the waits are and stuff like that.  Couple of suggestions (maybe)&#8230;  Yes the script looks at p1, p2, p3 values and point to the datafile#, and block# which can then tell us what table its waiting on.  It would be nice to someway have the script where it gives you p1,p2,p3 value and also tell you the object name.  Just a thought.</p>
<p>Also you mentioned.  &#8220;Even though the CPU usage is in the top of the list, it has only used 21.63% of total response time, so the rest 78% of the IO time is the “problem” here.&#8221; &#8212; what are some suggestions if its the other way around ??  Lets say i have 78% of CPU usage..what can I do to get that down?? any suggestions ?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tanel Poder</title>
		<link>http://blog.tanelpoder.com/2008/06/06/advanced-oracle-troubleshooting-guide-part-5-sampling-v-stuff-with-waitprof-really-fast-using-sql/comment-page-1/#comment-791</link>
		<dc:creator>Tanel Poder</dc:creator>
		<pubDate>Mon, 12 Jan 2009 01:44:36 +0000</pubDate>
		<guid isPermaLink="false">http://tanelpoder.wordpress.com/2008/06/06/advanced-oracle-troubleshooting-guide-part-5-sampling-v-stuff-with-waitprof-really-fast-using-sql/#comment-791</guid>
		<description>Thanks,

Of course you&#039;ve got to watch out that you&#039;re not sampling the wrong X$ tables ultrafrequently as some X$ table access requires latch gets in order to protect the memrory structure while reading it.

The good news is that latchprof / latchprofx help to show what&#039;s the latching impact of an X$ query...</description>
		<content:encoded><![CDATA[<p>Thanks,</p>
<p>Of course you&#8217;ve got to watch out that you&#8217;re not sampling the wrong X$ tables ultrafrequently as some X$ table access requires latch gets in order to protect the memrory structure while reading it.</p>
<p>The good news is that latchprof / latchprofx help to show what&#8217;s the latching impact of an X$ query&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mhthomas</title>
		<link>http://blog.tanelpoder.com/2008/06/06/advanced-oracle-troubleshooting-guide-part-5-sampling-v-stuff-with-waitprof-really-fast-using-sql/comment-page-1/#comment-790</link>
		<dc:creator>mhthomas</dc:creator>
		<pubDate>Sun, 11 Jan 2009 16:08:05 +0000</pubDate>
		<guid isPermaLink="false">http://tanelpoder.wordpress.com/2008/06/06/advanced-oracle-troubleshooting-guide-part-5-sampling-v-stuff-with-waitprof-really-fast-using-sql/#comment-790</guid>
		<description>This is a great idea. This trick solves one &quot;non-performance&quot; related issue I had for two years with X$ tables. Many thanks!

Mike</description>
		<content:encoded><![CDATA[<p>This is a great idea. This trick solves one &#8220;non-performance&#8221; related issue I had for two years with X$ tables. Many thanks!</p>
<p>Mike</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Flexible sampling of any V$ or X$ view with sample.sql &#171; Tanel Poder&#8217;s blog: Core IT for geeks and pros</title>
		<link>http://blog.tanelpoder.com/2008/06/06/advanced-oracle-troubleshooting-guide-part-5-sampling-v-stuff-with-waitprof-really-fast-using-sql/comment-page-1/#comment-387</link>
		<dc:creator>Flexible sampling of any V$ or X$ view with sample.sql &#171; Tanel Poder&#8217;s blog: Core IT for geeks and pros</dc:creator>
		<pubDate>Tue, 26 Aug 2008 10:42:50 +0000</pubDate>
		<guid isPermaLink="false">http://tanelpoder.wordpress.com/2008/06/06/advanced-oracle-troubleshooting-guide-part-5-sampling-v-stuff-with-waitprof-really-fast-using-sql/#comment-387</guid>
		<description>[...] WaitProf [...]</description>
		<content:encoded><![CDATA[<p>[...] WaitProf [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: tanelp</title>
		<link>http://blog.tanelpoder.com/2008/06/06/advanced-oracle-troubleshooting-guide-part-5-sampling-v-stuff-with-waitprof-really-fast-using-sql/comment-page-1/#comment-390</link>
		<dc:creator>tanelp</dc:creator>
		<pubDate>Mon, 18 Aug 2008 13:02:19 +0000</pubDate>
		<guid isPermaLink="false">http://tanelpoder.wordpress.com/2008/06/06/advanced-oracle-troubleshooting-guide-part-5-sampling-v-stuff-with-waitprof-really-fast-using-sql/#comment-390</guid>
		<description>This 1000*1000*1000 trick is just for safe generation of rows (as a recursive connect by over millions of levels will take a lot of PGA memory, therefore I have 3 recursive connect bys over 1000 rows and join them). But this is not the trick which does the high-frequency sampling for me.

The real trick here is that I have deliberately set the join method to NESTED LOOPS and join order so that the X$ tables are inner rowsources. Thus the nested loop join mechanism is doing the sampling for me!

And yes, you&#039;re right, for normal tables the read consistency applies, so you see a single snapshot of data during a query execution time, that&#039;s read consistency. But X$ tables do not have read consistency built in, thus nested loop sampling becomes possible.</description>
		<content:encoded><![CDATA[<p>This 1000*1000*1000 trick is just for safe generation of rows (as a recursive connect by over millions of levels will take a lot of PGA memory, therefore I have 3 recursive connect bys over 1000 rows and join them). But this is not the trick which does the high-frequency sampling for me.</p>
<p>The real trick here is that I have deliberately set the join method to NESTED LOOPS and join order so that the X$ tables are inner rowsources. Thus the nested loop join mechanism is doing the sampling for me!</p>
<p>And yes, you&#8217;re right, for normal tables the read consistency applies, so you see a single snapshot of data during a query execution time, that&#8217;s read consistency. But X$ tables do not have read consistency built in, thus nested loop sampling becomes possible.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: berx</title>
		<link>http://blog.tanelpoder.com/2008/06/06/advanced-oracle-troubleshooting-guide-part-5-sampling-v-stuff-with-waitprof-really-fast-using-sql/comment-page-1/#comment-391</link>
		<dc:creator>berx</dc:creator>
		<pubDate>Fri, 15 Aug 2008 20:50:36 +0000</pubDate>
		<guid isPermaLink="false">http://tanelpoder.wordpress.com/2008/06/06/advanced-oracle-troubleshooting-guide-part-5-sampling-v-stuff-with-waitprof-really-fast-using-sql/#comment-391</guid>
		<description>[ Meanwhile, can someone explain how my script can sample the same table (V$SESSION_WAIT) hundreds of thousands of times by running a single SQL statement only once? ;-)
 ]
The HOW is more or less easy to find out by reading the code, you limited the number of samples to 1000*1000*1000. Am I right?
I&#039;m just a little bit confused: in an ordinary table: if I select the same data 1 billion times within the same SQL, they should be equal. There seems to be a difference with the kernel related x$ tables to this rule? Or am I totally wrong?
thnx
 berx</description>
		<content:encoded><![CDATA[<p>[ Meanwhile, can someone explain how my script can sample the same table (V$SESSION_WAIT) hundreds of thousands of times by running a single SQL statement only once? ;-)<br />
 ]<br />
The HOW is more or less easy to find out by reading the code, you limited the number of samples to 1000*1000*1000. Am I right?<br />
I&#8217;m just a little bit confused: in an ordinary table: if I select the same data 1 billion times within the same SQL, they should be equal. There seems to be a difference with the kernel related x$ tables to this rule? Or am I totally wrong?<br />
thnx<br />
 berx</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Advanced Oracle Troubleshooting Guide, Part 7: Sampling latch holder statistics using LatchProf &#171; Tanel Poder&#8217;s blog: Core IT for geeks and pros</title>
		<link>http://blog.tanelpoder.com/2008/06/06/advanced-oracle-troubleshooting-guide-part-5-sampling-v-stuff-with-waitprof-really-fast-using-sql/comment-page-1/#comment-405</link>
		<dc:creator>Advanced Oracle Troubleshooting Guide, Part 7: Sampling latch holder statistics using LatchProf &#171; Tanel Poder&#8217;s blog: Core IT for geeks and pros</dc:creator>
		<pubDate>Tue, 08 Jul 2008 11:54:28 +0000</pubDate>
		<guid isPermaLink="false">http://tanelpoder.wordpress.com/2008/06/06/advanced-oracle-troubleshooting-guide-part-5-sampling-v-stuff-with-waitprof-really-fast-using-sql/#comment-405</guid>
		<description>[...] is a script similar to WaitProf, only it samples latch holder statistics from V$LATCHHOLDER. As V$LATCHHOLDER contains a SID column [...]</description>
		<content:encoded><![CDATA[<p>[...] is a script similar to WaitProf, only it samples latch holder statistics from V$LATCHHOLDER. As V$LATCHHOLDER contains a SID column [...]</p>
]]></content:encoded>
	</item>
</channel>
</rss>
