I am new to oracle database, I have installed Oracle 11.g on redhat 5.6, I have a database that I can connect to it using the following command:

export ORACLE_SID=test
sqlplus user/passwd

but not connect to database neither remotely nor from localhost: sqlplus user/passwd@myhost:1521/test error: ORA-12541: TNS: no listener

this is my listener.ora file:

# listener.ora Network Configuration File: 

# Generated by Oracle configuration tools.

      (ADDRESS = (PROTOCOL = TCP)(HOST = myhost)(PORT = 1522))

ADR_BASE_LISTENER = /Oracle/oracle_base

this inside tnsnames.ora file:

test =
      (ADDRESS = (PROTOCOL = TCP)(HOST = myhost)(PORT = 1521))
      (SERVICE_NAME = test)

and this is output of lsnrctl status is:

LSNRCTL for Linux: Version - Production on 16-JAN-2017 


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

Alias                     LISTENER
Version                   TNSLSNR for Linux: Version - Production
Start Date                16-JAN-2017 15:45:32
Uptime                    0 days 0 hr. 11 min. 30 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /Oracle/oracle_base/product/
Listener Log File         /Oracle/oracle_base/diag/tnslsnr/myhost/listener/alert/log.xml
Listening Endpoints Summary...
The listener supports no services
The command completed successfully

and this is output of tnsping test:

oracle> tnsping test

TNS Ping Utility for Linux: Version - Production on 16-JAN-2017 16:00:45

Copyright (c) 1997, 2013, Oracle.  All rights reserved.

Used parameter files:

Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = myhost)(PORT = 1521))) (CONNECT_DATA = (SERVICE_NAME = test)))
TNS-12541: TNS:no listener

1 Answer 1


Listener listens on port 1522, but you are trying to connect port 1521. Update your tnsnames.ora with the correct port number (1522).

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.