<?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 6: Understanding Oracle execution plans with os_explain</title>
	<atom:link href="http://blog.tanelpoder.com/2008/06/15/advanced-oracle-troubleshooting-guide-part-6-understanding-oracle-execution-plans-with-os_explain/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.tanelpoder.com/2008/06/15/advanced-oracle-troubleshooting-guide-part-6-understanding-oracle-execution-plans-with-os_explain/</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: Tanel Poder</title>
		<link>http://blog.tanelpoder.com/2008/06/15/advanced-oracle-troubleshooting-guide-part-6-understanding-oracle-execution-plans-with-os_explain/comment-page-1/#comment-2445</link>
		<dc:creator>Tanel Poder</dc:creator>
		<pubDate>Fri, 04 Sep 2009 10:54:36 +0000</pubDate>
		<guid isPermaLink="false">http://tanelpoder.wordpress.com/2008/06/15/advanced-oracle-troubleshooting-guide-part-6-understanding-oracle-execution-plans-with-os_explain/#comment-2445</guid>
		<description>Haris, if the output doesn&#039;t make sense on HP-UX then please send a sample pstack output, maybe the columns are ordered there differently than on linux and solaris.</description>
		<content:encoded><![CDATA[<p>Haris, if the output doesn&#8217;t make sense on HP-UX then please send a sample pstack output, maybe the columns are ordered there differently than on linux and solaris.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tanel Poder</title>
		<link>http://blog.tanelpoder.com/2008/06/15/advanced-oracle-troubleshooting-guide-part-6-understanding-oracle-execution-plans-with-os_explain/comment-page-1/#comment-2444</link>
		<dc:creator>Tanel Poder</dc:creator>
		<pubDate>Fri, 04 Sep 2009 10:53:54 +0000</pubDate>
		<guid isPermaLink="false">http://tanelpoder.wordpress.com/2008/06/15/advanced-oracle-troubleshooting-guide-part-6-understanding-oracle-execution-plans-with-os_explain/#comment-2444</guid>
		<description>Ravi,

Truss does a different job, with pstack I took the sampling approach. I sample 10-100 times and then profile which stacks I see the most, to see where most time is spent.

With truss or DTrace approach also some post-processing would need to be done if you want to know what plan operation takes most time. I have done this in DTrace..

Haris,

Please download the script again, or just change the MAX_ARRAY=4095 to MAX_ARRAY=1023 in it, I suspect your shell can&#039;t handle larger arrays (also on RHEL 4 and before there seems to be such problem)</description>
		<content:encoded><![CDATA[<p>Ravi,</p>
<p>Truss does a different job, with pstack I took the sampling approach. I sample 10-100 times and then profile which stacks I see the most, to see where most time is spent.</p>
<p>With truss or DTrace approach also some post-processing would need to be done if you want to know what plan operation takes most time. I have done this in DTrace..</p>
<p>Haris,</p>
<p>Please download the script again, or just change the MAX_ARRAY=4095 to MAX_ARRAY=1023 in it, I suspect your shell can&#8217;t handle larger arrays (also on RHEL 4 and before there seems to be such problem)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Haris</title>
		<link>http://blog.tanelpoder.com/2008/06/15/advanced-oracle-troubleshooting-guide-part-6-understanding-oracle-execution-plans-with-os_explain/comment-page-1/#comment-2441</link>
		<dc:creator>Haris</dc:creator>
		<pubDate>Fri, 04 Sep 2009 06:26:56 +0000</pubDate>
		<guid isPermaLink="false">http://tanelpoder.wordpress.com/2008/06/15/advanced-oracle-troubleshooting-guide-part-6-understanding-oracle-execution-plans-with-os_explain/#comment-2441</guid>
		<description>Hi Tanel

Excellent script.

But the script does not work for HP-UX 11i v2

The errors
$ pstack 10020 &#124; ./os_explain
./os_explain[138]: ==: unknown test operator
f_lifo[10]: array: subscript out of range

Is there a plan to deply in HP-UX?

Regards
Haris</description>
		<content:encoded><![CDATA[<p>Hi Tanel</p>
<p>Excellent script.</p>
<p>But the script does not work for HP-UX 11i v2</p>
<p>The errors<br />
$ pstack 10020 | ./os_explain<br />
./os_explain[138]: ==: unknown test operator<br />
f_lifo[10]: array: subscript out of range</p>
<p>Is there a plan to deply in HP-UX?</p>
<p>Regards<br />
Haris</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ravi Swaminathan</title>
		<link>http://blog.tanelpoder.com/2008/06/15/advanced-oracle-troubleshooting-guide-part-6-understanding-oracle-execution-plans-with-os_explain/comment-page-1/#comment-2333</link>
		<dc:creator>Ravi Swaminathan</dc:creator>
		<pubDate>Thu, 20 Aug 2009 04:16:57 +0000</pubDate>
		<guid isPermaLink="false">http://tanelpoder.wordpress.com/2008/06/15/advanced-oracle-troubleshooting-guide-part-6-understanding-oracle-execution-plans-with-os_explain/#comment-2333</guid>
		<description>Hi Tanel,

Thanks for taking time to reply.

Here is a what I tried with truss instead of Dtrace. Just save the pain of reversing the pstack output. Let me know your thoughts

Also DTrace could have system wide impact where as truss would just impact the process , correct me here if I am wrong.

Run truss on 
SQL&gt; alter system flush shared_pool;

System altered.

SQL&gt; select a from t2;

         A
----------
         1
         2
         3
         4
         5
         6
         7
         8
         9
        10

10 rows selected.

SQL&gt; exit

This is the output I get from truss
cat 1truss.out &#124; grep &#039;oracle&#124;qer&#039; &#124;cut -d2-20  (output edited)

^I                               -&gt; oracle:qerstStart(0x407b48a20, 0x1, 0x0, 0x0)$
^I                                 -&gt; oracle:qerstInitialize(0x0, 0x0, 0x0, 0x1)$
^I                                  oracle:qertbStart(0x40e484da8, 0x1, 0x16, 0x30)$
^I                                 -&gt; oracle:qerstStart(0x40e484f20, 0x1, 0x12, 0x6)$
^I                                   -&gt; oracle:qerstInitialize(0x0, 0x0, 0x0, 0x1)$
^I                                    oracle:qerixStart(0x413faafd0, 0x1, 0x16, 0x30)$
^I                                     -&gt; oracle:qerixGetKey(0x413faafd0, 0x40e484f90, 0x6, 0xffffffffffffffff)$
^I                                      oracle:qerixGetKey(0x413faafd0, 0x413faab30, 0x6, 0x1)$
^I                                     &lt;- oracle:qerixGetKey() = 1$
^I                                   &lt;- oracle:qerixStart() = 0x413faafd0$
^I                                 &lt;- oracle:qertbStart() = 0x40e484f20$
^I                                oracle:qertbRelease(0x40e484da8, 0x0, 0x0, 0x0)$
^I                                       -&gt; oracle:qerixRelease(0x413faafd0, 0x0, 0x0, 0x0)$
^I                                       &lt;- oracle:qerixRelease() = 0$
^I                                    oracle:qerstFetch(0x407b48a20, 0x1025145c0, 0xffffffff7ffe7520, 0x1)$
^I                                 -&gt; oracle:qertbFetchByRowID(0x40e484da8, 0x1009af1e0, 0xffffffff7ffe6e20, 0x1)$
^I                                   -&gt; oracle:qerstFetch(0x40e484f20, 0x0, 0xffffffff7ffe6d54, 0x1)$
^I                                     -&gt; oracle:qerixtFetch(0x413faafd0, 0x0, 0xffffffff7ffe65ec, 0x1)$
^I                                       -&gt; oracle:qerixGetRowid(0x4dd394de0, 0x12, 0xffffffff7c056758, 0x4dd394dde)$
^I                                       &lt;- oracle:qerixGetRowid() = 46$
^I                                     &lt;- oracle:qerixtFetch() = 0$
^I                                    oracle:qertbGetPartitionNumber(0xffffffff7ffe6d14, 0x40e484ea0, 0xffffffff7c057190,
0xffffffff7c05bde0)$

I need to run sed to get these converted to oracle calls.

Sorry If I am taking up too much space, I can share the whole script if you think this does the job.

Thanks

Ravi</description>
		<content:encoded><![CDATA[<p>Hi Tanel,</p>
<p>Thanks for taking time to reply.</p>
<p>Here is a what I tried with truss instead of Dtrace. Just save the pain of reversing the pstack output. Let me know your thoughts</p>
<p>Also DTrace could have system wide impact where as truss would just impact the process , correct me here if I am wrong.</p>
<p>Run truss on<br />
SQL&gt; alter system flush shared_pool;</p>
<p>System altered.</p>
<p>SQL&gt; select a from t2;</p>
<p>         A<br />
&#8212;&#8212;&#8212;-<br />
         1<br />
         2<br />
         3<br />
         4<br />
         5<br />
         6<br />
         7<br />
         8<br />
         9<br />
        10</p>
<p>10 rows selected.</p>
<p>SQL&gt; exit</p>
<p>This is the output I get from truss<br />
cat 1truss.out | grep &#8216;oracle|qer&#8217; |cut -d2-20  (output edited)</p>
<p>^I                               -&gt; oracle:qerstStart(0&#215;407b48a20, 0&#215;1, 0&#215;0, 0&#215;0)$<br />
^I                                 -&gt; oracle:qerstInitialize(0&#215;0, 0&#215;0, 0&#215;0, 0&#215;1)$<br />
^I                                  oracle:qertbStart(0&#215;40e484da8, 0&#215;1, 0&#215;16, 0&#215;30)$<br />
^I                                 -&gt; oracle:qerstStart(0&#215;40e484f20, 0&#215;1, 0&#215;12, 0&#215;6)$<br />
^I                                   -&gt; oracle:qerstInitialize(0&#215;0, 0&#215;0, 0&#215;0, 0&#215;1)$<br />
^I                                    oracle:qerixStart(0&#215;413faafd0, 0&#215;1, 0&#215;16, 0&#215;30)$<br />
^I                                     -&gt; oracle:qerixGetKey(0&#215;413faafd0, 0&#215;40e484f90, 0&#215;6, 0xffffffffffffffff)$<br />
^I                                      oracle:qerixGetKey(0&#215;413faafd0, 0&#215;413faab30, 0&#215;6, 0&#215;1)$<br />
^I                                     &lt;- oracle:qerixGetKey() = 1$<br />
^I                                   &lt;- oracle:qerixStart() = 0&#215;413faafd0$<br />
^I                                 &lt;- oracle:qertbStart() = 0&#215;40e484f20$<br />
^I                                oracle:qertbRelease(0&#215;40e484da8, 0&#215;0, 0&#215;0, 0&#215;0)$<br />
^I                                       -&gt; oracle:qerixRelease(0&#215;413faafd0, 0&#215;0, 0&#215;0, 0&#215;0)$<br />
^I                                       &lt;- oracle:qerixRelease() = 0$<br />
^I                                    oracle:qerstFetch(0&#215;407b48a20, 0&#215;1025145c0, 0xffffffff7ffe7520, 0&#215;1)$<br />
^I                                 -&gt; oracle:qertbFetchByRowID(0&#215;40e484da8, 0&#215;1009af1e0, 0xffffffff7ffe6e20, 0&#215;1)$<br />
^I                                   -&gt; oracle:qerstFetch(0&#215;40e484f20, 0&#215;0, 0xffffffff7ffe6d54, 0&#215;1)$<br />
^I                                     -&gt; oracle:qerixtFetch(0&#215;413faafd0, 0&#215;0, 0xffffffff7ffe65ec, 0&#215;1)$<br />
^I                                       -&gt; oracle:qerixGetRowid(0&#215;4dd394de0, 0&#215;12, 0xffffffff7c056758, 0&#215;4dd394dde)$<br />
^I                                       &lt;- oracle:qerixGetRowid() = 46$<br />
^I                                     &lt;- oracle:qerixtFetch() = 0$<br />
^I                                    oracle:qertbGetPartitionNumber(0xffffffff7ffe6d14, 0&#215;40e484ea0, 0xffffffff7c057190,<br />
0xffffffff7c05bde0)$</p>
<p>I need to run sed to get these converted to oracle calls.</p>
<p>Sorry If I am taking up too much space, I can share the whole script if you think this does the job.</p>
<p>Thanks</p>
<p>Ravi</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tanel Poder</title>
		<link>http://blog.tanelpoder.com/2008/06/15/advanced-oracle-troubleshooting-guide-part-6-understanding-oracle-execution-plans-with-os_explain/comment-page-1/#comment-2328</link>
		<dc:creator>Tanel Poder</dc:creator>
		<pubDate>Wed, 19 Aug 2009 08:59:19 +0000</pubDate>
		<guid isPermaLink="false">http://tanelpoder.wordpress.com/2008/06/15/advanced-oracle-troubleshooting-guide-part-6-understanding-oracle-execution-plans-with-os_explain/#comment-2328</guid>
		<description>Thanks Ravi,

In this script (extracting stack traces) truss can&#039;t be used at all, as far as I know truss can&#039;t extract snapshots of stack traces like pstack does.

But if comparing truss&#039;es a.out:func* notation with DTrace, I would always use DTrace if its available and usable. DTrace is safe by design (although you *can* cause trouble with it even in non-destructive mode) but truss had problems in past IIRC, such target processes missing signals sent to them and failing to exit.</description>
		<content:encoded><![CDATA[<p>Thanks Ravi,</p>
<p>In this script (extracting stack traces) truss can&#8217;t be used at all, as far as I know truss can&#8217;t extract snapshots of stack traces like pstack does.</p>
<p>But if comparing truss&#8217;es a.out:func* notation with DTrace, I would always use DTrace if its available and usable. DTrace is safe by design (although you *can* cause trouble with it even in non-destructive mode) but truss had problems in past IIRC, such target processes missing signals sent to them and failing to exit.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ravi Swaminathan</title>
		<link>http://blog.tanelpoder.com/2008/06/15/advanced-oracle-troubleshooting-guide-part-6-understanding-oracle-execution-plans-with-os_explain/comment-page-1/#comment-2327</link>
		<dc:creator>Ravi Swaminathan</dc:creator>
		<pubDate>Wed, 19 Aug 2009 08:27:48 +0000</pubDate>
		<guid isPermaLink="false">http://tanelpoder.wordpress.com/2008/06/15/advanced-oracle-troubleshooting-guide-part-6-understanding-oracle-execution-plans-with-os_explain/#comment-2327</guid>
		<description>Great article.


In this particular script is there an advantage in using DTRACE over using truss 
to trace @ OS Level ?</description>
		<content:encoded><![CDATA[<p>Great article.</p>
<p>In this particular script is there an advantage in using DTRACE over using truss<br />
to trace @ OS Level ?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Scripts for showing execution plans via plain SQL and also in Oracle 9i &#124; Tanel Poder's blog: Core IT for Geeks and Pros</title>
		<link>http://blog.tanelpoder.com/2008/06/15/advanced-oracle-troubleshooting-guide-part-6-understanding-oracle-execution-plans-with-os_explain/comment-page-1/#comment-1656</link>
		<dc:creator>Scripts for showing execution plans via plain SQL and also in Oracle 9i &#124; Tanel Poder's blog: Core IT for Geeks and Pros</dc:creator>
		<pubDate>Tue, 26 May 2009 20:42:14 +0000</pubDate>
		<guid isPermaLink="false">http://tanelpoder.wordpress.com/2008/06/15/advanced-oracle-troubleshooting-guide-part-6-understanding-oracle-execution-plans-with-os_explain/#comment-1656</guid>
		<description>[...] As we had enabled rowsource level execution stats collection, we can use another script to report the response time and resource consumption at execution plan line level (if you&#8217;re interested how Oracle achieves this, check the last part of this blog post) [...]</description>
		<content:encoded><![CDATA[<p>[...] As we had enabled rowsource level execution stats collection, we can use another script to report the response time and resource consumption at execution plan line level (if you&#8217;re interested how Oracle achieves this, check the last part of this blog post) [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Charles Schultz</title>
		<link>http://blog.tanelpoder.com/2008/06/15/advanced-oracle-troubleshooting-guide-part-6-understanding-oracle-execution-plans-with-os_explain/comment-page-1/#comment-1461</link>
		<dc:creator>Charles Schultz</dc:creator>
		<pubDate>Mon, 27 Apr 2009 19:42:58 +0000</pubDate>
		<guid isPermaLink="false">http://tanelpoder.wordpress.com/2008/06/15/advanced-oracle-troubleshooting-guide-part-6-understanding-oracle-execution-plans-with-os_explain/#comment-1461</guid>
		<description>Tanel, awesome stuff, thanks for posting!

I am curious - I see from your examples and from my own tests that pstack is only capturing current stack operations. You mention that you have a loop to cycle through while the query is running. This begs a couple questions:
1) A loop is going to, effectively, sample the process stack. Correct?
2) What would it take to stitch together stack traces for os_explain? Not sure if just deleting the &quot;header&quot; lines would do it.

Thanks again for your intelligent and comprehensive contributions.</description>
		<content:encoded><![CDATA[<p>Tanel, awesome stuff, thanks for posting!</p>
<p>I am curious &#8211; I see from your examples and from my own tests that pstack is only capturing current stack operations. You mention that you have a loop to cycle through while the query is running. This begs a couple questions:<br />
1) A loop is going to, effectively, sample the process stack. Correct?<br />
2) What would it take to stitch together stack traces for os_explain? Not sure if just deleting the &#8220;header&#8221; lines would do it.</p>
<p>Thanks again for your intelligent and comprehensive contributions.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tracing Oracle SQL plan execution with DTrace &#124; Tanel Poder's blog: Core IT for Geeks and Pros</title>
		<link>http://blog.tanelpoder.com/2008/06/15/advanced-oracle-troubleshooting-guide-part-6-understanding-oracle-execution-plans-with-os_explain/comment-page-1/#comment-1443</link>
		<dc:creator>Tracing Oracle SQL plan execution with DTrace &#124; Tanel Poder's blog: Core IT for Geeks and Pros</dc:creator>
		<pubDate>Fri, 24 Apr 2009 06:11:52 +0000</pubDate>
		<guid isPermaLink="false">http://tanelpoder.wordpress.com/2008/06/15/advanced-oracle-troubleshooting-guide-part-6-understanding-oracle-execution-plans-with-os_explain/#comment-1443</guid>
		<description>[...] http://blog.tanelpoder.com/2008/06/15/advanced-oracle-troubleshooting-guide-part-6-understanding-ora... [...]</description>
		<content:encoded><![CDATA[<p>[...] <a href="http://blog.tanelpoder.com/2008/06/15/advanced-oracle-troubleshooting-guide-part-6-understanding-ora.." rel="nofollow">http://blog.tanelpoder.com/2008/06/15/advanced-oracle-troubleshooting-guide-part-6-understanding-ora..</a>. [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tanel Poder</title>
		<link>http://blog.tanelpoder.com/2008/06/15/advanced-oracle-troubleshooting-guide-part-6-understanding-oracle-execution-plans-with-os_explain/comment-page-1/#comment-989</link>
		<dc:creator>Tanel Poder</dc:creator>
		<pubDate>Tue, 17 Feb 2009 20:38:35 +0000</pubDate>
		<guid isPermaLink="false">http://tanelpoder.wordpress.com/2008/06/15/advanced-oracle-troubleshooting-guide-part-6-understanding-oracle-execution-plans-with-os_explain/#comment-989</guid>
		<description>Thanks Fred for the info!

I knew Linux distros had PDKSH instead of KSH, but didn&#039;t know that RHEL5 one has the &quot;real&quot; KSH. It may be related with Sun open sourcing Solaris and related software?</description>
		<content:encoded><![CDATA[<p>Thanks Fred for the info!</p>
<p>I knew Linux distros had PDKSH instead of KSH, but didn&#8217;t know that RHEL5 one has the &#8220;real&#8221; KSH. It may be related with Sun open sourcing Solaris and related software?</p>
]]></content:encoded>
	</item>
</channel>
</rss>
