The Network Adapter Could Not Establish the Connection in SQL Developer

Oracle SQL Developer: Failure - Test failed: The Network Adapter could not establish the connection?

I am answering this for the benefit of future community users. There were multiple issues. If you encounter this problem, I suggest you look for the following:

  • Make sure your tnsnames.ora is complete and has the databases you wish to connect to
  • Make sure you can tnsping the server you wish to connect to
  • On the server, make sure it will be open on the port you desire with the specific application you are using.

Once I did these three things, I solved my problem.

Oracle SQL Developer: Test failed: The Network Adapter could not establish the connection?

I used to fight with VM networking settings such that my host could 'see' my vm, and vice versa.

I stopped worrying about this once i learned about port forwards.

You can simply tell VirtualBox to take traffic from your local port, say 1521, and forward that to the VM, say also 1521.

So when connecting to the VM from my host in SQL Developer, I can go to localhost:1521, and have my connection traffic go to the Oracle Listener on my Linux VBox image, listening on port 1521

Sample Image

Click on Port Forwarding

Add an entry for TCP 1521 and 1521

Sample Image

Then, in SQL Developer you can simply do this to connect to your DB on the VM

Sample Image

What is the cause of this problem "IO Error: The Network Adapter could not establish the connection" on Sql Developer?

You're trying to connect to a machine on a network that SQL Developer is unable to reach.

For a TNS connection,
Look at the appropriate TNSNames entry (you will have a tnsnames.ora) file, and find the IP address or network name associated with the connection you're trying to establish -

enter image description here
And then start by trying to ping that resource.

In this case, i'm trying to talk to a database on MY machine, on port 1521. Yours should look quite different.

If you're using a basic connection, then you can look at the connection properties and see what machine/port you're trying to communicate with.

Ping

enter image description here

If you can't reach that machine from your machine, there's zero chance you can connect to a database there.

So, always start with a ping.

Once you see that you can get to that machine, if you're still getting that message, the next thing to think about is blocked ports, the listener defaults to port 1521, but you'll see that in the TNS descriptor as well.



Related Topics



Leave a reply



Submit