Dhivya
Dhivya

Reputation: 152

The Network Adapter could not establish the connection in SQL developer

I created a database using SQL developer list of 1000 entries and it created successfully. The connection also succeeded. But today while I'm trying to connect there is an error occurring:

IO Error: The Network Adapter could not establish the connection in SQL developer

I can surely say it is not connecting I tried it in Command prompt also in prompt it is mentioning as Protocol Adapter Error.

What is the problem here?

What is meant by Protocol Adapter Error how can i overcome it?

What is Network Adapter Error?

Upvotes: 10

Views: 110151

Answers (8)

Xavier Angeles
Xavier Angeles

Reputation: 21

I had this issue but finally found a solution. Follow the next steps.

  1. Stop all services that you hace runnig about oracle
  2. Please check your ip configuration in a console(windows command ipconfig, linux command ifconfig), save that ip
  3. Change the ip than you have in the following files: listener.ora tnsnames.ora
  4. Start all services that you stoped

The previous steps should have solved the issue.

Note: if you don't want to repeat the above steps every time you restart your computer, just put in the ip addresses 127.0.0.1 in the files.

Upvotes: 0

Ananta Chandra Das
Ananta Chandra Das

Reputation: 2093

You need to follow few steps .

  1. Go to the directory "C:\oraclexe\app\oracle\product\11.2.0\server\network\ADMIN"
  2. Open tnsnames.ora file and change the host. Generally localhost in your case

    XE =
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = XE)
    )
    )
    
  3. Open listener.ora file and change the listener host name to localhost.

    LISTENER =
    (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
      (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
    )
    )
    
  4. Open command prompt as administrator. Check for the listener status.

    c:\> lsnrctl status
    

    If you find listener is up then you can be able to connect to the sql developer. Other wise start the listener by using below command.

    c:\> lsnrctl start
    

    Now you can be able to login to sql developer without the above mentioned error.

Upvotes: 3

Robert
Robert

Reputation: 31

SQL Developer problem: The network adapter could not establish the connection

  1. Open the file sqldeveloper.conf in wordpad or your favourite text editor. The file is placed in the installation directory, probably:

    %programfiles%\sqldeveloper\sqldeveloper\bin\sqldeveloper.conf
    
  2. Add the following line at the bottom of the file and save:

    AddVMOption -Djava.net.preferIPv4Stack=true
    
  3. Restart SQL Developer.

Upvotes: 2

VladOhotnikov
VladOhotnikov

Reputation: 1188

In my case I need to set Hostname like "my-oracle-server-name", not by ip (192.168.1.23)

Upvotes: 0

ssv
ssv

Reputation: 125

I had a similar issue with oracle running on my suse vm. This fixed the problem: 1.) Removed the file listener.ora. 2.) Made listener part of tnsnames.ora

LISTENER_MDB1 =
  (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))

MDB1 =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = MDB1)
    )
  )

There may be a better solution though.

Upvotes: 0

Hemanth Kumar
Hemanth Kumar

Reputation: 11

the answer for your question is some times the listener will be shut-down at this point it will not allow you to connect to the database, for example when the machine restarts. Solution is : Go to services check the Oracle_ora Db --> tns_listener is in running mode are not if not restart the services.

Upvotes: 1

scv
scv

Reputation: 520

I had a similar issue where I also continuously got the same error. I tried many things like changing the listener port number, turning off the firewall etc. Finally I was able to resolve the issue by changing listener.ora file. I changed the following line:

(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))

to

(ADDRESS = (PROTOCOL = TCP)(HOST = hostname)(PORT = 1521))

I also added an entry in the /etc/hosts file.

you can use Oracle net manager to change the above line in listener.ora file. See Oracle Net Services Administrator's Guide for more information on how to do it using net manager.

Also you can use the service name (database_name.domain_name) instead of SID while making the connnection.

Hope this helps.

Upvotes: 1

Rahul Tripathi
Rahul Tripathi

Reputation: 172458

Please check the listener to see if it is down:-

ps -ef | grep tns

If you dont find the output of the listener then you have to start it. To do that type start in the LSNRCTL> prompt.

From the Oracle forum:

If the Oracle clients have been installed with 11.1.2.3 the TNS_ADMIN will be point to \user_projects\config\dbclient In that folder there should be a tnsnames.ora, if the Oracle DB is on the same machine you may want to copy the contents of database tnsnames folder to the TNS_ADMIN folder or as suggested change the environment variable.

Upvotes: 5

Related Questions