Skip to Main Content

Oracle Database Discussions

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Connect to Oracle Data base via Eclipse IDE

935572May 7 2012 — edited May 8 2012
Hi

I have a local Oracle 11g R2 install with 1 database TC91TEST. I can connect via Eclipse IDE and establish a connection. I have another database MRPDEV ( oracle 10g ) on another machine and I need to use my Eclipse IDE to connect to that remote database. All the machines are within the network.

I have added the entries for the MRPDEV in my tnsnames.ora.

From command prompt. I can do a tnsping mprdev

C:\Documents and Settings>tnsping mrpdev

TNS Ping Utility for 32-bit Windows: Version 11.2.0.1.0 - Production on 07-MAY-2
012 09:25:44

Copyright (c) 1997, 2010, Oracle. All rights reserved.

Used parameter files:
C:\app\product\11.2.0\dbhome_1\network\admin\sqlnet.ora


Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)
(HOST = machine2)(PORT = 1521))) (CONNECT_DATA = (SERVICE_NAME = MRPDEV)))
OK (20 msec)

I can also do a sqlplus username/password@mrpdev <<< This also works
or a full connect string sqlplus username/password@machine2:1521/mrpdev <<<This also works

Interestingly TOAD Can connect using TNS / Direct method to this database using my Oracle 11g

but tnsnames services LISTENER ( does not show this particular service from other machine2)

but When I try using Eclipse IDE to connect to this database in machine2 , it gives me a

java.sql.SQLException: Listener refused the connection with the following error:
ORA-12505, TNS:listener does not currently know of SID given in connect descriptor
The Connection descriptor used by the client was:
machine2:1521:mrpdev


**************

Obviously TNSNAMES can't find this service using this URL jdbc:oracle:thin:@machine2:1521:mrpdev
I tried changing the SERVICE_NAME in tnsnames.ora to SID.. but it does not work.

so something basically is not right ? Can you help ?


************tnsnames.ora***** ( machine 1 is local and machine2 is remote)

TC91TEST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = machine1)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = TC91TEST)
)
)

MRPDEV =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = machine2)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = MRPDEV)
)
)

*********************

Let me know what am i missing here ??/

Regs
Jaya
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 5 2012
Added on May 7 2012
4 comments
1,609 views