// Oracle error reference

ORA-12541: TNS: no listener

Nothing is listening at the host and port the client tried: the listener isn't running, or the address or port is wrong or blocked.

Error code
ORA-12541
Category
Connection and login
Error message
TNS:no listener

What it means

The client opened a connection to the address in the connect descriptor and nothing answered as an Oracle listener. Either the listener process isn't running on that host and port, or the client is aiming at the wrong place.

Newer releases word it as Cannot connect. No listener at host_port.

Common causes

  • The listener is stopped, for example after a server reboot.
  • Wrong host or port in the connect string; the default port is 1521 but many installations change it.
  • The listener listens only on localhost or another interface.
  • A firewall rejects the port.

How to fix it

  1. On the database server, check and start the listener: lsnrctl status, then lsnrctl start.

  2. Compare the host and port in the client's connect string with the addresses lsnrctl status reports.

  3. From the client, test the port with tnsping or a TCP check such as nc -vz db-host 1521, and open it in any firewall in between.

Related errors

More connection and login errors

The code and message text are from the Oracle Database Error Help. Browse the full Oracle error list or search every database error.

// fewer errors, faster fixes

Work on Oracle in SQLly

A native SQL client for macOS, Windows and Linux with schema-aware IntelliSense, guardrails for risky statements and clear error messages, for Oracle and the other databases you use.