Fix: ORA-12541: TNS:no listener
The client reached the host but nothing was listening on that port. Start or fix the Oracle listener, or correct the host and port in your connect string.
Drafted with AI from official documentation. Scripts were run in a test environment and repository links verified. Awaiting a human check. Did it work for you? Last edited Outdated?
In Oracle Database 19c and older clients the error reads:
ORA-12541: TNS:no listener
Newer releases print a more specific message that includes the address the client tried, in the form ORA-12541: Cannot connect. No listener at host_port. Both mean the same thing: the connection request reached a host, but no Oracle listener was accepting connections at that host and port (or, for IPC connections, at that key).
Cause 1: the listener is not running
This is the most common cause, for example after a server reboot when the listener is not started automatically. On the database server, as the Oracle software owner:
lsnrctl status
lsnrctl start
lsnrctl status
If your listener.ora defines a listener with another name, pass it: lsnrctl status LISTENER_APP. lsnrctl start can only start a listener on the machine you run it on.
After the listener starts, a running database registers its services with it dynamically, so give it a short moment and run lsnrctl status again. The services summary should list your PDB’s service with status READY.
Cause 2: wrong host or port in the connect string
Compare what the client uses with what the listener listens on. lsnrctl status prints the protocol addresses the listener is listening on, including HOST and PORT.
- Easy Connect: check
host:port/service. The port defaults to 1521 if you leave it out, so a listener on 1522 needs the port spelled out. - tnsnames.ora alias: check
HOSTandPORTin the entry, and that the client reads the file you think it reads (TNS_ADMIN,$ORACLE_HOME/network/admin). - Typing errors in the host name can also resolve to another machine that has no listener at all.
Cause 3: the listener only listens on another interface
If listener.ora uses HOST=localhost or a specific internal IP, connections to another address of the same server get no listener. Make the HOST match the name or address clients use, then lsnrctl reload (or stop and start the listener).
Cause 4: firewall or network path
A firewall that rejects the connection can produce the same symptom. Test the TCP path from the client:
nc -vz db1.example.com 1521
If the test works from the database server itself but not from the client, open port 1521/tcp (or your listener’s port) in the host firewall and any network firewalls in between.
Next errors you may meet
Once the listener answers, a wrong service name gives a different error from the listener, and wrong credentials give ORA-01017. That is progress: it means the network path and listener now work.
Official documentation
Did this work for you?
No votes yet. Be the first.
If it did not work, the report form below tells the editors what went wrong.
See also
- 0221 Oracle Database basics: instance vs database, CDB and PDB An Oracle instance is memory and processes; the database is the files on disk. Since 21c every database is a container database… Beginner · Explains an idea · Linux, Windows Article Concepts & tools 15 Oct 2026
- 0222 Connecting to Oracle: SQL*Plus, SQLcl, EZConnect, tnsnames.ora and the listener Clients reach an Oracle database through the listener, using an Easy Connect string or a tnsnames.ora alias. Here are the formats, the… Intermediate · Cheat sheet · Linux, macOS, Windows Article Administration · Concepts & tools 15 Oct 2026
- 0223 Oracle users, roles and tablespaces: setup script and usage report (SQL) A SQL*Plus/SQLcl script that creates a tablespace, a role and an application user inside a PDB, then reports tablespace usage from the… Intermediate · Step by step · Any system Script Administration · Security & access 15 Oct 2026
- 0224 RMAN backup basics: ARCHIVELOG mode, a nightly backup script and restore Enable ARCHIVELOG mode, set an RMAN retention policy, run a nightly full backup with archived logs from cron, and learn the restore… Advanced · Step by step · Linux Script Administration · Backup with RMAN 15 Oct 2026
- 0225 Oracle Data Pump: export and import schemas with expdp and impdp Data Pump moves schemas, tables or whole databases between Oracle databases as dump files. Set up a directory object, export with expdp… Intermediate · Step by step · Linux, Windows Article Administration · Backup with RMAN 15 Oct 2026
- 0227 Fix: ORA-01017: invalid username/password; logon denied Oracle rejected the login. Check the password (case-sensitive), that you connect to the right PDB service, and whether the account is locked… Intermediate · Fixes an error · Any system Article Administration · Security & access 15 Oct 2026
Repos in the wild
- Oracle docker-images: Oracle Database containers oracle/docker-images Oracle's official collection of container build files and examples for its products, including Dockerfiles and a build script for Oracle Database single-instance images. GitHub
History
Every saved edit is kept. The plot on the sleeve draws one line per edit. Open any edit to see exactly what changed.
- Dominik +2,772 chars