oracle-11g-r2,sqlplus,oracle-sql-developer – SQLPlus “No Listener” Only with Remote Connection from Windows

oracle-11g-r2oracle-sql-developersqlplus

Trying remote connection

  • The Oracle database is running on a linux server.
  • The lsnrctl service is running.
  • Locally, I can connect to database from sqlplus and sql developer.
  • Remotely, from windows, I can't connect.
  • sqlplus on windows says that image above shows.
  • sql developer says that Network Adapter could not establish the connection.
  • I have done ping from the windows machine to the linux server and is ok.

lsnrctl status:

[oracle@oracledb ~]$ lsnrctl status

LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 21-SEP-2015 19:30:58

Copyright (c) 1991, 2009, Oracle.  All rights reserved.

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 11.2.0.1.0 - Production
Start Date                21-SEP-2015 16:43:32
Uptime                    0 days 2 hr. 47 min. 26 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /u01/app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora
Listener Log File         /u01/app/oracle/diag/tnslsnr/oracledb/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=1521)))
Services Summary...
Service "mondev" has 1 instance(s).
  Instance "mondev", status READY, has 1 handler(s) for this service...
Service "mondevXDB" has 1 instance(s).
  Instance "mondev", status READY, has 1 handler(s) for this service...
The command completed successfully

listener.ora content:

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

ADR_BASE_LISTENER = /u01/app/oracle

Best Answer

The listener works as expected. It is configured to listen at localhost (127.0.0.1) and so it cannot accept connection from another host.

I assume that the listener runs on host with IP 192.168.1.130 . So in the listener configfile change localhost to 192.168.1.130 and restart the listener.

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

ADR_BASE_LISTENER = /u01/app/oracle