I have looked through the postings but cannot get a handle on this. I
have connected to many Oracle databases in many environments using
JDBC but there is one that I cannot connect to. I have the Oracle
client tools installed and I can connect using SQL*Plus using the Host
String PRODLAW.
The tnsnames.ora entry looks like this;
PRODLAW =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = db4.netaspx.com)(PORT =
1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = db5.netaspx.com)(PORT =
1521))
(LOAD_BALANCE = yes)
)
(CONNECT_DATA =
(SERVICE_NAME = c0ujP0.oracle.netaspx.com)
(FAILOVER_MODE =
(TYPE = SELECT)
(METHOD = BASIC)
)
)
)
The sqlnet.ora looks like this
# sqlnet.ora Network Configuration File: D:\Oracle\product
\10.1.0\Client_1\network\admin\sqlnet.ora
# Generated by Oracle configuration tools.
SQLNET.AUTHENTICATION_SERVICES= (NTS)
NAMES.DIRECTORY_PATH= (TNSNAMES, EZCONNECT)
The message I am getting looks like this
Driver: oracle.jdbc.driver.OracleDriver
Connecting to jdbc:oracle:thin:@db5.netaspx.com:1521:c0ujP0...
Driver registered: oracle.jdbc.driver.OracleDriver
Io exception: Connection refused(DESCRIPTION=(TMP=)(VSNNUM=169869824)
(ERR=12505)(ERROR_STACK=(ERROR=(CODE=12505)(EMFI=4))))
I CAN successfully connect to another instance defined in the same way
in the same environment. Only this one particular dadtabase
connection fails.
Any ideas would be very much appreciated.
David Harper - 01 Feb 2007 19:16 GMT
[SNIP]
> The message I am getting looks like this
>
[quoted text clipped - 3 lines]
> Io exception: Connection refused(DESCRIPTION=(TMP=)(VSNNUM=169869824)
> (ERR=12505)(ERROR_STACK=(ERROR=(CODE=12505)(EMFI=4))))
I have a strange feeling of déja vu. We had similar questions in this
newsgroup back in September and October last year. Here'swhat I said
back then:
Oracle error code 12505 means "TNS:listener could not resolve SID given
in connect descriptor".
Apparently, this means that the TNS listener service does not recognise
the service ID which you specified in your JDBC connection URL. Perhaps
you gave the wrong service ID? Or perhaps the Oracle instance has not
registered that service ID with the TNS listener?
Caveat: I'm *not* an Oracle expert!
David Harper
Cambridge, England
Alfred - 04 Feb 2007 08:32 GMT
> ...
> The message I am getting looks like this
>
> Driver: oracle.jdbc.driver.OracleDriver
> Connecting to jdbc:oracle:thin:@db5.netaspx.com:1521:c0ujP0...
With Thin driver you connect directly to Oracle's
SQL listener. In this case tnsnames.ora is useless.
The connection string has to be ended with System
Identifier of your Oracle instance - not with service
name or service id. The Oracle SID is the unique name
of instance/database of your Oracle installation.
Alfred
kuassi.mensah@gmail.com - 05 Feb 2007 17:52 GMT
On Feb 1, 10:43 am, d...@sqlmagic.com wrote:
> I have looked through the postings but cannot get a handle on this. I
> have connected to many Oracle databases in many environments using
[quoted text clipped - 44 lines]
>
> Any ideas would be very much appreciated.
Hi,
Starting with 10.2, JDBC-Thin supports TNSNAMES provided you specify
the location (directory) by setting oracle.net.tns_admin as follows:
java -Doracle.net.tns_admin=$ORACLE_HOME/network/admin
or:
System.setProperty("oracle.net.tns_admin", "c:\oracle\net\admin");
Kuassi http://db360.blogpspot.com