<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments on: Analysing Statspack 12</title>
	<atom:link href="http://jonathanlewis.wordpress.com/2010/04/14/analysing-statspack-12/feed/" rel="self" type="application/rss+xml" />
	<link>http://jonathanlewis.wordpress.com/2010/04/14/analysing-statspack-12/</link>
	<description>Just another Oracle weblog</description>
	<lastBuildDate>Wed, 19 Jun 2013 18:51:29 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
	<item>
		<title>By: Jonathan Lewis</title>
		<link>http://jonathanlewis.wordpress.com/2010/04/14/analysing-statspack-12/#comment-56105</link>
		<dc:creator><![CDATA[Jonathan Lewis]]></dc:creator>
		<pubDate>Sun, 09 Jun 2013 11:55:34 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=1429#comment-56105</guid>
		<description><![CDATA[Peter,

It&#039;s not my comment, it&#039;s Timur&#039;s. He is, however, one of the Oracle specialists I would tend to put in the category of &quot;probably correct until shown otherwise&quot;.

It certainly makes sense to me that a null pl/sql block could be faster than a query; and it makes sense to me that you won&#039;t find any other reference to this as a strategy - after all, someone has to be the first to suggest a new method, and end-users often come up with clever ideas while the Oracle manuals (and the authors that copy them) are very slow to change their suggestions.]]></description>
		<content:encoded><![CDATA[<p>Peter,</p>
<p>It&#8217;s not my comment, it&#8217;s Timur&#8217;s. He is, however, one of the Oracle specialists I would tend to put in the category of &#8220;probably correct until shown otherwise&#8221;.</p>
<p>It certainly makes sense to me that a null pl/sql block could be faster than a query; and it makes sense to me that you won&#8217;t find any other reference to this as a strategy &#8211; after all, someone has to be the first to suggest a new method, and end-users often come up with clever ideas while the Oracle manuals (and the authors that copy them) are very slow to change their suggestions.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Peter</title>
		<link>http://jonathanlewis.wordpress.com/2010/04/14/analysing-statspack-12/#comment-55052</link>
		<dc:creator><![CDATA[Peter]]></dc:creator>
		<pubDate>Sat, 27 Apr 2013 14:31:44 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=1429#comment-55052</guid>
		<description><![CDATA[Jonathan,
I&#039;m interested in your comment about &#039;select 1 from dual&#039; in jdbc applications. We have such an app using Tomcat connection pooling, and AWR reports show &#039;select 1 from dual&#039; being executed millions of times per hour. This is what is used as the jdbc validation query. Although an inexpensive query, when executed many millions times it does consume cpu and is responsible for significant soft parsing. Are you suggesting that we can improve the situation by replacing &#039;select 1 from dual&#039; with &#039;begin null; end;&#039;?  From some basic (non-java) tests i can see that running millions of &#039;select 1 from dual&#039; in a loop is significantly slower then millions of &#039;begin null; end;&#039; Am I missing something here? Your suggestion seems like a huge improvement, yet I can find no other reference to using this as a validation query.
I&#039;m interested to hear what you have to say.
Thanks,
Peter]]></description>
		<content:encoded><![CDATA[<p>Jonathan,<br />
I&#8217;m interested in your comment about &#8216;select 1 from dual&#8217; in jdbc applications. We have such an app using Tomcat connection pooling, and AWR reports show &#8216;select 1 from dual&#8217; being executed millions of times per hour. This is what is used as the jdbc validation query. Although an inexpensive query, when executed many millions times it does consume cpu and is responsible for significant soft parsing. Are you suggesting that we can improve the situation by replacing &#8216;select 1 from dual&#8217; with &#8216;begin null; end;&#8217;?  From some basic (non-java) tests i can see that running millions of &#8216;select 1 from dual&#8217; in a loop is significantly slower then millions of &#8216;begin null; end;&#8217; Am I missing something here? Your suggestion seems like a huge improvement, yet I can find no other reference to using this as a validation query.<br />
I&#8217;m interested to hear what you have to say.<br />
Thanks,<br />
Peter</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jonathan Lewis</title>
		<link>http://jonathanlewis.wordpress.com/2010/04/14/analysing-statspack-12/#comment-36060</link>
		<dc:creator><![CDATA[Jonathan Lewis]]></dc:creator>
		<pubDate>Sat, 17 Apr 2010 10:58:59 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=1429#comment-36060</guid>
		<description><![CDATA[Timur,

Thanks for adding all these details.]]></description>
		<content:encoded><![CDATA[<p>Timur,</p>
<p>Thanks for adding all these details.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Timur Akhmadeev</title>
		<link>http://jonathanlewis.wordpress.com/2010/04/14/analysing-statspack-12/#comment-36043</link>
		<dc:creator><![CDATA[Timur Akhmadeev]]></dc:creator>
		<pubDate>Thu, 15 Apr 2010 08:13:16 +0000</pubDate>
		<guid isPermaLink="false">http://jonathanlewis.wordpress.com/?p=1429#comment-36043</guid>
		<description><![CDATA[Jonathan,

to be clear: objects in &quot;Segments by global cache buffer busy&quot; and JAVA_XA package are not related. Mentioned tables/indexes are used by the application - and no matter what kind of connectivity to Oracle it uses, the objects and it&#039;s usage pattern suggests that the application will not work well in RAC without taking additional steps. JMS_MESSAGES and JMS_TRANSACTIONS are JBoss MQ &lt;a href=&quot;http://docs.jboss.org/jbossas/admin-devel/Chap6.html#0_82559&quot; rel=&quot;nofollow&quot;&gt;service tables&lt;/a&gt; (for ACID-ing JMS transactions). SQL queries from the link match SQLs in AWR (and there are DDLs for tables). JMS_TRANSACTION has no indexes (by default) - possibly developers were thinking it will be small enough and/or they were saving some space. Chances are high that it requires an index (maybe globally hash-partitioned) with increased PCTFREE on table, or table should be single-table hash cluster, or hash-partitioned, etc - there are options to decrease &#039;gc buffer busy&#039;. JMS_MESSAGES has a PK constraint with (I guess) increasing values which most likely the cause of cluster wait time for SQLs accessing the table.

JAVA_XA is an internal Oracle package used by JDBC drivers version less then 10g when XA is needed. 10g JDBC Thin driver can do this &lt;a href=&quot;http://download.oracle.com/docs/cd/B19306_01/java.102/b14355/xadistra.htm#BGBIDIGD&quot; rel=&quot;nofollow&quot;&gt;natively&lt;/a&gt;, and as a result faster (this is Oracle claim; I don&#039;t have numbers to compare performance). So, the calls to JAVA_XA are coming implicitly from the driver to demarcate transaction boundaries in a distributed environment (&lt;a href=&quot;http://download.oracle.com/docs/cd/E11882_01/appdev.112/e10577/d_xa.htm#BABCIBED&quot; rel=&quot;nofollow&quot;&gt;DBMS_XA&lt;/a&gt; in 11g has similar documented functionality). It is implemented using Oracle JVM - i.e. procedures are simple wrappers for Java methods inside the DB. This can be seen in AWR as &#039;Java execution elapsed time&#039; - ~13%.

Another bad habit of JDBC applications is a query which usually looks like &#039;select 1 from dual&#039; (SELECT &#039;x&#039; FROM DUAL in AWR), executed many times. This is a checking query to validate connection - is it alive or not. The fact is &#039;select 1 from dual&#039; is not the cheapest query for such task (as probably expected by someone), but &#039;begin null; end;&#039; is. Usually it is a configuration option somewhere in the application configuration for the data source and can be easily modified.]]></description>
		<content:encoded><![CDATA[<p>Jonathan,</p>
<p>to be clear: objects in &#8220;Segments by global cache buffer busy&#8221; and JAVA_XA package are not related. Mentioned tables/indexes are used by the application &#8211; and no matter what kind of connectivity to Oracle it uses, the objects and it&#8217;s usage pattern suggests that the application will not work well in RAC without taking additional steps. JMS_MESSAGES and JMS_TRANSACTIONS are JBoss MQ <a href="http://docs.jboss.org/jbossas/admin-devel/Chap6.html#0_82559" rel="nofollow">service tables</a> (for ACID-ing JMS transactions). SQL queries from the link match SQLs in AWR (and there are DDLs for tables). JMS_TRANSACTION has no indexes (by default) &#8211; possibly developers were thinking it will be small enough and/or they were saving some space. Chances are high that it requires an index (maybe globally hash-partitioned) with increased PCTFREE on table, or table should be single-table hash cluster, or hash-partitioned, etc &#8211; there are options to decrease &#8216;gc buffer busy&#8217;. JMS_MESSAGES has a PK constraint with (I guess) increasing values which most likely the cause of cluster wait time for SQLs accessing the table.</p>
<p>JAVA_XA is an internal Oracle package used by JDBC drivers version less then 10g when XA is needed. 10g JDBC Thin driver can do this <a href="http://download.oracle.com/docs/cd/B19306_01/java.102/b14355/xadistra.htm#BGBIDIGD" rel="nofollow">natively</a>, and as a result faster (this is Oracle claim; I don&#8217;t have numbers to compare performance). So, the calls to JAVA_XA are coming implicitly from the driver to demarcate transaction boundaries in a distributed environment (<a href="http://download.oracle.com/docs/cd/E11882_01/appdev.112/e10577/d_xa.htm#BABCIBED" rel="nofollow">DBMS_XA</a> in 11g has similar documented functionality). It is implemented using Oracle JVM &#8211; i.e. procedures are simple wrappers for Java methods inside the DB. This can be seen in AWR as &#8216;Java execution elapsed time&#8217; &#8211; ~13%.</p>
<p>Another bad habit of JDBC applications is a query which usually looks like &#8216;select 1 from dual&#8217; (SELECT &#8216;x&#8217; FROM DUAL in AWR), executed many times. This is a checking query to validate connection &#8211; is it alive or not. The fact is &#8216;select 1 from dual&#8217; is not the cheapest query for such task (as probably expected by someone), but &#8216;begin null; end;&#8217; is. Usually it is a configuration option somewhere in the application configuration for the data source and can be easily modified.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
