<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Tanel Poder's blog: Core IT for Geeks and Pros &#187; Uncategorized</title>
	<atom:link href="http://blog.tanelpoder.com/category/uncategorized/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.tanelpoder.com</link>
	<description>Oracle troubleshooting, internals and performance tuning</description>
	<lastBuildDate>Sat, 31 Jul 2010 05:44:10 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>How to CANCEL a query running in another session?</title>
		<link>http://blog.tanelpoder.com/2010/02/17/how-to-cancel-a-query-running-in-another-session/</link>
		<comments>http://blog.tanelpoder.com/2010/02/17/how-to-cancel-a-query-running-in-another-session/#comments</comments>
		<pubDate>Thu, 18 Feb 2010 04:14:54 +0000</pubDate>
		<dc:creator>Tanel Poder</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.tanelpoder.com/?p=628</guid>
		<description><![CDATA[Here&#8217;s a treat for Oracle geeks, hackers and maniacs out there&#8230; Update: As the beginning says, this article was meant as something interesting about Oracle&#8217;s internals and CTRL+C / OCICancel() handling. There&#8217;s a more practical way for canceling session calls if you are running Oracle Enterprise Edition and are currently using resource manager: You can [...]]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s a treat for Oracle geeks, hackers and maniacs out there&#8230;</p>
<p><em>Update: As the beginning says, this article was meant as something interesting about Oracle&#8217;s internals and CTRL+C / OCICancel() handling. There&#8217;s a more practical way for canceling session calls if you are running Oracle Enterprise Edition and are currently using resource manager:</em></p>
<p><em>You can set the consumer group for a session to CANCEL_SQL to cancel its current call:</em></p>
<p><em>DBMS_RESOURCE_MANAGER.SWITCH_CONSUMER_GROUP_FOR_SESS (<br />
<span style="font-style: normal;"><em><span style="font-style: normal;"><em><span style="font-style: normal;"><em>session_id IN NUMBER,<br />
<span style="font-style: normal;"><em><span style="font-style: normal;"><em><span style="font-style: normal;"><em><span style="font-style: normal;"><em>session_serial IN NUMBER,<br />
<span style="font-style: normal;"><em><strong>consumer_group</strong> IN VARCHAR2);</em></span></em></span></em></span></em></span></em></span></em></span></em></span></em></span></em></p>
<p><em>Thanks to commenter &#8220;null&#8221; for this info. Note that I haven&#8217;t tested how/whether this feature works correctly so there&#8217;s homework for you ;-)</em></p>
<p>I recently received a question about how to <em>cancel</em> queries running in another Oracle session, so that the session would not be killed, but would remain alive.</p>
<p>Well, there&#8217;s no supported way I can tell you, but thanks to how Oracle handles out-of-band breaks on Unix platforms, you can cancel database calls using an OS tool &#8211; kill.</p>
<p>Before we go on, here&#8217;s how query cancellation (pressing CTRL+C in sqlplus for example) works in Oracle:</p>
<ol>
<li>The user presses CTRL+C or clicks some button in App which runs OCICancel()</li>
<li>The client process sends an <em>urgent</em> TCP packet (which is a regular TCP packet with URG bit set) to the socket in the database server it is connected to</li>
<li>The server OS TCP stack receives the urgent TCP packet and sends URGENT signal to the process which owns the socket (the Oracle server process)</li>
<li>Unix interrupts whatever the current process was doing and calls the URGENT signal handler function (which Oracle has registered during process startup)</li>
<li>The urgent signal handler blindly assumes that the urgent signal has been received because user wants to cancel the query, stops the execution and returns back with an error: ORA-01013: user requested cancel of current operation</li>
</ol>
<p>So, if we can&#8217;t make our application send the break packet, OCICancel() then we can just send the SIGURG signal to the Oracle process just like the OS TCP stack would do when it receives the packet with urgent bit set.</p>
<p>Here&#8217;s an example:</p>
<p>In one session I&#8217;m running a DBMS_STATS call:</p>
<pre class="brush: plain;">SQL&gt; exec dbms_stats.gather_database_stats;
</pre>
<p>I identify the SPID of that session&#8217;s process and send an URG signal to that process:</p>
<pre class="brush: plain;">kill -URG 4476
</pre>
<p>And the call gets cancelled in the other session:</p>
<pre class="brush: plain;">SQL&gt; exec dbms_stats.gather_database_stats;
&lt;pre&gt;BEGIN dbms_stats.gather_database_stats; END;

*
ERROR at line 1:
ORA-00604: error occurred at recursive SQL level 1
ORA-01013: user requested cancel of current operation
ORA-06512: at &quot;SYS.DBMS_STATS&quot;, line 13336
ORA-06512: at &quot;SYS.DBMS_STATS&quot;, line 13682
ORA-06512: at &quot;SYS.DBMS_STATS&quot;, line 13826
ORA-06512: at &quot;SYS.DBMS_STATS&quot;, line 13790
ORA-06512: at line 1
</pre>
<p>My session was not killed &#8211; I still can run queries in it:</p>
<pre class="brush: plain;">SQL&gt; select * from dual;

D
-
X

SQL&gt;
</pre>
<p>This works only on Unix platforms. Also this does <span style="text-decoration: underline;">not</span> work when your client application is Windows sqlplus! This is because Windows sqlplus does not set up the out-of-band break checking properly when connecting. Maybe this is because old Windows versions TCP stacks didn&#8217;t know anything about urgent TCP packets! :)</p>
<p>A word of warning &#8211; this stuff is not for your everyday production usage! While it works and we know <em>how and why</em> it works, it&#8217;s not a good idea to send &#8220;random&#8221; signals to Oracle processes at your will. So the better way is to make your application able to cancel its database calls when you want it, but well in real world its not always (or should I even say rarely) possible.</p>
<p>Another thing to consider is when you run Oracle with Direct NFS, there will be network connections to the NFS server used by your server process, in addition to the client-server communication. I haven&#8217;t tested what happens when you send URG packet to a process in the DNFS case.</p>
<p>So try this out at your own risk ;-)</p>
<p>If you want to know more about query cancelling and what the in-band and out-of-band break checking is then you can read one of my old blog posts about it:</p>
<ul>
<li><a href="http://blog.tanelpoder.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2Jsb2cudGFuZWxwb2Rlci5jb20vMjAwOC8wMi8wNS9vcmFjbGUtaGlkZGVuLWNvc3RzLXJldmVhbGVkLXBhcnQtMS8=">http://blog.tanelpoder.com/2008/02/05/oracle-hidden-costs-revealed-part-1/</a></li>
</ul>
<div class="facebook_like_button"><iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fblog.tanelpoder.com%2F2010%2F02%2F17%2Fhow-to-cancel-a-query-running-in-another-session%2F&amp;layout=standard&amp;show-faces=true&amp;width=450&amp;action=like&amp;font=arial&amp;colorscheme=light" scrolling="no" frameborder="0" allowTransparency="true" style="padding: 0px 0px; border:none; overflow:hidden; width:450px; height:70px;"></iframe></div> <img src="http://blog.tanelpoder.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=628" width="1" height="1" style="display: none;" /><p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://blog.tanelpoder.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://blog.tanelpoder.com/2010/02/17/how-to-cancel-a-query-running-in-another-session/feed/</wfw:commentRss>
		<slash:comments>18</slash:comments>
		</item>
		<item>
		<title>Using Process Memory Matrix script for calculating Oracle process memory usage on Solaris</title>
		<link>http://blog.tanelpoder.com/2010/02/11/using-process-memory-matrix-script-for-calculating-oracle-process-memory-usage-on-solaris/</link>
		<comments>http://blog.tanelpoder.com/2010/02/11/using-process-memory-matrix-script-for-calculating-oracle-process-memory-usage-on-solaris/#comments</comments>
		<pubDate>Thu, 11 Feb 2010 18:21:04 +0000</pubDate>
		<dc:creator>Tanel Poder</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.tanelpoder.com/?p=604</guid>
		<description><![CDATA[I just published a new script and article about calculating the real Oracle process memory usage on Solaris. The problem with V$PROCESS* views (and the V$SESSTAT) is that they will tell you what Oracle thinks it&#8217;s using, not the real amount of memory used. There will be discrepancies due how memory is actually allocated in [...]]]></description>
			<content:encoded><![CDATA[<p>I just published a new script and article about calculating the <em>real</em> Oracle process memory usage on Solaris.</p>
<p>The problem with V$PROCESS* views (and the V$SESSTAT) is that they will tell you what Oracle <em>thinks</em> it&#8217;s using, not the real amount of memory used. There will be discrepancies due how memory is actually allocated in OS, libraries out of Oracle&#8217;s control, the static memory areas inside Oracle binary and of course bugs.</p>
<p>I was working on one of such problems and decided to make my life easier by writing the script. It&#8217;s not so much about calculating the exact figures (they will never be 100% correct), but more about presenting the memory usage data in a better and more convenient fashion.</p>
<p>The script is called <strong>procmm </strong>and stands for Process Memory Matrix as it shows the memory usage in a matrix grid.</p>
<p>Here&#8217;s an example output to show what I&#8217;m talking about:</p>
<pre class="brush: plain;">
oracle@solaris02:~/research/memory$ ./procmm.sh -t `pgrep -f ora_.*SOL102`

-- procmm.sh: Process Memory Matrix v1.01 by Tanel Poder ( http://tech.e2sn.com )
-- All numbers are shown in kilobytes

Total PIDs 17, working: .................

PID            SEGMENT_TYPE      VIRTUAL          RSS         ANON       LOCKED    SWAP_RSVD
------ -------------------- ------------ ------------ ------------ ------------ ------------
0                       lib       389844       388796        13180            0        17816
0                    oracle      1629064      1628908         3336            0        42012
0            ism_shmid=0x1d      6963336      6963336            0      6963336            0
0             hc_SOL102.dat           48           48            0            0            0
0                      anon        32936        15936        15452            0        32868
0                     stack         1660         1628         1592            0         1660
0                      heap        37004        18016        16844            0        37004
------ -------------------- ------------ ------------ ------------ ------------ ------------
0                 TOTAL(kB)      9053892      9016668        50404      6963336       131360
</pre>
<p>And here&#8217;s the full article and in there a link to the script:</p>
<ul>
<li><a href="http://blog.tanelpoder.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3RlY2guZTJzbi5jb20vb3JhY2xlL3BlcmZvcm1hbmNlL3VuaXgtcGVyZm9ybWFuY2UtdG9vbHMvcHJvY2Vzcy1tZW1veS1tYXRyaXg=" target=\"_blank\"></a><a href="http://blog.tanelpoder.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3RlY2guZTJzbi5jb20vb3JhY2xlL3BlcmZvcm1hbmNlL3VuaXgtcGVyZm9ybWFuY2UtdG9vbHMvcHJvY2Vzcy1tZW1vcnktbWF0cml4" target=\"_blank\">http://tech.e2sn.com/oracle/performance/unix-performance-tools/process-memory-matrix</a></li>
</ul>
<p>Comments are welcome here, as I haven&#8217;t set up commenting on my other site yet&#8230;</p>
<div class="facebook_like_button"><iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fblog.tanelpoder.com%2F2010%2F02%2F11%2Fusing-process-memory-matrix-script-for-calculating-oracle-process-memory-usage-on-solaris%2F&amp;layout=standard&amp;show-faces=true&amp;width=450&amp;action=like&amp;font=arial&amp;colorscheme=light" scrolling="no" frameborder="0" allowTransparency="true" style="padding: 0px 0px; border:none; overflow:hidden; width:450px; height:70px;"></iframe></div> <img src="http://blog.tanelpoder.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=604" width="1" height="1" style="display: none;" /><p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://blog.tanelpoder.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://blog.tanelpoder.com/2010/02/11/using-process-memory-matrix-script-for-calculating-oracle-process-memory-usage-on-solaris/feed/</wfw:commentRss>
		<slash:comments>28</slash:comments>
		</item>
		<item>
		<title>I&#8217;m tweeting now&#8230;</title>
		<link>http://blog.tanelpoder.com/2009/10/18/im-tweeting-now/</link>
		<comments>http://blog.tanelpoder.com/2009/10/18/im-tweeting-now/#comments</comments>
		<pubDate>Sun, 18 Oct 2009 18:34:07 +0000</pubDate>
		<dc:creator>Tanel Poder</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.tanelpoder.com/2009/10/18/im-tweeting-now/</guid>
		<description><![CDATA[Although I don&#8217;t think I have much useful to say in 160 characters, but we&#8217;ll see You can follow me here: http://twitter.com/tanelpoder Or just check out the right hand twitter widget in my blog&#8230;]]></description>
			<content:encoded><![CDATA[<p>Although I don&#8217;t think I have much useful to say in 160 characters, but we&#8217;ll see</p>
<p>You can follow me here:</p>
<p><a href="http://blog.tanelpoder.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3R3aXR0ZXIuY29tL3RhbmVscG9kZXI=">http://twitter.com/tanelpoder</a></p>
<p>Or just check out the right hand twitter widget in my blog&#8230;</p>
<div class="facebook_like_button"><iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fblog.tanelpoder.com%2F2009%2F10%2F18%2Fim-tweeting-now%2F&amp;layout=standard&amp;show-faces=true&amp;width=450&amp;action=like&amp;font=arial&amp;colorscheme=light" scrolling="no" frameborder="0" allowTransparency="true" style="padding: 0px 0px; border:none; overflow:hidden; width:450px; height:70px;"></iframe></div> <img src="http://blog.tanelpoder.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=466" width="1" height="1" style="display: none;" /><p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://blog.tanelpoder.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://blog.tanelpoder.com/2009/10/18/im-tweeting-now/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Oracle Performance Visualization videos from Sydney</title>
		<link>http://blog.tanelpoder.com/2009/05/27/oracle-performance-visualization-videos-from-sydney/</link>
		<comments>http://blog.tanelpoder.com/2009/05/27/oracle-performance-visualization-videos-from-sydney/#comments</comments>
		<pubDate>Wed, 27 May 2009 13:18:31 +0000</pubDate>
		<dc:creator>Tanel Poder</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.tanelpoder.com/?p=320</guid>
		<description><![CDATA[Alex Gorbachev invited me to speak at Oracle Meetup @ Sydney event in April. I in addition to useful (and less cool) stuff I showed some useful (and very cool) stuff there too. I demoed my PerfSheet tool and also something completely new what I&#8217;ve been working on for last few months. Alex has uploaded [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://blog.tanelpoder.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy5weXRoaWFuLmNvbS9uZXdzL2F1dGhvci9hbGV4">Alex Gorbachev</a> invited me to speak at Oracle Meetup @ Sydney event in April.</p>
<p>I in addition to useful (and less cool) stuff I showed some useful (and very cool) stuff there too. I demoed my PerfSheet tool and also something completely new what I&#8217;ve been working on for last few months. Alex has uploaded couple of videos in to youtube, if you&#8217;re interested what I&#8217;ve been up to in last few months, check them out here:</p>
<p><a href="http://blog.tanelpoder.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy5weXRoaWFuLmNvbS9uZXdzLzI1OTAvc3lkbmV5LW9yYWNsZS1tZWV0dXAtMi12aXN1YWxpemluZy1vcmFjbGUtcGVyZm9ybWFuY2U=" target=\"_blank\">http://www.pythian.com/news/2590/sydney-oracle-meetup-2-visualizing-oracle-performance</a></p>
<div class="facebook_like_button"><iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fblog.tanelpoder.com%2F2009%2F05%2F27%2Foracle-performance-visualization-videos-from-sydney%2F&amp;layout=standard&amp;show-faces=true&amp;width=450&amp;action=like&amp;font=arial&amp;colorscheme=light" scrolling="no" frameborder="0" allowTransparency="true" style="padding: 0px 0px; border:none; overflow:hidden; width:450px; height:70px;"></iframe></div> <img src="http://blog.tanelpoder.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=320" width="1" height="1" style="display: none;" /><p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://blog.tanelpoder.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://blog.tanelpoder.com/2009/05/27/oracle-performance-visualization-videos-from-sydney/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Performance Visualization made easy &#8211; PerfSheet 2.0 beta</title>
		<link>http://blog.tanelpoder.com/2008/12/28/performance-visualization-made-easy-perfsheet-20-beta/</link>
		<comments>http://blog.tanelpoder.com/2008/12/28/performance-visualization-made-easy-perfsheet-20-beta/#comments</comments>
		<pubDate>Sun, 28 Dec 2008 15:19:36 +0000</pubDate>
		<dc:creator>Tanel Poder</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.tanelpoder.com/?p=168</guid>
		<description><![CDATA[Hi all, I have been extremely busy over last couple of months, that&#8217;s why there haven&#8217;t been any blog entries (no, I haven&#8217;t ran out of good ideas ;-) I just managed to find some time on a day-time 9-hour flight from Shanghai to Finland, thus here&#8217;s a blog entry about something what I had [...]]]></description>
			<content:encoded><![CDATA[<p>Hi all,</p>
<p>I have been extremely busy over last couple of months, that&#8217;s why there haven&#8217;t been any blog entries (no, I haven&#8217;t ran out of good ideas ;-)<br />
I just managed to find some time on a day-time 9-hour flight from Shanghai to Finland, thus here&#8217;s a blog entry about something what I had wanted to write about for long time&#8230; I&#8217;m talking about the PerfSheet tool I wrote a year ago and have been showing at few conferences already. It has been a great time saver for me over this year when working through performance data for troubleshooting or capacity planning tasks.</p>
<p>If you don&#8217;t want to read further through my comments, just download PerfSheet from <a href="http://blog.tanelpoder.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy50YW5lbHBvZGVyLmNvbS9maWxlcy9QZXJmU2hlZXQuemlw">http://www.tanelpoder.com/files/PerfSheet.zip</a> and see how it works yourself!</p>
<p>For others, let me give some history first:</p>
<p><span id="more-168"></span></p>
<ol>
<li>A client had some serious performance problems after an HBA driver upgrade on a weekend.</li>
<li>DBAs were blamed first and they started looking into Statspack reports (as that was the only performance history data they had).</li>
<li>Current Statspack reports didn&#8217;t show anything too extraordinary (as everybody knew this database was running quite non-optimally anyway).</li>
<li>By that time, both storage and Unix admins &#8220;had done the healthchecks and everything looked fine&#8221;</li>
<li>But something was definitely different today as the end user response times were much worse.</li>
<li>(This is a case where we didn&#8217;t care about general inefficiency of the application as this is what the application had been like all the time. Instead of systematically starting optimizing the database we just had to find what had gone wrong over the weekend and fix it. In other words, something had got <em>F-ed</em> up over the weekend and we needed to <em>un-F</em> it ;).</li>
<li>Thus the troubleshooters (including me) started comparing the &#8220;current&#8221; statspack reports with previous ones to see what were the main differences in wait and load profiles were.</li>
<li>But it wasn&#8217;t as easy as just taking last days snapshot from the same time as the load &amp; wait profile of that system was fluctuating anyway as some heavily parallel batch jobs started and finished (at different times).</li>
<li>Based on the statspack numbers the DBAs suspected that there was something wrong with IO configuration (especially as there had been a HBA driver upgrade over the weekend)</li>
<li>Taking tens of 50-page statspack reports to a fingerpointing meeting with SAs, storage admins, high level directors etc didn&#8217;t work well&#8230;</li>
</ol>
<p>Then I thought to visualize the numbers in Excel to get our point (and proof) through better.</p>
<p>Running Statspack reports manually and pasting numbers from there into Excel <em>very</em> boring, slow and error prone task. I actually started doing this but after 10 (painful) minutes I thought, heck, why am I doing all this manually?</p>
<p>This is how PerfSheet was born. I wrote the first version in couple of hours and it just ran an analytic query (downloaded the query from <a href="http://blog.tanelpoder.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy5ldmRidC5jb20vdG9vbHMuaHRt">Tim Gorman&#8217;s site</a>) against statspack repository. After fetching the SQL resultset to Excel, the sheet also automatically displayed the results in a graph (so we could refresh the graph after querying different stats out of statspack repository).</p>
<p><img src="http://www.tanelpoder.com/files/images/io_before_after.png" border="0" alt="" /></p>
<p>And armed with the wait profile graph above we were able to show hard evidence in a simple package (as opposed to tens of statspack reports) at the next meeting with storage and Unix teams. It&#8217;s very hard to argue with evidence like that, especially if managers are involved :) It&#8217;s much easier to discard a DBA with 500 pages of statspack reports blabbering about Oracle wait interface than someone who shows a visual overview of database health.</p>
<p>This led the Unix SAs to do another healthcheck and this time they found out that one of the two HBAs had been left deactivated after the driver upgrade. After the HBA was activated (online), the performance went back to normal.</p>
<p>So, sometimes, especially if multiple teams are involved in troubleshooting a sudden peformance problem (and there&#8217;s negative fingerpointing and protectionism going on), it&#8217;s hard to beat historical performance visualization. Instead of going through tens of pages of raw numbers you can just visualize that data and see if your eye catches a sudden change, trend or outlier.</p>
<p>And this leads me to version 2.0 (beta) of PerfSheet.</p>
<p>It allows you to do ad-hoc visualization of any SQL resultset. Excel runs your specified SQL statement, fetches data onto a worksheet and shows the results on a PivotChart. I have actually written only few lines of code to glue Excel&#8217;s SQL execution, data fetching and visualization modules together for convenience, Excel itself does most of the work.</p>
<p>When you open up the <a href="http://blog.tanelpoder.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy50YW5lbHBvZGVyLmNvbS9maWxlcy9QZXJmU2hlZXQuemlw">PerfSheet.xls</a>, just fill in the connect details on the first page and click &#8220;Show me&#8221; and see what I mean (note that some queries do query v$active_session_history and DBA_HIST tables so make sure you have the proper licenses for querying these views).</p>
<p>Once the graph is displayed you can even drag and drop the data fields around into different axis to get a different breakdown of the statistics. Try it out and you&#8217;ll love it :)<br />
Also, you can hover your mouse over some data element to get its description, as I&#8217;ve done here to see a SQLID matching an ASH sample on an ASH query:</p>
<p><img src="http://www.tanelpoder.com/files/images/3d_ash.png" border="0" alt="" /></p>
<p>As a next step, just navigate around at the Queries, Views and Help tabs and read the comments at column headers on how to define your own queries and visualization views. And if it doesn&#8217;t work, let me know.</p>
<p>Also, one more important thing. I used Excel for data fetching and visualization and I uset it on purpose. I haven&#8217;t seen a corporation yet where there is no Windows workstation and Excel available. Often I hear people saying that I should just use some Perl/Python/TCL/Java module or toolkit suth RRD etc as then you can put your graphs into web and &#8220;everybody has a web browser&#8221;.</p>
<p>I say that the mentioned technologies are for entirely different purpose. Yes, everybody does have a web browser, but In a corporation it&#8217;s not easy at all to get a (virtual) webserver for your purpose (and get all the software downloaded, configured and installed). When you have a serious production problem to troubleshoot, you don&#8217;t want to start installing and configuring webservers :)</p>
<p>The webserver approach is good for proactive, predetermined visualization, e.g. you know what you want to monitor and you make that data available in the intranet. But PerfSheet is <em>perfect</em> (thus the name :) for ad-hoc performance visualization of any SQL resultset on pretty much any corporate workstation.</p>
<p>So, Merry Christmas and happy visualization in the next year ;)</p>
<div class="facebook_like_button"><iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fblog.tanelpoder.com%2F2008%2F12%2F28%2Fperformance-visualization-made-easy-perfsheet-20-beta%2F&amp;layout=standard&amp;show-faces=true&amp;width=450&amp;action=like&amp;font=arial&amp;colorscheme=light" scrolling="no" frameborder="0" allowTransparency="true" style="padding: 0px 0px; border:none; overflow:hidden; width:450px; height:70px;"></iframe></div> <img src="http://blog.tanelpoder.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=168" width="1" height="1" style="display: none;" /><p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://blog.tanelpoder.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://blog.tanelpoder.com/2008/12/28/performance-visualization-made-easy-perfsheet-20-beta/feed/</wfw:commentRss>
		<slash:comments>45</slash:comments>
		</item>
		<item>
		<title>Austrian Oracle User Group event on 15th Oct in Vienna</title>
		<link>http://blog.tanelpoder.com/2008/10/14/austrian-oracle-user-group-event-on-15th-oct-in-vienna/</link>
		<comments>http://blog.tanelpoder.com/2008/10/14/austrian-oracle-user-group-event-on-15th-oct-in-vienna/#comments</comments>
		<pubDate>Mon, 13 Oct 2008 16:54:29 +0000</pubDate>
		<dc:creator>Tanel Poder</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://tanelpoder.wordpress.com/?p=143</guid>
		<description><![CDATA[I will be speaking at Austrian Oracle User Group event in Vienna this Wednesday (15. Oct) with Christian Antognini I will deliver an 1 hour version of my Advanced Oracle Troubleshooting presentation there, so if you&#8217;re in Austria and want to see what&#8217;s coming in my full length seminar I deliver on 3.-4. Nov also [...]]]></description>
			<content:encoded><![CDATA[<p>I will be speaking at <a href="http://blog.tanelpoder.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2FvdWcuYXQvMjAwOC9leHBfMDgxMDE1Lmh0bQ==">Austrian Oracle User Group event in Vienna</a> this Wednesday (15. Oct) with <a href="http://blog.tanelpoder.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2FudG9nbmluaS5jaA==">Christian Antognini</a></p>
<p>I will deliver an 1 hour version of my Advanced Oracle Troubleshooting presentation there, so if you&#8217;re in Austria and want to see what&#8217;s coming in my full length seminar I deliver on 3.-4. Nov also in Vienna, then you can see a preview on this Wednesday :)</p>
<div class="facebook_like_button"><iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fblog.tanelpoder.com%2F2008%2F10%2F14%2Faustrian-oracle-user-group-event-on-15th-oct-in-vienna%2F&amp;layout=standard&amp;show-faces=true&amp;width=450&amp;action=like&amp;font=arial&amp;colorscheme=light" scrolling="no" frameborder="0" allowTransparency="true" style="padding: 0px 0px; border:none; overflow:hidden; width:450px; height:70px;"></iframe></div> <img src="http://blog.tanelpoder.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=143" width="1" height="1" style="display: none;" /><p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://blog.tanelpoder.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://blog.tanelpoder.com/2008/10/14/austrian-oracle-user-group-event-on-15th-oct-in-vienna/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Debugger dangers</title>
		<link>http://blog.tanelpoder.com/2008/06/14/debugger-dangers/</link>
		<comments>http://blog.tanelpoder.com/2008/06/14/debugger-dangers/#comments</comments>
		<pubDate>Sat, 14 Jun 2008 11:51:54 +0000</pubDate>
		<dc:creator>Tanel Poder</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://tanelpoder.wordpress.com/2008/06/14/debugger-dangers/</guid>
		<description><![CDATA[Whenever I deliver training or conference presentations on advanced troubleshooting topics, I usually spend some time demonstrating how to get and interpret Oracle server process stack traces. As I&#8217;ve mentioned before, stack traces are the ultimate indicators showing where in Oracle kernel (or whatever application) code the execution currently is (or where it was when [...]]]></description>
			<content:encoded><![CDATA[<p>Whenever I deliver training or conference presentations on advanced troubleshooting topics, I usually spend some time demonstrating how to get and interpret Oracle server process stack traces.<br />
As I&#8217;ve mentioned before, stack traces are the ultimate indicators showing where in Oracle kernel (or whatever application) code the execution currently is (or where it was when a crash occurred). This is the reason Oracle Support asks for stack traces whenever there&#8217;s a crash or non-trivial hang involved, that&#8217;s why Oracle database dumps errorstacks when ORA-600&#8242;s and other exceptions occur.</p>
<p>There are multiple ways for getting stack traces for Oracle, but not all ways are equal. Some give you more contextual info, some less, but what I&#8217;m blogging about today is that some ways are less safe than others.</p>
<p>I was using <strong>pstack</strong> on Linux for diagnosing an IO related performance issue. I executed a <em>create table as select</em> statement and ran pstack in a loop for getting stack traces from the running process.</p>
<p>However in one of the test runs I got following error in my Oracle session:</p>
<pre><code>SQL&gt; create table t as select * from dba_source;
create table t as select * from dba_source
                                *
ERROR at line 1:
ORA-01115: IO error reading block from file 1 (block # 11161)
ORA-01110: data file 1: '/u01/oradata/LIN10G/system01.dbf'
<strong>ORA-27091: unable to queue I/O
ORA-27072: File I/O error
</strong>Additional information: 3
Additional information: 11145
Additional information: 32768

</code></pre>
<p>I suspected that this issue was due Linux pstack, stopped the pstack script and ran my CTAS from <em>the same Oracle session</em> again:</p>
<p><span id="more-80"></span></p>
<pre><code>SQL&gt; create table t as select * from dba_source;

Table created.

</code></pre>
<p>The command now succeeded ok.</p>
<p>I tried to reproduce the failure again, but during the few minutes I spent testing, it didn&#8217;t occur again.</p>
<p>The failure happened likely due the fact that pstack on Linux is actually just a wrapper script around gdb. GDB in turn suspends the process under investigation and attaches to it through ptrace() syscall. And ptrace() syscall (and debuggers in general) have historically caused issues to host processes when communicating with kernel and other processes. For example they can block some signals or interrupts from being propagated back up to the &#8220;host&#8221; process.</p>
<p>Normally I have warned people about using debugger-based stack tracing due exactly those reasons, and now I managed to capture nice evidence.<br />
I recommend to stay away with debugger from critical background processes on production systems, unless things have already collapsed anyway (that ought to be common sense anyway). So it&#8217;s good to know that Linux pstack is actually just a script with GDB backtrace command in it.</p>
<p>So, what are the safer and less safer stack tracing options:</p>
<ul>
<li>oradebug dump errorstack &#8211; unsafe for production (as dump errorstack actually alters the process under investigation from its original codepath)</li>
<li>debugger based errorstack (gdb,dbx,mdb and Linux pstack) &#8211; can be unsafe for production due missed signals &amp; interrupts if you get unlucky. Therefore you should stay away from at least the critical background processes with such tools</li>
<li>pstack on Solaris (and procstack on AIX) &#8211; safe as they don&#8217;t use the ptrace() interface but just read the info required from /proc filesystem</li>
<li>DTrace &#8211; safe by design</li>
</ul>
<p>I haven&#8217;t checked how HP-UX pstack works, so can&#8217;t advise on that.</p>
<div class="facebook_like_button"><iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fblog.tanelpoder.com%2F2008%2F06%2F14%2Fdebugger-dangers%2F&amp;layout=standard&amp;show-faces=true&amp;width=450&amp;action=like&amp;font=arial&amp;colorscheme=light" scrolling="no" frameborder="0" allowTransparency="true" style="padding: 0px 0px; border:none; overflow:hidden; width:450px; height:70px;"></iframe></div> <img src="http://blog.tanelpoder.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=80" width="1" height="1" style="display: none;" /><p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://blog.tanelpoder.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://blog.tanelpoder.com/2008/06/14/debugger-dangers/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Performance Tools Quick Reference Guide</title>
		<link>http://blog.tanelpoder.com/2008/06/03/performance-tools-quick-reference-guide/</link>
		<comments>http://blog.tanelpoder.com/2008/06/03/performance-tools-quick-reference-guide/#comments</comments>
		<pubDate>Mon, 02 Jun 2008 18:09:23 +0000</pubDate>
		<dc:creator>Tanel Poder</dc:creator>
				<category><![CDATA[Administration]]></category>
		<category><![CDATA[Oracle]]></category>
		<category><![CDATA[Performance]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[Troubleshooting]]></category>
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://tanelpoder.wordpress.com/?p=73</guid>
		<description><![CDATA[There&#8217;s a nice Metalink Note 438452.1 about various less known Oracle performance tuning utilities. If you haven&#8217;t heard about things like StackX, LTOM, HangFG, SQLTXPLAIN, OS_Watcher or OPDG then it&#8217;s time to check this note out! :)]]></description>
			<content:encoded><![CDATA[<p>There&#8217;s a nice Metalink Note <strong>438452.1</strong> about various less known Oracle performance tuning utilities.</p>
<p>If you haven&#8217;t heard about things like StackX, LTOM, HangFG, SQLTXPLAIN, OS_Watcher or OPDG then it&#8217;s time to check this note out! :)</p>
<div class="facebook_like_button"><iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fblog.tanelpoder.com%2F2008%2F06%2F03%2Fperformance-tools-quick-reference-guide%2F&amp;layout=standard&amp;show-faces=true&amp;width=450&amp;action=like&amp;font=arial&amp;colorscheme=light" scrolling="no" frameborder="0" allowTransparency="true" style="padding: 0px 0px; border:none; overflow:hidden; width:450px; height:70px;"></iframe></div> <img src="http://blog.tanelpoder.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=73" width="1" height="1" style="display: none;" /><p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://blog.tanelpoder.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://blog.tanelpoder.com/2008/06/03/performance-tools-quick-reference-guide/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Future appearances</title>
		<link>http://blog.tanelpoder.com/2008/03/06/future-appearances/</link>
		<comments>http://blog.tanelpoder.com/2008/03/06/future-appearances/#comments</comments>
		<pubDate>Wed, 05 Mar 2008 21:09:21 +0000</pubDate>
		<dc:creator>Tanel Poder</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://tanelpoder.wordpress.com/?p=64</guid>
		<description><![CDATA[In addition to Hotsos Symposium this week, I will deliver my Advanced Oracle Troubleshooting presentation and demos at NYOUG DBA SIG this Thursday (06. March 2008) in Oracle&#8217;s Park Avenue office in Manhattan, NYC. If you are interested, see the details at http://www.nyoug.org/upcoming_events.htm#dbaname Also, I will be speaking at Trivadis Performance Days in Zurich  23.-24. April 2008. [...]]]></description>
			<content:encoded><![CDATA[<p>In addition to Hotsos Symposium this week, I will deliver my Advanced Oracle Troubleshooting presentation and demos at NYOUG DBA SIG this Thursday (06. March 2008) in Oracle&#8217;s Park Avenue office in Manhattan, NYC. If you are interested, see the details at <a href="http://blog.tanelpoder.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy5ueW91Zy5vcmcvdXBjb21pbmdfZXZlbnRzLmh0bSNkYmFuYW1l">http://www.nyoug.org/upcoming_events.htm#dbaname</a></p>
<p>Also, I will be speaking at Trivadis Performance Days in Zurich  23.-24. April 2008. I will deliver the following presentations/demos:</p>
<ul>
<li>
<div>Advanced Oracle Troubleshooting</div>
</li>
<li>
<div>Performance and Scalability Improvements in Oracle 10g and 11g</div>
</li>
</ul>
<p> If you are interested, visit this link:</p>
<p><a href="http://blog.tanelpoder.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cHM6Ly93d3cudHJpdmFkaXMuY29tL3Nob3AvS3Vyc2RldGFpbC5hc3B4P0thdGVnb3JpZUlEPTImYW1wO1N1YmthdGVnb3JpZUlEPTc4JmFtcDtLdXJzZUlEPTYwOA==">https://www.trivadis.com/shop/Kursdetail.aspx?KategorieID=2&amp;SubkategorieID=78&amp;KurseID=608</a></p>
<div class="facebook_like_button"><iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fblog.tanelpoder.com%2F2008%2F03%2F06%2Ffuture-appearances%2F&amp;layout=standard&amp;show-faces=true&amp;width=450&amp;action=like&amp;font=arial&amp;colorscheme=light" scrolling="no" frameborder="0" allowTransparency="true" style="padding: 0px 0px; border:none; overflow:hidden; width:450px; height:70px;"></iframe></div> <img src="http://blog.tanelpoder.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=64" width="1" height="1" style="display: none;" /><p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://blog.tanelpoder.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://blog.tanelpoder.com/2008/03/06/future-appearances/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Cary Millsap is blogging</title>
		<link>http://blog.tanelpoder.com/2008/02/07/cary-millsap-is-blogging/</link>
		<comments>http://blog.tanelpoder.com/2008/02/07/cary-millsap-is-blogging/#comments</comments>
		<pubDate>Thu, 07 Feb 2008 11:05:52 +0000</pubDate>
		<dc:creator>Tanel Poder</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://tanelpoder.wordpress.com/2008/02/07/cary-millsap-is-blogging/</guid>
		<description><![CDATA[If you work with Oracle databases and are interested in system performance, then you probably want to know what Cary Millsap has to say. So, make sure you bookmark his blog: http://carymillsap.blogspot.com/]]></description>
			<content:encoded><![CDATA[<p>If you work with Oracle databases and are interested in system performance, then you probably want to know what Cary Millsap has to say. So, make sure you bookmark his blog: <a href="http://blog.tanelpoder.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2NhcnltaWxsc2FwLmJsb2dzcG90LmNvbS8=" target=\"_blank\">http://carymillsap.blogspot.com/</a></p>
<div class="facebook_like_button"><iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fblog.tanelpoder.com%2F2008%2F02%2F07%2Fcary-millsap-is-blogging%2F&amp;layout=standard&amp;show-faces=true&amp;width=450&amp;action=like&amp;font=arial&amp;colorscheme=light" scrolling="no" frameborder="0" allowTransparency="true" style="padding: 0px 0px; border:none; overflow:hidden; width:450px; height:70px;"></iframe></div> <img src="http://blog.tanelpoder.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=61" width="1" height="1" style="display: none;" /><p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://blog.tanelpoder.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://blog.tanelpoder.com/2008/02/07/cary-millsap-is-blogging/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
