> ## Content Index
> Fetch the complete content index at: https://www.ggorantala.dev/llms.txt
> Use this file to discover other available public pages before exploring further.

# ORA-12514: Listener Does Not Know of Service Requested, Fixed
- URL: https://www.ggorantala.dev/ora-12514-listener-does-not-know-service/
- Published: 2026-11-27T20:55:00.000Z
- Updated: 2026-11-29T20:55:33.000Z
- Description: ORA-12514 means the listener answered and has never heard of the service you asked for. Here's how to tell a wrong name from a missing registration in two queries, and fix the right one.
- Author: Gopi Gorantala
- Tags: ora-12514, oracle-listener, service-name, oracle-pdb, oracle-net, oracle-database

I was sure the listener was broken. It wasn't. It was up, it answered on 1521 in a few milliseconds, and it had never heard of the service our ledger-posting job was asking for. That's what ORA-12514 is telling you, and once you read it that way, most of the guesswork goes away.

## The error, in both of its wordings

On a 19c-era client or driver you get the line everybody has pasted into Google at some point:

```log
ORA-12514: TNS:listener does not currently know of service requested in connect descriptor

```

Older Oracle JDBC drivers wrap it in their own sentence, so in a Java stack trace it usually shows up like this:

```log
java.sql.SQLException: Listener refused the connection with the following error:
ORA-12514, TNS:listener does not currently know of service requested in connect descriptor

```

