<?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/"
	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>Vivek Agarwal's Portal/Java Blog &#187; Oracle</title>
	<atom:link href="http://vivekagarwal.wordpress.com/category/oracle/feed/" rel="self" type="application/rss+xml" />
	<link>http://vivekagarwal.wordpress.com</link>
	<description>An IBM Gold Consultant's weblog about IBM, Lotus, WebSphere, J2EE, IT Processes, and other IT technologies</description>
	<lastBuildDate>Tue, 27 Oct 2009 03:15:20 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<cloud domain='vivekagarwal.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://www.gravatar.com/blavatar/da8f819b3926c7922045a2bb8dda8053?s=96&#038;d=http://s.wordpress.com/i/buttonw-com.png</url>
		<title>Vivek Agarwal's Portal/Java Blog &#187; Oracle</title>
		<link>http://vivekagarwal.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://vivekagarwal.wordpress.com/osd.xml" title="Vivek Agarwal&#8217;s Portal/Java Blog" />
		<item>
		<title>Firewall dropping Oracle database connections in WebSphere connection pool?</title>
		<link>http://vivekagarwal.wordpress.com/2009/07/04/firewall-dropping-oracle-database-connections-in-websphere-connection-pool/</link>
		<comments>http://vivekagarwal.wordpress.com/2009/07/04/firewall-dropping-oracle-database-connections-in-websphere-connection-pool/#comments</comments>
		<pubDate>Sat, 04 Jul 2009 17:53:02 +0000</pubDate>
		<dc:creator>Vivek Agarwal</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Oracle]]></category>
		<category><![CDATA[WebSphere]]></category>
		<category><![CDATA[Cisco ASA 5520]]></category>
		<category><![CDATA[Cisco firewall]]></category>
		<category><![CDATA[Dropped database connections]]></category>
		<category><![CDATA[sqlnet.expire_time]]></category>

		<guid isPermaLink="false">http://vivekagarwal.wordpress.com/?p=152</guid>
		<description><![CDATA[We recently switched one of our client&#8217;s WebSphere Application Server and WebSphere Portal based infrastructure to a new physical environment. During our testing we found that we were getting stale connection exceptions in SystemOut.log and in the application logs. On digging a little deeper, our team tracked it down to the fact that the Cisco [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=vivekagarwal.wordpress.com&blog=929801&post=152&subd=vivekagarwal&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>We recently switched one of our client&#8217;s WebSphere Application Server and WebSphere Portal based infrastructure to a new physical environment. During our testing we found that we were getting stale connection exceptions in SystemOut.log and in the application logs. On digging a little deeper, our team tracked it down to the fact that the Cisco firewall was dropping our Oracle database connections after they had been inactive for a certain amount of time. When our team discussed the issue with the network team, they were essentially told that all was good with the network infrastructure. The application team tweaked some of the connection pool settings but that only helped alleviate the issue slightly and we started encountering performance issues. Eventually, we figured out a solution that works!</p>
<p><span id="more-152"></span>The solution that we ended up with was to work around this issue on the Oracle end. We modified the sqlnet.expire_time parameter in sqlnet.ora on the Oracle 10g server down from the default &#8220;30&#8243; (30 minutes) to &#8220;1&#8243; (1 minute).</p>
<p><strong>The explanation on why this worked</strong></p>
<p>The parameter <code>SQLNET.EXPIRE_TIME</code> is used to specify the time interval, in minutes, to send a probe to verify that client/server connections are active. If the probe finds a terminated connection, or a connection that is no longer in use, it returns an error, causing the server process to exit. This parameter is primarily intended for the database server so that it can free up server-side resources that are not in use.</p>
<p>A side-effect of the probe is that there is TCP-IP activity between the client and the server each time the probe is executed, and the firewall designates the link as an active one. By lowering the probe interval down to a minute, we managed to fool the firewall into leaving the database connections in the connection pool alone, and not terminate them even though the client may not execute a query using the connection for an extended period of time.</p>
<p>I am sure you can tweak the value of this parameter to determine the optimal value for your firewall and situation; dropping down the sqlnet.expire_time to a minute is probably too radical and redundant in reality. Even though the probe generated by this setting is small, it still does generate network traffic that may be meaningful in some situations.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/vivekagarwal.wordpress.com/152/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/vivekagarwal.wordpress.com/152/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/vivekagarwal.wordpress.com/152/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/vivekagarwal.wordpress.com/152/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/vivekagarwal.wordpress.com/152/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/vivekagarwal.wordpress.com/152/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/vivekagarwal.wordpress.com/152/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/vivekagarwal.wordpress.com/152/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/vivekagarwal.wordpress.com/152/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/vivekagarwal.wordpress.com/152/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=vivekagarwal.wordpress.com&blog=929801&post=152&subd=vivekagarwal&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://vivekagarwal.wordpress.com/2009/07/04/firewall-dropping-oracle-database-connections-in-websphere-connection-pool/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/51b07703056eac6cc06db437b8cfe663?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Vivek</media:title>
		</media:content>
	</item>
		<item>
		<title>Oracle database does not start up automatically!</title>
		<link>http://vivekagarwal.wordpress.com/2008/07/24/oracle-database-does-not-start-up-automatically/</link>
		<comments>http://vivekagarwal.wordpress.com/2008/07/24/oracle-database-does-not-start-up-automatically/#comments</comments>
		<pubDate>Fri, 25 Jul 2008 03:23:24 +0000</pubDate>
		<dc:creator>Vivek Agarwal</dc:creator>
				<category><![CDATA[Oracle]]></category>
		<category><![CDATA[Oracle Database Startup]]></category>

		<guid isPermaLink="false">http://vivekagarwal.wordpress.com/?p=114</guid>
		<description><![CDATA[Today I had to go in to configure multi-master replication between two Oracle databases as our Oracle replication expert was out at a client site. Well, to set up replication, I had to first connect to the database instances, and I found that one of the two instances was not starting up automatically even though [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=vivekagarwal.wordpress.com&blog=929801&post=114&subd=vivekagarwal&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Today I had to go in to configure multi-master replication between two Oracle databases as our Oracle replication expert was out at a client site. Well, to set up replication, I had to first connect to the database instances, and I found that one of the two instances was not starting up automatically even though the Windows service for that instance was started. I remembered that this was a problem that I had to run into a couple of years back but it took me a bit to figure out the core issue and resolve it. So I figured, I might as blog about it in case I run into it again a few years down the road and need to resolve the issue again.</p>
<p><span id="more-114"></span></p>
<p>First things first, I connected to the Oracle instance as a sysdba, and verified that I could  start the instance up manually.</p>
<pre>
C:\Documents and Settings\Administrator&gt;sqlplus "sys/sys_pwd@portal51 as sysdba"

SQL*Plus: Release 9.2.0.6.0 - Production on Thu Jul 24 21:34:39 2008

Copyright (c) 1982, 2002, Oracle Corporation.  All rights reserved.

Connected to an idle instance.

SQL&gt; startup
ORACLE instance started.

Total System Global Area  236003236 bytes
Fixed Size                   454564 bytes
Variable Size             209715200 bytes
Database Buffers           25165824 bytes
Redo Buffers                 667648 bytes
Database mounted.
Database opened.
SQL&gt; exit
Disconnected from Oracle9i Enterprise Edition Release 9.2.0.6.0 - Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.6.0 - Production
</pre>
<p>Once I started up the instance, I connected as a regular user and verified that I could connect. I then restarted the database instance Windows service, and found that once again the instance started up in idle mode. So, obviously something else was needed to have the instance start up automatically in the active mode. That turned out to be fairly straightforward. I opened up the registry editor, navigated to &#8216;HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE\HOME0&#8242;, and found that the value of &#8216;ORA_PORTAL51_AUTOSTART&#8217; (where PORTAL51 was our database SID) was FALSE. I changed that to TRUE, restarted the database instance, and sure enough the instance started up automatically!</p>
<p>PS: In case you are wondering, you did read it right. Yes, setting up multi-master Oracle replication does count as one of my skills &#8211; I had to pick it up many years when I could not get supposedly experienced Oracle DBAs to set it up in a timely enough fashion for my taste! <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/vivekagarwal.wordpress.com/114/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/vivekagarwal.wordpress.com/114/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/vivekagarwal.wordpress.com/114/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/vivekagarwal.wordpress.com/114/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/vivekagarwal.wordpress.com/114/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/vivekagarwal.wordpress.com/114/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/vivekagarwal.wordpress.com/114/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/vivekagarwal.wordpress.com/114/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/vivekagarwal.wordpress.com/114/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/vivekagarwal.wordpress.com/114/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/vivekagarwal.wordpress.com/114/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/vivekagarwal.wordpress.com/114/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=vivekagarwal.wordpress.com&blog=929801&post=114&subd=vivekagarwal&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://vivekagarwal.wordpress.com/2008/07/24/oracle-database-does-not-start-up-automatically/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/51b07703056eac6cc06db437b8cfe663?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Vivek</media:title>
		</media:content>
	</item>
		<item>
		<title>Getting past issues with reverse engineering an Oracle schema with Visio on Vista</title>
		<link>http://vivekagarwal.wordpress.com/2007/12/14/getting-past-issues-with-reverse-engineering-an-oracle-schema-with-visio-on-vista/</link>
		<comments>http://vivekagarwal.wordpress.com/2007/12/14/getting-past-issues-with-reverse-engineering-an-oracle-schema-with-visio-on-vista/#comments</comments>
		<pubDate>Sat, 15 Dec 2007 05:17:15 +0000</pubDate>
		<dc:creator>Vivek Agarwal</dc:creator>
				<category><![CDATA[Oracle]]></category>
		<category><![CDATA[Vista]]></category>
		<category><![CDATA[Windows Vista]]></category>
		<category><![CDATA[Database Model]]></category>
		<category><![CDATA[Microsoft Visio]]></category>
		<category><![CDATA[Reverse Engineer]]></category>
		<category><![CDATA[Visio]]></category>

		<guid isPermaLink="false">http://vivekagarwal.wordpress.com/2007/12/14/getting-past-issues-with-reverse-engineering-an-oracle-schema-with-visio-on-vista/</guid>
		<description><![CDATA[Yesterday, I had the need to reverse engineer an Oracle schema in Microsoft Visio on my now not-so-new Vista laptop. While I had the Oracle JDBC drivers copied onto my Vista laptop, I did not have the Oracle client installed. I first tried to install the Oracle 9i client, because the Oracle schema was in [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=vivekagarwal.wordpress.com&blog=929801&post=89&subd=vivekagarwal&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Yesterday, I had the need to reverse engineer an Oracle schema in Microsoft Visio on my now not-so-new Vista laptop. While I had the Oracle JDBC drivers copied onto my Vista laptop, I did not have the Oracle client installed. I first tried to install the Oracle 9i client, because the Oracle schema was in a Oracle 9i database instance. The Oracle 9i client installer warns about incompatibility with Vista and it certainly lived up to the billing. I saw several other users with postings about issues. I saw one obvious issue with folder permissions and changed ownership/permissions on the Oracle client install folder, but that did not resolve the issue all the way. While trying to configure an ODBC data source (only for reverse engineering the Oracle schema) , I ran into errors that had again been encountered by many. The first error was &#8220;The setup routines for the oracle in orahome92 odbc driver could not be loaded due to system error code 126&#8243;. Clicking ok on this error resulted in a secondary error alert &#8211; &#8220;Could not load the setup or translator library&#8221;. At this point, rather than spend more cycles on the issue, I switched to reverse engineering the schema using the eclipse plugin &#8211; <a href="http://www.azzurri.jp/en/software/clay/" target="_blank">Clay</a>. Clay worked just fine for reverse engineering the schema (took all of 5 minutes), but the issue with it was that it did not allow me to move the foreign key connectors to make them route better. At this point, I was back looking at the Visio route and the solution was extremely simple!<span id="more-89"></span></p>
<p>All I had to do was -</p>
<ul>
<li>Uninstall the Oracle 9i client (more on this later)</li>
<li>Install an Oracle 10g client that was supported for the Vista platform; download the client from <a href="http://www.oracle.com/technology/software/products/database/oracle10g/htdocs/10203vista.html" target="_blank">here</a>. I had to make sure to install the Oracle ODBC driver in this step.</li>
<li>Launch the Oracle 10g Net Manager
<ul>
<li>Create an Oracle TNS listener</li>
<li>Configure a net service name for the Oracle schema that I was trying to reverse engineer. I had to check the checkbox for <em>Use Oracle8 Release 8.0 Compatible Identification</em> so that I could specify the SID. I tested the service to ensure I had it right so far.</li>
</ul>
</li>
<li>Create an ODBC data source where I specified <em>Oracle in OraClient10g_home1 </em>as the driver. When I did this, I got a few alerts for an unsupported operation, but it still seemed to work and brought up the dialog window for <em>Oracle ODBC Driver Configuration</em>. In this dialog, the key thing was to specify the correct net service name that I had configured earlier and that was all it took to get the Oracle ODBC driver to work.</li>
<li>Next step was to launch Visio again, and reverse engineer using the ODBC data source that I had set up.</li>
<li>And I had my desired reverse engineered Oracle schema in Visio!</li>
</ul>
<p>All it took was the right Oracle client for Vista and me stumbling my way through the ODBC setup which does not come naturally to me! Now, you are probably wondering about my choice for my database modeling tool &#8211; yes, I am cheap &#8211; no Rational Data Architect for me! <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>PS: Uninstalling the 9i client for me did not work with the version of the Oracle universal installer that was installed on my Vista laptop. I ended up running the 9i client installer again to uninstall my 9i client. There must be several other solutions but this was the easiest one for me.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/vivekagarwal.wordpress.com/89/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/vivekagarwal.wordpress.com/89/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/vivekagarwal.wordpress.com/89/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/vivekagarwal.wordpress.com/89/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/vivekagarwal.wordpress.com/89/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/vivekagarwal.wordpress.com/89/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/vivekagarwal.wordpress.com/89/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/vivekagarwal.wordpress.com/89/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/vivekagarwal.wordpress.com/89/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/vivekagarwal.wordpress.com/89/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/vivekagarwal.wordpress.com/89/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/vivekagarwal.wordpress.com/89/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=vivekagarwal.wordpress.com&blog=929801&post=89&subd=vivekagarwal&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://vivekagarwal.wordpress.com/2007/12/14/getting-past-issues-with-reverse-engineering-an-oracle-schema-with-visio-on-vista/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/51b07703056eac6cc06db437b8cfe663?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Vivek</media:title>
		</media:content>
	</item>
		<item>
		<title>How to determine row count for all tables in an Oracle Schema?</title>
		<link>http://vivekagarwal.wordpress.com/2007/07/17/how-to-determine-row-count-for-all-tables-in-an-oracle-schema/</link>
		<comments>http://vivekagarwal.wordpress.com/2007/07/17/how-to-determine-row-count-for-all-tables-in-an-oracle-schema/#comments</comments>
		<pubDate>Tue, 17 Jul 2007 16:44:03 +0000</pubDate>
		<dc:creator>Vivek Agarwal</dc:creator>
				<category><![CDATA[Oracle]]></category>

		<guid isPermaLink="false">http://vivekagarwal.wordpress.com/2007/07/17/how-to-determine-row-count-for-all-tables-in-an-oracle-schema/</guid>
		<description><![CDATA[If you ever need to determine the row count for all tables in an Oracle Schema as I did, here is something to help you out.
Disclaimer: This is not my original work and I do not claim to be an Oracle DBA/expert, but I am writing it up as I continually need this and each [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=vivekagarwal.wordpress.com&blog=929801&post=50&subd=vivekagarwal&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>If you ever need to determine the row count for all tables in an Oracle Schema as I did, here is something to help you out.<span id="more-50"></span></p>
<p><strong>Disclaimer</strong>: This is not my original work and I do not claim to be an Oracle DBA/expert, but I am writing it up as I continually need this and each time have to go through a discovery process on how to do it.</p>
<p><strong>Save the script</strong>:  Save the following snippet as a sql script file &#8211; for example, &#8220;OracleUserTableRowCount.sql&#8221; (unfortunately, I do not remember where I got this script from and cannot give credit where it is due).</p>
<pre>Set heading off
Set feedback off
Set pagesize 0
Set termout off
Set trimout on
Set trimspool on
Set recsep off
Set linesize 100
Column d noprint new_value date_
Column u noprint new_value user_
Spool tmp
Select 'Select '''||table_name||' : ''||count(*) from '||table_name||';',
    to_char(sysdate, 'YYYYMMDDHH24MISS') d, user u
from user_tables
order by table_name
/
Spool off
Spool count_&amp;user_._&amp;date_
@tmp.LST
Spool off</pre>
<p><strong>Execution</strong>:</p>
<ul>
<li>Connect to the Oracle database using the user for whom you want to generate the table row count report. For example -</li>
</ul>
<blockquote>
<pre>D:oraclescriptsrowCount&gt;sqlplus icm/foo@wps6</pre>
<pre>SQL*Plus: Release 9.2.0.6.0 - Production on Tue Jul 17 11:29:25 2007</pre>
<pre>Copyright (c) 1982, 2002, Oracle Corporation.  All rights reserved.</pre>
<pre>Connected to:</pre>
<pre>Oracle9i Enterprise Edition Release 9.2.0.6.0 - Production</pre>
<pre>With the Partitioning, OLAP and Oracle Data Mining options</pre>
<pre>JServer Release 9.2.0.6.0 - Production</pre>
<pre>SQL&gt;</pre>
</blockquote>
<ul>
<li>Next execute the script you created -
<pre>SQL&gt; @OracleUserTableRowCount.sql</pre>
<pre>SQL&gt;</pre>
<p>This will create a file with the row counts in the directory you started sql-plus from.</li>
</ul>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/vivekagarwal.wordpress.com/50/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/vivekagarwal.wordpress.com/50/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/vivekagarwal.wordpress.com/50/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/vivekagarwal.wordpress.com/50/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/vivekagarwal.wordpress.com/50/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/vivekagarwal.wordpress.com/50/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/vivekagarwal.wordpress.com/50/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/vivekagarwal.wordpress.com/50/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/vivekagarwal.wordpress.com/50/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/vivekagarwal.wordpress.com/50/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/vivekagarwal.wordpress.com/50/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/vivekagarwal.wordpress.com/50/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=vivekagarwal.wordpress.com&blog=929801&post=50&subd=vivekagarwal&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://vivekagarwal.wordpress.com/2007/07/17/how-to-determine-row-count-for-all-tables-in-an-oracle-schema/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/51b07703056eac6cc06db437b8cfe663?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Vivek</media:title>
		</media:content>
	</item>
		<item>
		<title>How to detect a duplicate row in an Oracle database table?</title>
		<link>http://vivekagarwal.wordpress.com/2007/07/09/how-to-detect-a-duplicate-row-in-an-oracle-database-table/</link>
		<comments>http://vivekagarwal.wordpress.com/2007/07/09/how-to-detect-a-duplicate-row-in-an-oracle-database-table/#comments</comments>
		<pubDate>Tue, 10 Jul 2007 03:01:27 +0000</pubDate>
		<dc:creator>Vivek Agarwal</dc:creator>
				<category><![CDATA[Oracle]]></category>

		<guid isPermaLink="false">http://vivekagarwal.wordpress.com/2007/07/09/how-to-detect-a-duplicate-row-in-an-oracle-database-table/</guid>
		<description><![CDATA[Recently I ran into the situation where I knew that an Oracle database table had a duplicate row, and needed to detect the duplicate row so that I could resolve the situation. You might say that the database design could and should enforce a uniqueness constraint to prevent this situation and you would be right [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=vivekagarwal.wordpress.com&blog=929801&post=49&subd=vivekagarwal&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Recently I ran into the situation where I knew that an Oracle database table had a duplicate row, and needed to detect the duplicate row so that I could resolve the situation. You might say that the database design could and should enforce a uniqueness constraint to prevent this situation and you would be right &#8211; however given the situation how do you detect the duplicate row?<span id="more-49"></span></p>
<p>I don&#8217;t claim to be an expert in SQL or Oracle as many can attest but I can perform Google searches! <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  Based on a quick search, I found that an effective way to detect duplicate rows is to join a table to itself.</p>
<p class="MsoPlainText" style="margin-top:0;margin-bottom:0;"><span><font face="Courier New" size="2">SELECT            </font></span></p>
<p class="MsoPlainText" style="margin-top:0;margin-bottom:0;"><span><span><font face="Courier New" size="2">   </font></span><font face="Courier New" size="2">    ID,            </font></span></p>
<p class="MsoPlainText" style="margin-top:0;margin-bottom:0;"><span><span><font face="Courier New" size="2">   </font></span><font face="Courier New" size="2">    DN            </font></span></p>
<p class="MsoPlainText" style="margin-top:0;margin-bottom:0;"><span><font face="Courier New" size="2">FROM            </font></span></p>
<p class="MsoPlainText" style="margin-top:0;margin-bottom:0;"><span><span><font face="Courier New" size="2">   </font></span><font face="Courier New" size="2">    ldap_person      A            </font></span></p>
<p class="MsoPlainText" style="margin-top:0;margin-bottom:0;"><span><font face="Courier New" size="2">WHERE            </font></span></p>
<p class="MsoPlainText" style="margin-top:0;margin-bottom:0;"><span><span><font face="Courier New" size="2">   </font></span><font face="Courier New" size="2">    rowid      &gt;            </font></span></p>
<p class="MsoPlainText" style="margin-top:0;margin-bottom:0;"><span><span><font face="Courier New" size="2">     </font></span><font face="Courier New" size="2">    (SELECT      min(rowid) FROM ldap_person B            </font></span></p>
<p class="MsoPlainText" style="margin-top:0;margin-bottom:0;"><span><span><font face="Courier New" size="2">      </font></span><font face="Courier New" size="2">        WHERE            </font></span></p>
<p class="MsoPlainText" style="margin-top:0;margin-bottom:0;"><span><span><font face="Courier New" size="2">              </font></span><font face="Courier New" size="2">        B.dn = A.dn            </font></span></p>
<p class="MsoNormal" style="text-align:justify;margin-top:0;margin-bottom:0;"><span><font face="Courier New" size="2"><span>           </span>    );</font></span></p>
<p class="MsoNormal" style="text-align:justify;margin-top:0;margin-bottom:0;">&nbsp;</p>
<p class="MsoNormal" style="text-align:justify;margin-top:0;margin-bottom:0;">Please note that the where clause of the embedded select statement must specify all columns that make the row a duplicate. Once you have found the duplicate row, you can take the appropriate corrective action whether that is to delete the duplicate row or to update the row to resolve the duplicate.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/vivekagarwal.wordpress.com/49/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/vivekagarwal.wordpress.com/49/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/vivekagarwal.wordpress.com/49/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/vivekagarwal.wordpress.com/49/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/vivekagarwal.wordpress.com/49/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/vivekagarwal.wordpress.com/49/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/vivekagarwal.wordpress.com/49/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/vivekagarwal.wordpress.com/49/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/vivekagarwal.wordpress.com/49/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/vivekagarwal.wordpress.com/49/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/vivekagarwal.wordpress.com/49/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/vivekagarwal.wordpress.com/49/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=vivekagarwal.wordpress.com&blog=929801&post=49&subd=vivekagarwal&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://vivekagarwal.wordpress.com/2007/07/09/how-to-detect-a-duplicate-row-in-an-oracle-database-table/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/51b07703056eac6cc06db437b8cfe663?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Vivek</media:title>
		</media:content>
	</item>
		<item>
		<title>Encountering a silent error on login in Oracle Enterprise Manager Console</title>
		<link>http://vivekagarwal.wordpress.com/2007/07/02/encountering-a-silent-error-on-login-in-oracle-enterprise-manager-console/</link>
		<comments>http://vivekagarwal.wordpress.com/2007/07/02/encountering-a-silent-error-on-login-in-oracle-enterprise-manager-console/#comments</comments>
		<pubDate>Tue, 03 Jul 2007 01:38:06 +0000</pubDate>
		<dc:creator>Vivek Agarwal</dc:creator>
				<category><![CDATA[Oracle]]></category>

		<guid isPermaLink="false">http://vivekagarwal.wordpress.com/2007/07/02/encountering-a-silent-error-on-login-in-oracle-enterprise-manager-console/</guid>
		<description><![CDATA[I ran into a weird issue today with Oracle Enterprise Manager Console (EMC) today. I had the EMC (v9.2.0.6) open in the standalone mode, and when I would attempt to connect to a database instance entering my login credentials nothing would happen!!! I would enter my user name and password, and click "Ok" but I would fail to connect to the database instance with no error message.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=vivekagarwal.wordpress.com&blog=929801&post=48&subd=vivekagarwal&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>I ran into a weird issue today with Oracle Enterprise Manager Console (EMC) today. I had the EMC (v9.2.0.6) open in the standalone mode, and when I would attempt to connect to a database instance entering my login credentials nothing would happen!!! I would enter my user name and password, and click &#8220;Ok&#8221; but I would fail to connect to the database instance with no error message. This had me baffled <span id="more-48"></span>and thinking that we may have a JVM incompatibility issue given that I had run into a somewhat similar error with Oracle 8i install on Pentium 4 processors back in the day. You would click &#8220;Setup&#8221; to run the installer and nothing would happen &#8211; that issue turned out to be a <a href="http://oracle.ittoolbox.com/groups/technical-functional/oracle-apps-l/rif-oracle-817-with-a-pentium-4-under-windows-xp-411269" target="_blank">Pentium 4 bug that affected the JIT compiler bundled with Oracle 8i</a>. Anyways coming back to the issue from today, once I got over this hangup of suspecting a JVM issue, I ran the EMC in the debug mode -</p>
<pre>oemapp debug console</pre>
<p>I then attempted to connect to a database instance to produce the following exception stacktrace on the command window from where I ran the EMC -</p>
<pre>NVFactory: _readNVPair expected )

NVFactory: _readNVPair expected )

NVFactory: _readNVLiteral expected LITERAL

java.lang.NullPointerException

at oracle.net.nl.NVPair.setAtom(NVPair.java)

at oracle.net.nl.NVFactory._readNVPair(NVFactory.java )

at oracle.net.nl.NVFactory.createNVPair(NVFactory.jav a)

at oracle.net.nl.NLParamParser.addNLPListElement(NLPa ramParser.java)

at oracle.net.nl.NLParamParser.(NLParamParser.java)</pre>
<p>Searching for this exception in Google yielded exactly one result &#8211; <a href="http://www.dbforums.com/archive/index.php/t-807556.html" target="_blank">http://www.dbforums.com/archive/index.php/t-807556.html</a> and there I found the solution to my problem. As per this posting, the error is caused by misconfigured tnsnames.ora or listener.ora. Once I had this clue, fixing tnsnames.ora and getting past the issue was straightforward.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/vivekagarwal.wordpress.com/48/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/vivekagarwal.wordpress.com/48/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/vivekagarwal.wordpress.com/48/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/vivekagarwal.wordpress.com/48/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/vivekagarwal.wordpress.com/48/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/vivekagarwal.wordpress.com/48/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/vivekagarwal.wordpress.com/48/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/vivekagarwal.wordpress.com/48/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/vivekagarwal.wordpress.com/48/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/vivekagarwal.wordpress.com/48/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/vivekagarwal.wordpress.com/48/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/vivekagarwal.wordpress.com/48/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=vivekagarwal.wordpress.com&blog=929801&post=48&subd=vivekagarwal&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://vivekagarwal.wordpress.com/2007/07/02/encountering-a-silent-error-on-login-in-oracle-enterprise-manager-console/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/51b07703056eac6cc06db437b8cfe663?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Vivek</media:title>
		</media:content>
	</item>
	</channel>
</rss>