<?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; Networking</title>
	<atom:link href="http://blog.tanelpoder.com/category/networking/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>Using Perfsheet and TPT scripts for solving real life performance problems</title>
		<link>http://blog.tanelpoder.com/2009/06/09/using-perfsheet-and-tpt-scripts-for-solving-real-life-performance-problems/</link>
		<comments>http://blog.tanelpoder.com/2009/06/09/using-perfsheet-and-tpt-scripts-for-solving-real-life-performance-problems/#comments</comments>
		<pubDate>Tue, 09 Jun 2009 22:27:52 +0000</pubDate>
		<dc:creator>Tanel Poder</dc:creator>
				<category><![CDATA[Cool stuff]]></category>
		<category><![CDATA[Networking]]></category>
		<category><![CDATA[Oracle]]></category>
		<category><![CDATA[Troubleshooting]]></category>

		<guid isPermaLink="false">http://blog.tanelpoder.com/2009/06/09/using-perfsheet-and-tpt-scripts-for-solving-real-life-performance-problems/</guid>
		<description><![CDATA[Karl Arao has written a nice blog entry where he used also some of my tools for visualizing and understanding performance of a RAC cluster suddenly gone slow. He presents a systematic approach he used for gathering evidence and also hopefully you notice that having the ability to easily visualize performance data (with PerfSheet for [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://blog.tanelpoder.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2thcmxhcmFvLndvcmRwcmVzcy5jb20=">Karl Arao</a> has written a nice blog entry where he used also some of my tools for visualizing and understanding performance of a RAC cluster suddenly gone slow. He presents a systematic approach he used for gathering <i>evidence</i> and also hopefully you notice that having the ability to easily visualize performance data (with <a href="http://blog.tanelpoder.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2Jsb2cudGFuZWxwb2Rlci5jb20vMjAwOC8xMi8yOC9wZXJmb3JtYW5jZS12aXN1YWxpemF0aW9uLW1hZGUtZWFzeS1wZXJmc2hlZXQtMjAtYmV0YS8=">PerfSheet</a> for example) can be very helpful and time saving when troubleshooting non-trivial problems.</p>
<p>Check his blog entry out here:</p>
<p><a href="http://blog.tanelpoder.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2thcmxhcmFvLndvcmRwcmVzcy5jb20vMjAwOS8wNi8wNy9kaWFnbm9zaW5nLWFuZC1yZXNvbHZpbmctZ2MtYmxvY2stbG9zdC8=">http://karlarao.wordpress.com/2009/06/07/diagnosing-and-resolving-gc-block-lost/</a></p>
<div class="facebook_like_button"><iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fblog.tanelpoder.com%2F2009%2F06%2F09%2Fusing-perfsheet-and-tpt-scripts-for-solving-real-life-performance-problems%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=339" 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/06/09/using-perfsheet-and-tpt-scripts-for-solving-real-life-performance-problems/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>Identifying shared memory segment users using lsof</title>
		<link>http://blog.tanelpoder.com/2009/01/22/identifying-shared-memory-segment-users-using-lsof/</link>
		<comments>http://blog.tanelpoder.com/2009/01/22/identifying-shared-memory-segment-users-using-lsof/#comments</comments>
		<pubDate>Thu, 22 Jan 2009 12:42:45 +0000</pubDate>
		<dc:creator>Tanel Poder</dc:creator>
				<category><![CDATA[Administration]]></category>
		<category><![CDATA[Networking]]></category>
		<category><![CDATA[Oracle]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[Troubleshooting]]></category>
		<category><![CDATA[Unix/Linux]]></category>

		<guid isPermaLink="false">http://blog.tanelpoder.com/?p=192</guid>
		<description><![CDATA[Lsof (list open files) is a really useful tool for troubleshooting open file decriptors which prevent a deleted file from being released or a shared memory segment from being removed. Here&#8217;s a little situation on Linux where an Oracle shared memory segment was not released as someone was still using it. $ ipcs -ma ------ [...]]]></description>
			<content:encoded><![CDATA[<p>Lsof (list open files) is a really useful tool for troubleshooting open file decriptors which prevent a deleted file from being released or a shared memory segment from being removed.</p>
<p>Here&#8217;s a little situation on Linux where an Oracle shared memory segment was not released as someone was still using it.</p>
<pre><code>$ ipcs -ma

------ Shared Memory Segments --------
key        shmid      owner      perms      bytes      nattch     status
<b>0x00000000 393216     oracle    640        289406976  1          dest
</b>0xbfb94e30 425985     oracle    640        289406976  18
0x3cf13430 557058     oracle    660        423624704  22

------ Semaphore Arrays --------
key        semid      owner      perms      nsems
0xe2260ff0 1409024    oracle    640        154
0x9df96b74 1671169    oracle    660        154

------ Message Queues --------
key        msqid      owner      perms      used-bytes   messages

</code></pre>
<p>The bold line should have disappeared after instance shutdown, but it didn&#8217;t. From &#8220;natcch&#8221; (number of attached processes) column I see there is still some process using the shared memory segment. Thus the segment was not released and even <b>ipcrm</b> command did not remove it (just like with normal files if someone has them open).</p>
<p>So, I needed to identify which process was still using the memory segment. If that had been a normal existing file, I&#8217;d could have used <b>/sbin/fuser</b> command to see which process still holds it open, but this only works for existing files with existing directory entries.</p>
<p>However for deleted files, sockets and shared memory segments, you can use lsof command (it&#8217;s normally installed by default on Linux, but for Unixes you need to separately download and install).</p>
<p>The SHM ID of that segment was 393216 as ipcs -ma showed, so I simply run lsof to show all open file descriptors and grep for that SHM ID:</p>
<pre><code>$ lsof | egrep "393216|COMMAND"
COMMAND     PID      USER   FD      TYPE     DEVICE       SIZE       NODE NAME
python    18811    oracle  DEL       REG        0,8                393216 /SYSVbfb94e30

</code></pre>
<p>See how the NODE column corresponds to SHM ID in ipcs output.</p>
<p>So I kill the PID 18811 which is still attached to the SHM segment:</p>
<pre><code>$ kill 18811

$ ipcs -ma

------ Shared Memory Segments --------
key        shmid      owner      perms      bytes      nattch     status
0xbfb94e30 425985     oracle    640        289406976  18
0x3cf13430 557058     oracle    660        423624704  25

------ Semaphore Arrays --------
key        semid      owner      perms      nsems
0xe2260ff0 1409024    oracle    640        154
0x9df96b74 1671169    oracle    660        154

------ Message Queues --------
key        msqid      owner      perms      used-bytes   messages

</code></pre>
<p>Now the shared memory segment is gone and its memory released.</p>
<p>Note that the <b>lsof</b> command is very useful for many other tasks as well. For example it allows you to list open sockets by network protocol, IP, port etc. For example you can determine to which client some server process is talking to, from OS level:</p>
<pre><code>$ <b>lsof -i:1521</b>
COMMAND   PID   USER   FD   TYPE DEVICE SIZE NODE NAME
tnslsnr  6212 oracle   11u  IPv4  49486       TCP *:1521 (LISTEN)
tnslsnr  6212 oracle   13u  IPv4 276708       TCP linux03:1521->linux03:37277 (ESTABLISHED)
tnslsnr  6212 oracle   14u  IPv4 264894       TCP linux03:1521->linux03:41122 (ESTABLISHED)
oracle  22687 oracle   20u  IPv4 264893       TCP linux03:41122->linux03:1521 (ESTABLISHED)
oracle  25250 oracle   15u  IPv4 276707       TCP linux03:37277->linux03:1521 (ESTABLISHED)
oracle  25530 oracle   15u  IPv4 279910       TCP linux03:1521->192.168.247.1:nimsh (ESTABLISHED)

</code></pre>
<p>Unfortunately lsof is not installed by default in classic Unixes, but in some shops the sysadmins have chosen to install it. But even then, it may not work for regular users as lsof requires access to kernel memory structures through /dev/kmem or similar. If you can&#8217;t get access to lsof then there may be other tools available which can do some tricks lsof can do. For example on Solaris, there&#8217;s an useful command <b>pfiles</b> which can show open files of a process and since Solaris 9 ( I think ) it can also report the TCP connection endpoints of network sockets&#8230;</p>
<div class="facebook_like_button"><iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fblog.tanelpoder.com%2F2009%2F01%2F22%2Fidentifying-shared-memory-segment-users-using-lsof%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=192" 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/01/22/identifying-shared-memory-segment-users-using-lsof/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>New year and some news&#8230;</title>
		<link>http://blog.tanelpoder.com/2009/01/05/new-year-and-some-news/</link>
		<comments>http://blog.tanelpoder.com/2009/01/05/new-year-and-some-news/#comments</comments>
		<pubDate>Mon, 05 Jan 2009 16:25:47 +0000</pubDate>
		<dc:creator>Tanel Poder</dc:creator>
				<category><![CDATA[Administration]]></category>
		<category><![CDATA[Networking]]></category>
		<category><![CDATA[Oracle]]></category>
		<category><![CDATA[Oracle 11g]]></category>
		<category><![CDATA[Performance]]></category>
		<category><![CDATA[Productivity]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[Training]]></category>
		<category><![CDATA[Troubleshooting]]></category>

		<guid isPermaLink="false">http://blog.tanelpoder.com/?p=175</guid>
		<description><![CDATA[First, Happy New Year to you all! This year I promise to organize my blog a little better, to have some index of my articles, scripts etc :) Here are the news&#8230; I&#8217;ve moved my blog&#8230; In December, when visiting Shanghai, I noticed that my blog was not accessible from there. Apparently the state firewall [...]]]></description>
			<content:encoded><![CDATA[<p>First, Happy New Year to you all!</p>
<p>This year I promise to organize my blog a little better, to have some index of my articles, scripts etc :)</p>
<p>Here are the news&#8230;</p>
<p><strong>I&#8217;ve moved my blog&#8230;</strong></p>
<p>In December, when visiting Shanghai, I noticed that my blog was not accessible from there. Apparently the state firewall blocks all access to wordpress.com IPs.</p>
<p>So I have moved my blog to a virtual private server, off wordpress.com &#8211; my blog should be accessible from China now as well.</p>
<p><strong></strong></p>
<p><strong>My Advanced Oracle Troubleshooting Seminars in year 2009</strong></p>
<p>If you like the contents of my blog or conference presentations, you&#8217;ll sure like my 2-day seminar!</p>
<p> </p>
<p>Here are the dates and links for more info:</p>
<p><strong>3-4. February &#8211; NYOUG @ New York City</strong> &#8211; <a href="http://blog.tanelpoder.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy5ueW91Zy5vcmcvZXRjL3RyYWluaW5nL2h0bS9OWU9VR19UcmFpbmluZ19TZXNzaW9uLmh0bQ==">http://www.nyoug.org/etc/training/htm/NYOUG_Training_Session.htm</a></p>
<p>NB! As this is my first public seminar in US, you&#8217;ll be able to attend it for a very very good price! And the early bird registration (which gives you even better price) is open until end of today! More seminars in other US cities are planned for 2nd half of 2009.</p>
<p><strong></strong></p>
<p><strong>2-3. April &#8211; Miracle @ Netherlands</strong> &#8211; <a href="http://blog.tanelpoder.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy5taXJhY2xlYnYubmwv">http://www.miraclebv.nl/</a></p>
<p>Probably happens in Utrecht, I&#8217;ll keep you updated if it changes.</p>
<p><strong>13-14. April &#8211; Oracle @ Singapore</strong> &#8211; <a href="http://blog.tanelpoder.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy5vcmFjbGUuY29tL2VkdWNhdGlvbi9hcGFjL3NnX3RhbmVsX3BvZGVyLmh0bWw=">http://www.oracle.com/education/apac/sg_tanel_poder.html</a></p>
<p><strong>16-17. April &#8211; Oracle @ Sydney</strong> &#8211; <a href="http://blog.tanelpoder.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy5vcmFjbGUuY29tL2VkdWNhdGlvbi9hcGFjL2F1X3RhbmVsX3BvZGVyLmh0bWw=">http://www.oracle.com/education/apac/au_tanel_poder.html</a></p>
<p><strong>20-21. April &#8211; Oracle @ Melbourne</strong> &#8211; <a href="http://blog.tanelpoder.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy5vcmFjbGUuY29tL2VkdWNhdGlvbi9hcGFjL2F1X3RhbmVsX3BvZGVyLmh0bWw=">http://www.oracle.com/education/apac/au_tanel_poder.html</a></p>
<p><strong>23-24. April Oracle @ Auckland</strong> &#8211; <a href="http://blog.tanelpoder.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy5vcmFjbGUuY29tL2VkdWNhdGlvbi9hcGFjL256X3RhbmVsX3BvZGVyLmh0bWw=">http://www.oracle.com/education/apac/nz_tanel_poder.html</a></p>
<p><strong>27-28. April &#8211; PiSec Ltd @ Edinburgh</strong> &#8211; <a href="http://blog.tanelpoder.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy5waXNlYy5vcmcvaW5kZXgucGhwP29wdGlvbj1jb21fY29udGVudCZhbXA7dmlldz1hcnRpY2xlJmFtcDtpZD02JmFtcDtJdGVtaWQ9MTI=">http://www.pisec.org/index.php?option=com_content&amp;view=article&amp;id=6&amp;Itemid=12</a></p>
<p><strong>11-12. May &#8211; Oracle @ Spain</strong> &#8211; <a href="http://blog.tanelpoder.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2VkdWNhdGlvbi5vcmFjbGUuY29tL3Bscy93ZWJfcHJvZC1wbHEtZGFkL3Nob3dfZGVzYy5yZWRpcmVjdD9kYz1ENzAzNjVfMTA2MDI0NSZhbXA7cF9vcmdfaWQ9NTEmYW1wO2xhbmc9RSZhbXA7c291cmNlX2NhbGw9">http://education.oracle.com/pls/web_prod-plq-dad/show_desc.redirect?dc=D70365_1060245&amp;p_org_id=51&amp;lang=E&amp;source_call=</a></p>
<p><strong>18-19. May &#8211; Miracle @ Denmark</strong> &#8211; <a href="http://blog.tanelpoder.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy5taXJhY2xlYXMuZGsvaW5kZXgucGhwP29wdGlvbj1jb21fY29udGVudCZhbXA7dmlldz1hcnRpY2xlJmFtcDtpZD0xMDA6YWR2YW5jZWQtb3JhY2xlLXRyb3VibGVzaG9vdGluZyZhbXA7Y2F0aWQ9MTk6aW5mbyZhbXA7SXRlbWlkPTcx">http://www.miracleas.dk/index.php?option=com_content&amp;view=article&amp;id=100:advanced-oracle-troubleshooting&amp;catid=19:info&amp;Itemid=71</a></p>
<p> </p>
<p>Note that the Advanced Oracle Troubleshooting seminar is meant mainly for <em>experienced</em> DBAs and performance engineers as I go <em>very</em> deep in Oracle internals and OS/hardware details.</p>
<p>See more details about my seminar <a href="http://blog.tanelpoder.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2Jsb2cudGFuZWxwb2Rlci5jb20vc2VtaW5hci8=">here</a></p>
<p><strong></strong></p>
<p><strong>Conferences in 2009</strong></p>
<p><strong>11-12. February &#8211; RMOUG Conference @ Denver, Colorado</strong></p>
<p>I will be delivering two presentations about advanced Oracle troubleshooting, tuning and internals:</p>
<ul>
<li><a href="http://blog.tanelpoder.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy50ZWNobmljYWxjb25mZXJlbmNlc29sdXRpb25zLmNvbS9wbHMvY2FhdC9jYWF0X2Fic3RyYWN0X3JlcG9ydHMuZGlzcGxheV9wcmVzZW50ZXJfYWJzdHJhY3Q/Y29uZmVyZW5jZV9pZD0zOSZhbXA7cHJlc2VudGVyX2lkPTE3NiZhbXA7YWJzdHJhY3RfaWQ9MTA4">Advanced Oracle Troubleshooting: No Magic is Needed, Systematic Approach Will Do</a></li>
<li><a href="http://blog.tanelpoder.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy50ZWNobmljYWxjb25mZXJlbmNlc29sdXRpb25zLmNvbS9wbHMvY2FhdC9jYWF0X2Fic3RyYWN0X3JlcG9ydHMuZGlzcGxheV9wcmVzZW50ZXJfYWJzdHJhY3Q/Y29uZmVyZW5jZV9pZD0zOSZhbXA7cHJlc2VudGVyX2lkPTE3NiZhbXA7YWJzdHJhY3RfaWQ9MTA5">Understanding Oracle Execution Plans: How SQL is Really Executed</a></li>
</ul>
<p><strong>8-12. March &#8211; Hotsos Symposium @ Dallas, Texas</strong></p>
<p>I will be delivering two presentations:</p>
<ul>
<li><a href="http://blog.tanelpoder.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy5ob3Rzb3MuY29tL3N5bV9zcGVha2Vyc19wb2Rlci5odG1s">Understanding Oracle SQL Plan Execution: How It Really Works</a></li>
<li><a href="http://blog.tanelpoder.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy5ob3Rzb3MuY29tL3N5bV9zcGVha2Vyc19wb2Rlci5odG1s">Zero Slides: The Scripts and Tools which Will Make Your Life Easier and Allow You to Troubleshoot Better</a></li>
</ul>
<p>As the second title says, I don&#8217;t use <em>any</em> slides at that presentation, I will just demo some of the scripts and tools I use every day plus few case studies. It will be fun!</p>
<p>Also, I look forward attending the <a href="http://blog.tanelpoder.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy5ob3Rzb3MuY29tL3N5bV90cmFpbmluZy5odG1s">Training Day by Jonathan Lewis</a> on Oracle troubleshooting, on last day of the Symposium.</p>
<div class="facebook_like_button"><iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fblog.tanelpoder.com%2F2009%2F01%2F05%2Fnew-year-and-some-news%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=175" 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/01/05/new-year-and-some-news/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Oracle Net8 tuning whitepaper</title>
		<link>http://blog.tanelpoder.com/2008/07/17/oracle-net8-tuning-whitepaper/</link>
		<comments>http://blog.tanelpoder.com/2008/07/17/oracle-net8-tuning-whitepaper/#comments</comments>
		<pubDate>Wed, 16 Jul 2008 22:12:36 +0000</pubDate>
		<dc:creator>Tanel Poder</dc:creator>
				<category><![CDATA[Administration]]></category>
		<category><![CDATA[Networking]]></category>
		<category><![CDATA[Oracle]]></category>
		<category><![CDATA[Performance]]></category>

		<guid isPermaLink="false">http://tanelpoder.wordpress.com/2008/07/17/oracle-net8-tuning-whitepaper/</guid>
		<description><![CDATA[Todays post will be short :) I recently found a a pretty good article by Sun about Oracle Net8 tuning, SDU/TDU parameter sizes and some test results. Here it is: http://www.sun.com/blueprints/1002/817-0370-10.pdf Addition: While at it, here&#8217;s also a another good document on TCP tuning in general. Recommended reading, especially if you&#8217;re dealing with tuning database [...]]]></description>
			<content:encoded><![CDATA[<p>Todays post will be short :)</p>
<p>I recently found a a pretty good article by Sun about Oracle Net8 tuning, SDU/TDU parameter sizes and some test results. Here it is:</p>
<p><a href="http://blog.tanelpoder.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy5zdW4uY29tL2JsdWVwcmludHMvMTAwMi84MTctMDM3MC0xMC5wZGY=" target=\"_blank\">http://www.sun.com/blueprints/1002/817-0370-10.pdf</a></p>
<p><em>Addition:</em></p>
<p>While at it, here&#8217;s also a another good document on TCP tuning in general. Recommended reading, especially if you&#8217;re dealing with tuning database (or application access) over WAN networks.</p>
<p><a href="http://blog.tanelpoder.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy5zdW4uY29tL2JsdWVwcmludHMvMDMwNC84MTctNTc3My5wZGY=">http://www.sun.com/blueprints/0304/817-5773.pdf</a></p>
<div class="facebook_like_button"><iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fblog.tanelpoder.com%2F2008%2F07%2F17%2Foracle-net8-tuning-whitepaper%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=92" 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/07/17/oracle-net8-tuning-whitepaper/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>SQL*Net break/reset to client</title>
		<link>http://blog.tanelpoder.com/2008/04/10/sqlnet-breakreset-to-client/</link>
		<comments>http://blog.tanelpoder.com/2008/04/10/sqlnet-breakreset-to-client/#comments</comments>
		<pubDate>Wed, 09 Apr 2008 16:50:49 +0000</pubDate>
		<dc:creator>Tanel Poder</dc:creator>
				<category><![CDATA[Internals]]></category>
		<category><![CDATA[Networking]]></category>
		<category><![CDATA[Oracle]]></category>
		<category><![CDATA[Performance]]></category>
		<category><![CDATA[Troubleshooting]]></category>

		<guid isPermaLink="false">http://tanelpoder.wordpress.com/2008/04/10/sqlnet-breakreset-to-client/</guid>
		<description><![CDATA[There was a question in Oracle-L mailinglist recently, regarding excessive SQL*Net break/reset to client waiting by a session. A quote is below: We are seeing an insert statement reporting &#8220;SQL*Net break/reset to client&#8221; as over 1/3 of its time. On the face of it this event suggests network issues but nothing else backs this up [...]]]></description>
			<content:encoded><![CDATA[<p>There was a <a href="http://blog.tanelpoder.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy5mcmVlbGlzdHMub3JnL2FyY2hpdmVzL29yYWNsZS1sLzA0LTIwMDgvbXNnMDAyNTAuaHRtbA==" target=\"_blank\">question</a> in Oracle-L mailinglist recently, regarding excessive <b>SQL*Net break/reset to client</b> waiting by a session.</p>
<p>A quote is below:</p>
<p>We are seeing an insert statement reporting &#8220;SQL*Net break/reset to client&#8221; as over 1/3 of its time.<br />
On the face of it this event suggests network issues but nothing else backs this up as the cause.<br />
So I looked at the Java code in question and a trace of one of the sessions.<br />
What is happening is that an attempt is made to insert a row, most of the time a duplicate error results, the code catches this exception and does an update.<br />
I was wondering if its the duplicate error and the exception handling which results in this wait event showing up.</p>
<p>My answer to that was following:</p>
<p><b>Yes, a SQL*Net break/reset happens when an error/unhandled exception is raised during a call (which means that the call executed didn&#8217;t complete normally, thus the call state must be reset).</b></p>
<p>The approach of &#8220;insert -&gt; if failed then update&#8221; is basically what MERGE does.</p>
<p>You need to change the application to use MERGE command. Alternatively you could use an &#8220;update -&gt; if no-rows-updated then insert&#8221; approach, but MERGE makes much more sense nowadays.</p>
<p>So, these waits aren&#8217;t really indicating any network bottleneck, but rather just the fact that the client needs to be notified if it&#8217;s call has failed and Oracle has to clean up after the failed call. Apparently on some (network protocol) architectures or in some scenarios these operations have taken significant time (and may have required a system call), so a kernel developer has decided to wait instrument them.</p>
<p>In this blog entry I want to share a small test case which illustrates the point. First lets check how many times my session has waited for a SQL*Net break/reset wait event:</p>
<pre><code>SQL&gt; select event, total_waits from v$session_event where event like '%reset%' and sid = (select sid from v$mystat where rownum = 1);

no rows selected

</code></pre>
<p>As V$SESSION_EVENT (like also V$SYSTEM_EVENT) doesn&#8217;t display events for which nobody has waited yet, I see that my session&#8217;s wait count for that event is zero.</p>
<p>Now let&#8217;s create an error, but also let&#8217;s handle it in a PL/SQL exception handler:</p>
<p><span id="more-65"></span></p>
<pre><code>SQL&gt; begin
  2     execute immediate 'drop table non_existent';
  3  exception
  4     when others then null;
  5  end;
  6  /

PL/SQL procedure successfully completed.

SQL&gt; select event, total_waits from v$session_event where event like '%reset%' and sid = (select sid from v$mystat where rownum = 1);

no rows selected

</code></pre>
<p>Still no breaks/resets as the error was handled and the OPI call completed properly.</p>
<p>Now let&#8217;s run the same PL/SQL block without exception handler:</p>
<pre><code>SQL&gt; begin
  2     execute immediate 'drop table non_existent';
  3  end;
  4  /
begin
*
ERROR at line 1:
ORA-00942: table or view does not exist
ORA-06512: at line 2

SQL&gt; select event, total_waits from v$session_event where event like '%reset%' and sid = (select sid from v$mystat where rownum = 1);

EVENT                                                            TOTAL_WAITS
---------------------------------------------------------------- -----------
SQL*Net break/reset to client                                              2

</code></pre>
<p>You see, there are 2 break/reset waits registered.</p>
<p>Also normal SQL (not fired from PL/SQL but from top level instead) causes breaks/resets if it errors:</p>
<pre><code>SQL&gt; select * from non_existent;
select * from non_existent
              *
ERROR at line 1:
ORA-00942: table or view does not exist

SQL&gt; select event, total_waits from v$session_event where event like '%reset%' and sid = (select sid from v$mystat where rownum = 1);

EVENT                                                            TOTAL_WAITS
---------------------------------------------------------------- -----------
SQL*Net break/reset to client                                              4

SQL&gt;

</code></pre>
<p>Why 2 waits for a single error? I don&#8217;t know exact details, but the 10046 trace reveals that one of the waits is registered by a break operation and another one (apparently) not, thus it might be the call state reset operation just accounted separately:</p>
<pre><code>=====================
PARSE ERROR #10:len=27 dep=0 uid=0 oct=3 lid=0 tim=1967444453 err=942
select * from non_existent
WAIT #10: nam='SQL*Net break/reset to client' ela= 2 driver id=1413697536 <b>break?=1</b> p3=0 obj#=-1 tim=1967444525
WAIT #10: nam='SQL*Net break/reset to client' ela= 180 driver id=1413697536 <b>break?=0</b> p3=0 obj#=-1 tim=1967444718
WAIT #10: nam='SQL*Net message to client' ela= 2 driver id=1413697536 #bytes=1 p3=0 obj#=-1 tim=1967444752

</code></pre>
<p>Anyway, as I said in my Oracle-L reply, these breaks are caused by bad application design which allows too many unhandled exceptions to be propagated all the way up to the client.</p>
<p>The solutions would be to reduce or eliminate the number of errors occurring, or at least put that code into PL/SQL blocks where errors would be handled and not propagated back to client every time.</p>
<div class="facebook_like_button"><iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fblog.tanelpoder.com%2F2008%2F04%2F10%2Fsqlnet-breakreset-to-client%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=65" 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/04/10/sqlnet-breakreset-to-client/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>SQL*Net message to client vs SQL*Net more data to client</title>
		<link>http://blog.tanelpoder.com/2008/02/10/sqlnet-message-to-client-vs-sqlnet-more-data-to-client/</link>
		<comments>http://blog.tanelpoder.com/2008/02/10/sqlnet-message-to-client-vs-sqlnet-more-data-to-client/#comments</comments>
		<pubDate>Sun, 10 Feb 2008 07:35:58 +0000</pubDate>
		<dc:creator>Tanel Poder</dc:creator>
				<category><![CDATA[Internals]]></category>
		<category><![CDATA[Networking]]></category>
		<category><![CDATA[Oracle]]></category>
		<category><![CDATA[Performance]]></category>

		<guid isPermaLink="false">http://tanelpoder.wordpress.com/2008/02/10/sqlnet-message-to-client-vs-sqlnet-more-data-to-client/</guid>
		<description><![CDATA[After my last post about SQL*Net message to client wait event I had a follow-up question about what&#8217;s the difference between SQL*Net message to client and SQL*Net more data to client wait events. I&#8217;ll post the answer here: The first session data unit (SDU) bufferful of return data is written to TCP socket buffer under [...]]]></description>
			<content:encoded><![CDATA[<p>After my <a href="http://blog.tanelpoder.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2Jsb2cudGFuZWxwb2Rlci5jb20vMjAwOC8wMi8wNy9zcWxuZXQtbWVzc2FnZS10by1jbGllbnQtd2FpdC1nb3RjaGEv" target=\"_blank\">last post about SQL*Net message to client wait event</a> I had a follow-up question about what&#8217;s the difference between <i>SQL*Net message to client</i> and <i>SQL*Net more data to client</i> wait events. I&#8217;ll post the answer here:</p>
<p>The first session data unit (SDU) bufferful of return data is written to TCP socket buffer under &#8220;SQL*Net message to client&#8221; wait event.</p>
<p>If Oracle needs to write more data for <b>a call</b> than fits into the &#8220;first&#8221; SDU buffer, then further writes for that call are done under <i>SQL*Net more data to client</i> event.</p>
<p>So, whether and how much of the &#8220;SQL*Net more data to client&#8221; vs &#8220;SQL*Net message to client&#8221; waits you see depends on two things:</p>
<ul>
<li>Amount of data returned to client <i>per call</i></li>
<li>Oracle Net SDU size</li>
</ul>
<p>A quick test with my <a href="http://blog.tanelpoder.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2Jsb2cudGFuZWxwb2Rlci5jb20vMjAwNy8xMi8wNi9vcmFjbGUtc2Vzc2lvbi1zbmFwcGVyLXYxMDYtcmVsZWFzZWQv" target=\"_blank\">Snapper</a> performance tool illustrates this:</p>
<p>In one session run following:</p>
<pre><code>SQL&gt; set arraysize 1
SQL&gt;
SQL&gt; select rownum from dba_source;

    ROWNUM
----------
         1
         2
         3
         4
         5
         6
<i>...many rows returned...</i>
</code></pre>
<p>And I measure the waits in the other session:</p>
<pre><code>SQL&gt; @snapper out,gather=w 5 1 141

-- Session Snapper v1.06 by Tanel Poder ( http://www.tanelpoder.com )

---------------------------------------------------------------------------------------------------------------------------------------------
HEAD,     SID, SNAPSHOT START   ,  SECONDS, TYPE, STATISTIC                               ,         DELTA,      D/SEC,     HDELTA,     HD/SEC
---------------------------------------------------------------------------------------------------------------------------------------------
DATA,     141, 20080210 14:59:55,        5, WAIT, SQL*Net message to client               ,          6750,       1350,     6.75ms,     1.35ms
DATA,     141, 20080210 14:59:55,        5, WAIT, SQL*Net message from client             ,       4668258,     933652,      4.67s,   933.65ms
--  End of snap 1

</code></pre>
<p>No SQL*Net more data to client is evidenced above as due the arraysize = 1 setting Oracle fetches only 2 rows at a time. Therefore the returned resultset <i>per fetch call</i> always fits into the first SDU sized packet. Note that the reason why Oracle fetches 2 rows when arraysize is 1 is due an OCI optimization which tries to be clever and proactively detect end-of-resultset conditions when fetching a single row &#8211; that way there&#8217;s a chance to automatically cancel a cursor and release its pins without an explicit cursor cancel or close call. This should have positive effect reducing shared pool fragmentation in some conditions.</p>
<p>Anyway, now I set arraysize to 5000 and run the same SQL again:</p>
<p><span id="more-62"></span></p>
<pre><code>SQL&gt; set arraysize 5000
SQL&gt;
SQL&gt; select rownum from dba_source;

    ROWNUM
----------
         1
         2
         3
         4
         5
         6
<i>...many rows returned...</i>
</code></pre>
<p>And snapper output is below:</p>
<pre><code>SQL&gt; @snapper out,gather=w 5 1 141

-- Session Snapper v1.06 by Tanel Poder ( http://www.tanelpoder.com )

---------------------------------------------------------------------------------------------------------------------------------------------
HEAD,     SID, SNAPSHOT START   ,  SECONDS, TYPE, STATISTIC                               ,         DELTA,      D/SEC,     HDELTA,     HD/SEC
---------------------------------------------------------------------------------------------------------------------------------------------
DATA,     141, 20080210 15:00:35,        5, WAIT, SQL*Net message to client               ,            32,          6,       32us,      6.4us
DATA,     141, 20080210 15:00:35,        5, WAIT, <b>SQL*Net more data to client</b>             ,          2925,        585,     2.93ms,      585us
DATA,     141, 20080210 15:00:35,        5, WAIT, SQL*Net message from client             ,       4861859,     972372,      4.86s,   972.37ms
--  End of snap 1

</code></pre>
<p>Now we see SQL*Net more data to client waits as well as the 5000 rows returned for every fetch call just don&#8217;t fit into a single SDU buffer.</p>
<p>I&#8217;ll reiterate that both SQL*Net message to client and SQL*Net more data to client waits only record the time it took to write the return data from Oracle&#8217;s userland SDU buffer to OS kernel-land TCP socket buffer. Thus the wait times of only microseconds. Thanks to that, all of the time a TCP packet spent &#8220;flying&#8221; towards the client is actually accounted in <i>SQL*Net message <b>from</b> client</i> wait statistic. The problem here is though, that we don&#8217;t know how much of this time was spent on the wire and how much of it was application think time.</p>
<p>Therefore, unless you&#8217;re going to buy a tool which is able to interpret TCP ACK echo timestamps, you need to measure network latency using application side instrumentation.</p>
<div class="facebook_like_button"><iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fblog.tanelpoder.com%2F2008%2F02%2F10%2Fsqlnet-message-to-client-vs-sqlnet-more-data-to-client%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=62" 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/10/sqlnet-message-to-client-vs-sqlnet-more-data-to-client/feed/</wfw:commentRss>
		<slash:comments>21</slash:comments>
		</item>
	</channel>
</rss>
