Home > Software engineering >  ORA-12541: TNS:no listener error when I want connect remotely from another machine
ORA-12541: TNS:no listener error when I want connect remotely from another machine

Time:11-22

I have Oracle database 19C installed on two machine, and I am trying to accessing the same from another machine.

I tried via Oracle SQL developer that work with localhost (both machine work with localhost to own). I stop firewall temporary and I have ping also I add to firewall tcp port 1521.

But when I tried connect remotely from machine A to Machine B with below code The error message I get: ORA-12541: TNS:no listener .

sqlplus MyUserName/[email protected]:1521/orcl

listener.ora in machine A:

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

tnsnames.ora in machine A:

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


ORACLR_CONNECTION_DATA =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
    )
    (CONNECT_DATA =
      (SID = CLRExtProc)
      (PRESENTATION = RO)
    )
  )

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

I know in SQL Server you need to enable remote connection to connect to database remotely. Do we need to set something similar on oracle SID also in machine A?

CodePudding user response:

Your listener configuration:

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

is bound to localhost. It can only receive connections on that address. If you want to open it up to remote connections, then use "0.0.0.0" for an IP address. That will enable the listener to receive connections on any NIC on the server.

(ADDRESS = (PROTOCOL = TCP)(HOST = 0.0.0.0)(PORT = 1521))
  • Related