<?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>Ladysign Dev Blog &#187; tnsping</title>
	<atom:link href="http://www.ladysign-apps.com/blog/tag/tnsping/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.ladysign-apps.com/blog</link>
	<description>Girls can code.</description>
	<lastBuildDate>Mon, 12 Dec 2011 16:58:15 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>4 checks for diagnosing remote database connection problems</title>
		<link>http://www.ladysign-apps.com/blog/code/sql/4-checks-for-diagnosing-oracle-db-connection-problems/</link>
		<comments>http://www.ladysign-apps.com/blog/code/sql/4-checks-for-diagnosing-oracle-db-connection-problems/#comments</comments>
		<pubDate>Mon, 06 Apr 2009 09:51:42 +0000</pubDate>
		<dc:creator>Lee</dc:creator>
				<category><![CDATA[sql]]></category>
		<category><![CDATA[database problems]]></category>
		<category><![CDATA[db]]></category>
		<category><![CDATA[oracle]]></category>
		<category><![CDATA[tns]]></category>
		<category><![CDATA[tns listener]]></category>
		<category><![CDATA[tnsping]]></category>

		<guid isPermaLink="false">http://ladysign-apps.com/blog/?p=552</guid>
		<description><![CDATA[<p><strong>Difficulty:</strong> 1 out of 5 stars</p>
<p>There are 4 main checks for diagnosing remote database connection problems:</p>
<ul>
<li>tnsnames.ora</li>
<li>Oracle class path</li>
<li>ping</li>
<li>tnsping</li>
[......]</ul><p class='read-more'><a href='http://www.ladysign-apps.com/blog/code/sql/4-checks-for-diagnosing-oracle-db-connection-problems/'>继续阅读</a></p>]]></description>
			<content:encoded><![CDATA[<p><strong>Difficulty:</strong> 1 out of 5 stars</p>
<p>There are 4 main checks for diagnosing remote database connection problems:</p>
<ul>
<li>tnsnames.ora</li>
<li>Oracle class path</li>
<li>ping</li>
<li>tnsping</li>
</ul>
<h4>tnsnames.ora</h4>
<p>First check if the tnsnames.ora file has the correct database information/credentials.<br />
The tnsnames.ora file can be found in: \ORACLE\ora92\network\ADMIN<br />
These credentials should look like:</p>
<pre class="brush: sql; title: ;">
MYDATABSENAME =
	(DESCRIPTION=
		(ADDRESS_LIST=
			(ADDRESS=(PROTOCOL=TCP)(HOST=ladysign)(PORT=&lt;port 1111&gt;))
		)
		(CONNECT_DATA=
			(SERVICE_NAME=myServiceName)
		)
	)
</pre>
<h4>Oracle Class path</h4>
<p>Make sure oracle is in your class path.<br />
Press Windows Key + Break key; Advanced Tab > Environment Variables<br />
Make sure there is a ORACLE_HOME system variable. For example:<br />
ORACLE_HOME = C:\\ORACLE\ora92</p>
<h4>Ping</h4>
<p>The ping utility is used to test the connectivity to a remote machine.  ping will indicate whether a remote server is accessible and responding.  If the ping command indicates that a machine cannot be accessed, the other connectivity tests will also fail.<br />
U can use the ping command via the (DOS) command line; <em>ping <host name></em>. For example:</p>
<pre class="brush: jscript; title: ;">
C:\&gt;ping ladysign
Pinging ladysign [198.64.245.67] with 32 bytes of data:

Reply from 198.64.245.67: bytes=32 time&lt;10ms TTL=254
Reply from 198.64.245.67: bytes=32 time&lt;10ms TTL=254
Reply from 198.64.245.67: bytes=32 time&lt;10ms TTL=254
Reply from 198.64.245.67: bytes=32 time&lt;10ms TTL=254
</pre>
<h4>TNSPing</h4>
<p>When the connectivity to the host is confirmed with the ping command, the next connection to check is the listener.<br />
You can do this with the tnsping utility, which determines wheter or not an Oracle service can be succesfully reached.<br />
However, tnssping will only report if the listener process is up and provides no indication of the state of the database:<br />
For example:</p>
<pre class="brush: jscript; title: ;">
C:\&gt;tnsping MYDATABASENAME

TNS Ping Utility for 32-bit Windows: Version 9.2.0.1.0 - Production on 06-APR-2009 11:02:32

Copyright (c) 1997 Oracle Corporation.  All rights reserved.

Used parameter files:
C:\ORACLE\ora92\network\admin\sqlnet.ora

Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION= (ADDRESS_LIST= (ADDRESS=(PROTOCOL=TCP)(HOST=ladysign)(PORT=1111))) (CONNECT_DATA= (SERVICE_NAME=myDatabaseService)))
OK (80 msec)
OK (10 msec)
OK (10 msec)
OK (0 msec)
OK (10 msec)
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.ladysign-apps.com/blog/code/sql/4-checks-for-diagnosing-oracle-db-connection-problems/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

