Discussions
Categories
- 197.1K All Categories
- 2.5K Data
- 546 Big Data Appliance
- 1.9K Data Science
- 450.7K Databases
- 221.9K General Database Discussions
- 3.8K Java and JavaScript in the Database
- 31 Multilingual Engine
- 552 MySQL Community Space
- 479 NoSQL Database
- 7.9K Oracle Database Express Edition (XE)
- 3.1K ORDS, SODA & JSON in the Database
- 555 SQLcl
- 4K SQL Developer Data Modeler
- 187.2K SQL & PL/SQL
- 21.3K SQL Developer
- 296.3K Development
- 17 Developer Projects
- 139 Programming Languages
- 293K Development Tools
- 110 DevOps
- 3.1K QA/Testing
- 646.1K Java
- 28 Java Learning Subscription
- 37K Database Connectivity
- 158 Java Community Process
- 105 Java 25
- 22.1K Java APIs
- 138.2K Java Development Tools
- 165.3K Java EE (Java Enterprise Edition)
- 19 Java Essentials
- 162 Java 8 Questions
- 86K Java Programming
- 81 Java Puzzle Ball
- 65.1K New To Java
- 1.7K Training / Learning / Certification
- 13.8K Java HotSpot Virtual Machine
- 94.3K Java SE
- 13.8K Java Security
- 205 Java User Groups
- 24 JavaScript - Nashorn
- Programs
- 466 LiveLabs
- 39 Workshops
- 10.2K Software
- 6.7K Berkeley DB Family
- 3.5K JHeadstart
- 5.7K Other Languages
- 2.3K Chinese
- 175 Deutsche Oracle Community
- 1.1K Español
- 1.9K Japanese
- 233 Portuguese
SQL*Net connection to remote Oracle DB, through SSH, fails with ORA-12545

