3

I have been trying to connect to Oracle 12c remotely by using Oracle SQL developer. It shows the below error during connecting to the server :

 Status : Failure -Test failed: IO Error: The Network Adapter could not establish the connection 

I do can connect to oracle database on the server, but the problem is regarding to connect to this server (database) remotely

The content of my listener.ora is :

SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
  (SID_NAME = CLRExtProc)
  (ORACLE_HOME = D:\app\ORCLNEWUSER\product\12.1.0\dbhome_1)
  (PROGRAM = extproc)
  (ENVS =  "EXTPROC_DLLS=ONLY:d:\app\ORCLNEWUSER\product\12.1.0\dbhome_1\bin\oraclr12.dll")
)
)

LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =      
  (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))     
)
)
3
  • Is the listener running? Or a firewall blocking the access? Commented Apr 6, 2014 at 11:11
  • Listener is running and Also the firewall is off Commented Apr 6, 2014 at 12:15
  • Thanks Alex, I'm new in oracle . could you tell me how I can config this file , since I have a server with a valid IP address and I'm trying to connect to this Commented Apr 6, 2014 at 14:24

1 Answer 1

6

Your listener.ora says that is only listening on localhost (127.0.0.1), so nothing will be able to connect from anywhere except the server; there is nothing listening on port 1521 on the server's external IP address. You can verify that with lsnrctl status and netstat -ano | find "1521".

You need to modify the listener.ora to listen on your server's hostname, or if that isn't resolvable to the correct IP, the external IP address itself - the 'valid IP address' you're trying to connect to from SQL Developer:

LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =      
  (ADDRESS = (PROTOCOL = TCP)(HOST = my_hostname_or_ip)(PORT = 1521))     
)
)

You may also need to check that your database is able to register successfully. I'd verify if it is included in lsnctrl services before and after you make that change and restart the listener. If it doesn't appear after the restart, and alter system register doesn't make it appear, then you might need to change the local_listener database parameter to tell it the address and port it should register against. That's a separate issue really but could follow on from this change; there's an example here which might help if it does.

Sign up to request clarification or add additional context in comments.

9 Comments

When I change the HOST to the IP of server in (listener.ora file), the listener's service doesn't start
@Ali - do you get an error on the command line, or anything helpful in the log?
I forgot to mention which I'm using Windows server 2008 and the existing host (localhost) is working fine , as you mentioned it only listening on localhost, but when I change it to the IP of server and I try to restart the listener's service it gives me this error : "The listener service on Local computer started and then stopped. some services stop automatically if they are not in use by other services or programs"
I'm not very familiar with this on Windows. Are you sure the IP you used is valid - does netstat shows other ports listening on that address? (Or is this perhaps a VM and there's NAT confusing things?)
@Ali - then the IP address is not valid, or you have some other error in the ADDRESS line. Check the IP is listed by ipconfig and that you can ping it - copying from the file to make sure you didn't mistype it, maybe. Not sure what else to suggest, sorry.
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.