Hey guys! Have you ever faced the TNS IO error saying “The network adapter could not establish the connection”? when you are trying to make a new connection in SQL Developer or logging on to the database using SQL*Plus editor. If yes then you are at the right place because here in this blog I am going to show you how you can solve this error. 

sql error the network adapter could not establish connection by manish sharma

So without further ado let’s proceed to solve this badass TNS error.

 

Step 1: Make sure your entries are correct

First of all to solve “The network adapter could not establish the connection” error, check whether you have entered the correct username and password as well as the correct Hostname and Port number. Though these are small things we cannot avoid them. After all “It’s the small things in a relationship that means the most.” 

Click To Tweet

For the valid hostname and port number, you can check the Listener.ora if you have access to your server as the listener is a server process. In case you don’t have access to listener.ora file then you can check the tnsnames.ora file.

In case of Listener.ora file check for Host and Port entry in Listener tag for valid hostname and port number. 

sql error the network adapter could not establish connection by manish sharma

Listener.ora

And if you are using TNSnames.ora file for validating the hostname and port number then search for the entry which has the same name as your SID and then check for host and port number entry in that particular tag.

sql error the network adapter could not establish connection by manish sharma

TNSnames.ora

Now try connecting. If this solves your problem then you can avoid the next step. But if “The network adapter could not establish the connection” error is still there, then don’t worry just follow the next step.

 

Step 2: Is your listener taking a rest?

If your problem is still there and you haven’t gotten rid of that nasty error then there is a possibility that your Listener is not running. To check whether Listener is up and running or not, simply open up your command prompt with Administrative privileges and Write 

C:\> lsnrctl status

This command will show you the status of your listener. If the output of this command looks like the one shown in the picture below then it clearly means your listener is not running thus next what you have to do is to start the listener. 

sql error the network adapter could not establish connection by manish sharma

To start the listener you just have to write

C:\> lsnrctl start.

This will start your listener and most probably solve your problem.

Info Byte:
In case you are having problems in starting your listener then try starting “OracleOraDb11g_home1TNSListener” windows service. For that open your Run Command and write services.msc this will open your service panel. Here search for the same and right click to start it.

That’s all you have to do. This must solve the “The network adapter could not establish the connection” error. May the force be with you. Enjoy.

Also, click here to learn how to do initial configuration of Orcale Enterprise Manager to start working with it. 

If you find this helpful then please do share it on your social network and help me reach out to more people. Also if you have other queries then reach out to me on my Facebook Page & Twitter. Thanks, guys & have a great day!

SQL Developer FAQ

  1. How do I start SQL Developer?

    SQL Developer is a graphical user interface (GUI) which is designed and developed by Oracle. This database management tool is so simple that you don’t even need to install it. Simply download it and use it.
    You can start SQL Developer just by clicking sqldeveloper.exe file. This file is located in the root directory of the software. How to create new database connection in SQL Developer By Manish Sharma

  2. What is Sid in SQL Developer?

    SID stands for Site Identifier or System Identifier. It’s a unique name for your Database. In the Oracle ecosystem, every database is given a unique name. This unique name helps us in connecting with a specific database.
    You can find out the SID of your Database by querying the v$thread view. Like this
    SELECT instance FROM v$thread;
    You can click here to read more about Oracle SID.

  3. How do I download SQL Developer?

    SQL Developer is a free database management tool provided by Oracle. You can download it by visiting oracle.com. This tool is located under the Developer Tools category on the download page of Oracle.com

  4. How do I start SQL Developer?

    SQL Developer is a graphical user interface (GUI) which is designed and developed by Oracle. This database management tool is so simple that you don’t even need to install it. Simply download it and use it.
    You can start SQL Developer just by clicking sqldeveloper.exe file. This file is located in the root directory of the software.

    How do I know what version of SQL Developer I have?