// Oracle error reference

ORA-12514: TNS: listener doesn't know the requested service

The listener answered, but no database has registered the service name you asked for. Usually a wrong service name, a closed PDB or a database that is down.

Error code
ORA-12514
Category
Connection and login
Error message
TNS:listener does not currently know of service requested in connect descriptor

What it means

The client reached the listener, so host and port are right, but the listener has no service by the name in your connect descriptor. Databases register their services with the listener dynamically; until a database (or PDB) is open and registered, the listener can't hand connections to it.

Newer releases word it as Cannot connect to database. Service service_name is not registered with the listener at host_port.

Common causes

  • A typo in the service name, or using the SID or database name where the service name is required.
  • The database or PDB is down or not open, so its service isn't registered.
  • The database registers with a different listener (LOCAL_LISTENER points elsewhere) or registration hasn't happened yet after a listener restart.
  • Connecting to the CDB's name when the service you need belongs to a PDB.

How to fix it

  1. On the server, list the services the listener knows: lsnrctl status (or lsnrctl services).

  2. In the database, check the service names and open the PDB if it is mounted.

    SELECT name FROM v$services;
    SELECT name, open_mode FROM v$pdbs;
    ALTER PLUGGABLE DATABASE salespdb OPEN;
  3. Ask the database to register with the listener now.

    ALTER SYSTEM REGISTER;
  4. Fix the client's connect string to use a service name the listener lists.

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.