969533
Member Posts: 2
Hi all,
I have the following issue: I am unable to log in to an Oracle database using SSH tunnel. I have the following network setup:
laptop (network1) server1 (network2) oracledb (network2)
server1 is reachable via SSH from outside world ,while oracledb is not reachable outside of network2.
The listener is running on default port 1521 on oracledb server.
server1 has direct visibility with oracledb.
First, I've tried to connect using only a LOCAL tunneling like this:
laptop> ssh -L 10000:oracledb:1521 [email protected]
But then, when I issue a connection attempt (using SQL*Plus, SQL Developer and/or Toad) towards laptop:10000, I get the following error:
C:>sqlplus [email protected] as sysdba
SQL*Plus: Release 11.2.0.1.0 Production on Fri Oct 19 14:51:03 2012 Copyright (c) 1982, 2010, Oracle. All rights reserved.
Enter password: ERROR: ORA-12545: Connect failed because target host or object does not exist
and the following log in listener.log on oracledb:
19-OCT-2012 06:31:33 * (CONNECT_DATA=(SID=PROD01)(CID=(PROGRAM=C:\app\rr2\product\11.2.0\client_2\bin\sqlplus.exe)(HOST=RR2-23247)(USER=rr2))) * (ADDRESS=(PROTOCOL=tcp)(HOST=192.168.0.104)(PORT=48025)) * establish * PROD01 * 0
I've also tried to connect using a LOCAL and REMOTE tunnels like this way:
laptop> ssh -L 10000:localhost:9999 [email protected] server1> ssh -R 9999:oracledb:1521 [email protected]
and then when I issue a connection on laptop:10000 again I am hitting the above errors.
I suppose that the issue is because when connected to the listener, it then spawns a server process on another port, and your connection should bind to the server port on the server process, which is different every time with a range between 20000 - 50000 TCP.
I am stuck on this and I don't know how to make it work.
Please advise!!
Thanks a lot in advance.
Edited by: 966530 on 2012-10-19 5:54
I have the following issue: I am unable to log in to an Oracle database using SSH tunnel. I have the following network setup:
laptop (network1) server1 (network2) oracledb (network2)
server1 is reachable via SSH from outside world ,while oracledb is not reachable outside of network2.
The listener is running on default port 1521 on oracledb server.
server1 has direct visibility with oracledb.
First, I've tried to connect using only a LOCAL tunneling like this:
laptop> ssh -L 10000:oracledb:1521 [email protected]
But then, when I issue a connection attempt (using SQL*Plus, SQL Developer and/or Toad) towards laptop:10000, I get the following error:
C:>sqlplus [email protected] as sysdba
SQL*Plus: Release 11.2.0.1.0 Production on Fri Oct 19 14:51:03 2012 Copyright (c) 1982, 2010, Oracle. All rights reserved.
Enter password: ERROR: ORA-12545: Connect failed because target host or object does not exist
and the following log in listener.log on oracledb:
19-OCT-2012 06:31:33 * (CONNECT_DATA=(SID=PROD01)(CID=(PROGRAM=C:\app\rr2\product\11.2.0\client_2\bin\sqlplus.exe)(HOST=RR2-23247)(USER=rr2))) * (ADDRESS=(PROTOCOL=tcp)(HOST=192.168.0.104)(PORT=48025)) * establish * PROD01 * 0
I've also tried to connect using a LOCAL and REMOTE tunnels like this way:
laptop> ssh -L 10000:localhost:9999 [email protected] server1> ssh -R 9999:oracledb:1521 [email protected]
and then when I issue a connection on laptop:10000 again I am hitting the above errors.
I suppose that the issue is because when connected to the listener, it then spawns a server process on another port, and your connection should bind to the server port on the server process, which is different every time with a range between 20000 - 50000 TCP.
I am stuck on this and I don't know how to make it work.
Please advise!!
Thanks a lot in advance.
Edited by: 966530 on 2012-10-19 5:54
Answers
-
Look into this doc of Ed Stevens
http://edstevensdba.wordpress.com/2011/03/05/ora-12545/ -
check this command
tnsping HOME11G
check status for remote database whether that is reachable or not. -
Hi,
Thanks for that link. It seems that when you define your TNS entry, you should choose a hostname, and define it into the hosts file on Windows. Otherwise you will not be allowed to connect through the tunnel.
Issue solved. -
966530 wrote:I don't think the tunneling has anything to do with it. That is, your phrase "you will not be allowed to connect through the tunnel" was true before you added the qualifier "through the tunnel".
Hi,
Thanks for that link. It seems that when you define your TNS entry, you should choose a hostname, and define it into the hosts file on Windows. Otherwise you will not be allowed to connect through the tunnel.
Issue solved.
sqlnet uses the tnsnames.ora file to resolve an alias to a specific host destination, port, and service name. Just like the OS uses the local 'hosts' file to resolve a host name to an ip address. After tns parses out the tnsnames.ora entry, it simple creates a standard ip request to the OS. Of course, if tnsames specified HOST=myserver, then the OS will have to use either DNS or the local hosts file to resolve 'myserver' to an ip address.
SQLNET sits at the application layer of the OSI network stack. All sqlnet requests go through the standard OSI network stack. -
>
laptop> ssh -L 10000:oracledb:1521 [email protected]
But then, when I issue a connection attempt (using SQL*Plus, SQL Developer and/or Toad) towards laptop:10000, I get the following error:
C:>sqlplus [email protected] as sysdba
>
show us HOME11G in tnsnames.ora.
what is OS where Oracle runs?
For SQL Developer what driver do you use, thin or OCI?
The Thin one does not have this type of issue (another port).
Edited by: user11181920 on Oct 19, 2012 12:15 PM
Also I tested it with SQL*Plus, it works well via SSH.
Oracle runs on Linux. -
It seems that when you define your TNS entry, you should choose a hostname, and define it into the hosts file on Windows. Otherwise you will not be allowed to connect through the tunnel.No. You do not need to choose a hostname.
It works perfectly with localhost.SSH = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 11521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = ORCL) ) )
This discussion has been closed.