The 23ai and 26ai documentation rewrote the message so it carries the evidence with it. This is the form from [Oracle's error help page for ORA-12514](https://docs.oracle.com/en/error-help/db/ora-12514/?ref=ggorantala.dev); the placeholders get filled with your values:

```log
ORA-12514: Cannot connect to database. Service service_name is not registered with the listener at host_port. (CONNECTION_ID=connection_id)

```

The [Net Services Administrator's Guide](https://docs.oracle.com/en/database/oracle/oracle-database/26/netag/ora-12514-listener-does-not-currently-know-service-requested-connect-descriptor.html?ref=ggorantala.dev) gives a filled-in example (`Service sales_service.example.com is not registered with the listener at host 10.9.7.5 port 1522.`) and one more that's worth memorising: `Service Default is not registered...`, which is what you see when your connect string didn't name a service at all.

Two things to notice before anything else. It happens at connect time, never mid-query. And it's raised by the listener, the small process on the database host that accepts network connections and hands them to the database. So your network is fine. Your host and port are fine. Everything after that is about one name.

## How far did the connection get?

The ORA-125xx family is really a map of how far a connection got. ORA-12154 means your client couldn't even resolve the alias, so nothing went over the wire. ORA-12541 means nothing was listening on that host and port. ORA-12514 means the listener was there, read your request, and said no. (I compare the three properly in [ORA-12514 vs ORA-12541 vs ORA-12154](https://ggorantala.dev/ora-12514-vs-ora-12541-vs-ora-12154/?ref=ggorantala.dev).)

So the triage is two questions: what service did I ask for, and what services does this listener actually know?

```bash
# On the database host (or inside the container): what the listener knows
lsnrctl services

# From your laptop: prove the port answers, so you stop suspecting the network
nc -vz db-host 1521

```

```sql
-- From any session that does work (often SQL*Plus on the host as SYSDBA):
-- what the instance thinks it is offering
SELECT name, network_name, con_id FROM v$active_services ORDER BY con_id, name;
SHOW PARAMETER local_listener

```

Those two lists settle it. If your name appears in neither, you're asking for something that doesn't exist (typo, wrong PDB, a service nobody started). If it's in `v$active_services` but missing from `lsnrctl services`, the database has it and failed to tell this listener. Completely different fixes, same error code.

My first wrong move with the ledger job was restarting the listener. It felt reasonable, the error says "listener" right in it. All that did was wipe its dynamic registrations and give us another forty seconds of the same error while the database re-registered.

## Break it on purpose, three ways

Run this against a throwaway container, never a shared database. I use [gvenzl's Oracle Database Free image](https://github.com/gvenzl/oci-oracle-free?ref=ggorantala.dev) because the slim faststart tags come up quickly; Oracle's own `container-registry.oracle.com/database/free` image behaves the same for everything below. Pin a tag rather than using `latest`, and check `SELECT banner_full FROM v$version` so you know which release you're on.

Setup:

```bash
docker run -d --name lab-oracle -p 1521:1521 \
  -e ORACLE_PASSWORD=LabOnly_2026 \
  -e APP_USER=ledger -e APP_USER_PASSWORD=Ledger_2026 \
  gvenzl/oracle-free:23-slim-faststart

docker logs -f lab-oracle   # wait for the DATABASE IS READY TO USE! banner

```

Oracle Database Free creates two services by default, `FREE` (the root container, CDB$ROOT) and `FREEPDB1` (the default pluggable database, which is where `APP_USER` gets created). That's documented in [Connecting to Oracle Database Free](https://docs.oracle.com/en/database/oracle/oracle-database/23/xeinl/connecting-oracle-database-free.html?ref=ggorantala.dev). If CDB and PDB are new to you, [CDB vs PDB](https://ggorantala.dev/oracle-cdb-vs-pdb-errors/?ref=ggorantala.dev) explains why that split causes half of Oracle's confusing errors.

**Variant 1: the wrong name.** This is the one you'll hit most.

```bash
docker exec -it lab-oracle sqlplus -L ledger/Ledger_2026@//localhost:1521/FREEPDB2

```

You get ORA-12514 straight away, in whichever wording your SQL\*Plus prints. On a 23ai/26ai client the message names `FREEPDB2` and the host and port the listener saw. Change it to `FREEPDB1` and you're in. (If you get ORA-12505 instead, you wrote `localhost:1521:FREEPDB1` with a colon, so the client sent the name as a SID. That's [ORA-12505](https://ggorantala.dev/ora-12505-listener-does-not-know-sid/?ref=ggorantala.dev), and [SID vs service name](https://ggorantala.dev/oracle-sid-vs-service-name/?ref=ggorantala.dev) has the rule.)

**Variant 2: too early.** Remove the container, start it again, and try to connect in a loop the moment `docker run` returns:

```bash
docker rm -f lab-oracle && docker run -d --name lab-oracle -p 1521:1521 \
  -e ORACLE_PASSWORD=LabOnly_2026 gvenzl/oracle-free:23-slim-faststart
for i in $(seq 1 30); do
  docker exec lab-oracle bash -c 'echo exit | sqlplus -L -s system/LabOnly_2026@//localhost:1521/FREEPDB1' | head -2
  sleep 2
done

```

Depending on timing you'll see a couple of different failures first (nothing listening yet, then ORA-12514 for a stretch), and then it connects. Same container, same name, no change from you. Docker Compose and CI make this one worse, and it has its own article: [ORA-12514 before the database is ready](https://ggorantala.dev/oracle-docker-ora-12514-not-ready/?ref=ggorantala.dev).

**Variant 3: the database is telling the wrong listener.** This is the one that eats a day in production, because the name is right and it never fixes itself. Do it inside the lab only:

```bash
docker exec -i lab-oracle sqlplus -s / as sysdba <<'SQL'
SHOW PARAMETER local_listener
ALTER SYSTEM SET local_listener = '(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=1599))' SCOPE = MEMORY;
SQL
docker exec lab-oracle lsnrctl stop
docker exec lab-oracle lsnrctl start

```

Write down the original `local_listener` value first so you can put it back. Now the listener on 1521 starts with an empty list, and the database keeps trying to register with a port nothing is on. Every connection to `FREEPDB1` gets ORA-12514, forever. `lsnrctl services` shows no `FREEPDB1`, while `v$active_services` still lists it. That mismatch is the signature.

Forcing levers, so you know what you bent: `SCOPE = MEMORY` keeps the change out of the SPFILE, so a container restart undoes it; a real system usually has `local_listener` set deliberately, or empty and defaulting.

Teardown: `docker rm -f lab-oracle`. The faststart image without a volume leaves nothing behind. If you mounted a volume, remove it too, or your next lab starts from the broken settings.

## The short answer

The listener keeps a list of service names. You asked for one that isn't on it. Either the name is wrong, or the database hasn't put it there.

## How a service ends up on the listener's list

A service is a name a database advertises for clients to connect to. One PDB can have several; each one has a `network_name`, and that string is what has to match `SERVICE_NAME` in your connect string.

The list gets filled two ways. The normal way is dynamic registration: a background process in the database called LREG (Listener Registration) connects to the listener and tells it which services this instance offers and how to hand connections over. The [service registration chapter](https://docs.oracle.com/en/database/oracle/oracle-database/26/netag/service-registration1.html?ref=ggorantala.dev) says LREG tries periodically, and that it can take up to 60 seconds after startup before it registers. If the listener isn't running when the instance starts, LREG can't register until its next attempt. `ALTER SYSTEM REGISTER` makes it register now instead of waiting.

Which listener does LREG talk to? By default, the local one on TCP port 1521\. If your listener runs anywhere else, the `LOCAL_LISTENER` initialization parameter tells LREG where it is ([registering with a local listener](https://docs.oracle.com/en/database/oracle/oracle-database/26/netag/registering-information-local-listener.html?ref=ggorantala.dev)). It's dynamic, set with `ALTER SYSTEM`, and setting it to an empty string puts it back to the 1521 default. A wrong value here means the database is cheerfully registering with nobody, which is variant 3.

The other way is static registration, an entry in `SID_LIST_LISTENER` in `listener.ora`. The listener then knows the service whether or not the database is up, and `lsnrctl status` shows it as `UNKNOWN` instead of `READY`. (Reading that output line by line is in [lsnrctl status and services](https://ggorantala.dev/lsnrctl-status-services-explained/?ref=ggorantala.dev).)

So the listener's question when your request arrives is narrow: is this exact name registered dynamically, or listed statically? No to both, ORA-12514\. It doesn't know or care whether the database exists, whether your password is right, or whether the PDB is open. The docs say outright that it can be temporary, before registration finishes.

The surprise for me was the new message format. I'd been treating ORA-12514 as "the error with no information in it", and the 26ai wording quietly fixed that. `host_port` tells you which listener your request actually reached, which is gold when there's a load balancer, a NAT or a Docker port mapping in the way and you're not sure you're even talking to the right box. And `Service Default` tells you your connect string arrived with an empty service name, usually a templated JDBC URL where the variable never got substituted. I spent a while assuming a registration problem on exactly that once. The service name was blank.

## Finding which ORA-12514 you have, and fixing it

Collect two lists and the connect string your app really used (log it at startup, with the password masked). Then match the case.

**Your name is in neither list.** It's a naming problem. Common ones I've seen:

- You used the CDB service when your tables live in a PDB, or the other way round. In Free that's `FREE` vs `FREEPDB1`; in a 19c install it's the CDB name vs the PDB name.
- `db_domain` is set, so the service is really `ledger.example.com`, and you asked for `ledger`. Compare against `network_name` in `v$active_services`, not against what someone told you.
- It's a custom service created with `DBMS_SERVICE.CREATE_SERVICE` that nobody started after the last restart. Creating a service doesn't start it. Start it in its PDB with `DBMS_SERVICE.START_SERVICE('LEDGER_APP')`, then make it survive restarts with whatever manages your instance (`srvctl` and Oracle Restart, or `ALTER PLUGGABLE DATABASE ... SAVE STATE` while the service is running).
- In Data Guard or RAC, the service runs on a different node or the new primary after a switchover, and your connect string lists only the old host. That listener is up and has honestly never heard of the service.

The fix is the connect string, or starting the service. Not the listener.

```properties
# before: the root container's service
spring.datasource.url=jdbc:oracle:thin:@//db-host:1521/FREE
# after: the PDB where the ledger tables live
spring.datasource.url=jdbc:oracle:thin:@//db-host:1521/FREEPDB1

```

**It's in `v$active_services` but not in `lsnrctl services`.** Registration is broken. Check `LOCAL_LISTENER` against the address the listener is actually on (`lsnrctl status` prints its endpoints), fix it, then register:

```sql
-- Look before you change. ALTER SYSTEM affects the whole instance.
SHOW PARAMETER local_listener
ALTER SYSTEM SET local_listener = '' SCOPE = BOTH;   -- only if the listener really is on the default 1521
ALTER SYSTEM REGISTER;

```

`SCOPE = BOTH` writes it to the SPFILE as well, so it survives a restart; use `MEMORY` first if you want to prove the fix before you commit it. On RAC, also look at `REMOTE_LISTENER` and the SCAN listeners. Run `lsnrctl services` again: your service should be there with a `READY` handler.

**It's in both lists and still fails.** Then you aren't reaching the listener you checked. That's where the new message's `host_port` earns its keep; on an older client, confirm the host and port in the connect descriptor actually resolved to the machine you ran `lsnrctl` on. Several listeners on one host, each on its own port, is the usual culprit.

**It comes and goes right after a restart.** That's registration lag. The database is fine, and your app is too impatient. Retry for a bounded window or wait on a real readiness check (variant 2).

And the non-fixes, because they come up in every thread:

- Restarting the listener. It drops every dynamic registration. If registration was the problem, it's still the problem a minute later.
- Adding a static `SID_LIST_LISTENER` entry to make the error go away. It works, in the sense that the listener now hands you to the instance even when the service isn't really running, and your error turns into ORA-01034 or a PDB-not-open error at 3 a.m. instead. Static entries have real uses (RMAN duplicating to an instance that isn't up, for one), but a fix for a typo isn't one of them.
- `USE_SID_AS_SERVICE_listener`. That's a workaround for the SID/service mix-up behind ORA-12505, not this.
- Granting anything. ORA-12514 happens before authentication. No privilege on earth changes it.

If the PDB exists and is registered but isn't open, you'll usually get a different error at login rather than ORA-12514\. That case lives in [ORA-01109: database not open](https://ggorantala.dev/ora-01109-database-not-open/?ref=ggorantala.dev).

## The connect string I'd ship instead

What finally stopped this coming back for the ledger job wasn't clever. Give each application its own service, so nobody connects to the CDB service or the PDB's default service by accident, and so you can move the app around (another node, the standby after a switchover) without changing its config. Keep the full connect string in one config value per environment, logged at startup. And let the connect descriptor do the retrying for the startup case.

```properties
# One value per environment. The service is the app's own, not FREEPDB1 or the CDB name.
spring.datasource.url=jdbc:oracle:thin:@(DESCRIPTION=(CONNECT_TIMEOUT=10)(RETRY_COUNT=5)(RETRY_DELAY=3)(ADDRESS_LIST=(LOAD_BALANCE=off)(ADDRESS=(PROTOCOL=TCP)(HOST=db-primary)(PORT=1521))(ADDRESS=(PROTOCOL=TCP)(HOST=db-standby)(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=ledger_app.example.com)))

```

`RETRY_COUNT` and `RETRY_DELAY` are connect-descriptor parameters (see the Net Services Reference for your release for defaults and limits); with two addresses, the client tries the next host when one listener says it has no such service. Pair it with a role-based service that only runs on the current primary, and a switchover stops being an ORA-12514 incident.

The Spring line is only a carrier; the same descriptor works in a `tnsnames.ora` alias or a python-oracledb `dsn`. Pool configuration itself is a separate topic.

## Catching it before production does

Start with a deploy smoke check: connect with the exact URL the app will use, before the app takes traffic. Most ORA-12514s I've been called about were config that had never once been used against that environment.

Then the listener log. Every refused connection is written there, so a count of ORA-12514 per minute, alerting when it's above zero for more than a couple of minutes outside a deploy window, catches a lost registration long before a human notices. Match on the code, `12514`, not on the message text. The text changed between 19c and 23ai/26ai, and any alert or log parser that greps for "does not currently know of service" will go quiet the day someone upgrades a client, while the error itself carries on.

For containers, wire the image's healthcheck into Compose and CI so nothing connects before the database says it's ready. In the gvenzl images it's `healthcheck.sh`.

Version notes worth re-checking on upgrade: the message wording (above), and whether your client prints `CONNECTION_ID`, which you can use to find the attempt in listener and client traces. The mechanism itself, LREG plus `LOCAL_LISTENER`, is the same on 19c and 26ai.

None of this is exotic, and it still took me most of two days, the first time, to stop blaming the listener and start comparing lists. Writing it down here is mostly so you skip that part, on whichever version you're on.

## Takeaways

- ORA-12514 means the listener is reachable. Stop checking firewalls.
- Compare `lsnrctl services` with `v$active_services`. Missing from both is a naming problem; missing only from the listener is a registration problem.
- Don't restart the listener to fix it, and don't paper over it with a static entry.
- On 23ai/26ai the message tells you the service and the host\_port. Read them; `Service Default` means your URL had no service name.
- Give each app its own service and alert on the code, not the text.

## Questions people ask about ORA-12514

**How do I find the right service name for my Oracle database?** On the database host, run `lsnrctl services` to see what the listener knows, or query `SELECT name, network_name FROM v$active_services` from a session that works. Use the `network_name` value in your connect string. In Oracle Database Free the defaults are `FREE` for the root container and `FREEPDB1` for the default PDB.

**How do I fix ORA-12514 in SQL Developer?** Edit the connection, switch the connection type to Service name rather than SID, and put the PDB's service there (for example `FREEPDB1`, not `FREE`). If it still fails, the service isn't registered with that listener; check it with `lsnrctl services` on the server. If SQL Developer reports ORA-12505 instead, it's sending your value as a SID.

**Why do I get ORA-12514 right after starting Oracle in Docker?** The listener starts before the database finishes registering its services, which can take up to about a minute. Wait for the container's readiness signal or healthcheck before connecting. The Docker case has its own walkthrough in [ORA-12514 before the database is ready](https://ggorantala.dev/oracle-docker-ora-12514-not-ready/?ref=ggorantala.dev).

**Does restarting the listener fix ORA-12514?** Rarely. A restart throws away all dynamic registrations, so you get the same error until the database registers again. If registration is broken because `LOCAL_LISTENER` points elsewhere, fix that and run `ALTER SYSTEM REGISTER` instead.