Configuring the connection between client and serv

2020-02-16 01:12发布

问题:

I've installed the oracle server and it's working properly. However, the client which is installed in another machine is not working. The error TNS-12541: TNS:there is no listener appears.

My TNSNames.ora:

SCP =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 10.0.2.39)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = DatabaseIO)
)
)

In server machine I can connect to the databaseIO.

Are there other configurations to do?

回答1:

In a comment you have an extract from lsnrctl status:

Listening Endpoints summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=1521)))
Services summary...

Your listener is only listening on 127.0.0.1, so connections can only be made from the server. There is nothing listening on your external address 10.0.2.39, so connections to port 1521 on that address fail.

Your listener.ora presumably has something either a single ADDRESS, or no ADDRESS at all, which will default to localhost:1521. You need to modify it to something like:

LISTENER =
...
    (ADDRESS_LIST =
      ...
      (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
      (ADDRESS = (PROTOCOL = TCP)(HOST = 10.0.2.39)(PORT = 1521))
    )

or your machine's host name if that's resolvable to that address. Ideally this would be done through netca rather than by editing the file by hand.