Thursday, August 15, 2013

listener.ora - localhost

While testing today, I had a scenario where I needed to connect to Oracle that was running on a remote machine (hosted by Skytap). I had configured the ports and firewalls, but I still could not connect from my machine to the remote Oracle database. I kept getting the following error:

ORA-12541: TNS: no listener

I finally determined that the problem was with the listener.ora file on the remote machine (where Oracle was running). It was setup to listen from localhost:

LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
 (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
    )
  )

Connections from the remote machine to itself were working fine, but connections from an external machine were not working. I changed listener.ora to listen on the machine name (instead of localhost):

LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
 (ADDRESS = (PROTOCOL = TCP)(HOST = WN700014)(PORT = 1521))
    )
  )

After restarting the Oracle service and the TNSListener service, I was able to connect from my machine to the remote machine.

No comments:

Post a Comment