🧩 ORA-12514: TNS Listener Does Not Currently Know of Service Requested in Connect Descriptor


 🧩 When connecting to an Oracle database, you may encounter the following error:


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



---


🔎 Cause


This error occurs when the listener is running but it does not recognize the service name specified in your connection string.

Common reasons include:


The database is not registered with the listener.


The service name in the tnsnames.ora file or connection string is misspelled.


The database instance is not open.




---


🛠️ Solution


1. Verify Database Services Registered with Listener


Run the command on the database server:


lsnrctl status


Check if your service name appears under Services Summary.


2. Manually Register Database with Listener


Log in as SYSDBA and execute:


ALTER SYSTEM REGISTER;


3. Check SERVICE_NAMES Parameter


Ensure the service name matches what’s in your tnsnames.ora.


SHOW PARAMETER service_names;


If incorrect, set it properly:


ALTER SYSTEM SET service_names='ORCL' SCOPE=BOTH;


4. Correct Your Connection String


If you’re using SQL*Plus or any client tool, ensure the service name matches exactly. Example:


sqlplus user/password@//hostname:1521/ORCL


5. Restart the Listener (if required)


lsnrctl stop

lsnrctl start



---


✅ Best Practices


Always double-check service names and listener configurations after creating or cloning a database.


Automate database registration by setting LOCAL_LISTENER properly.


Keep tnsnames.ora entries consistent across client machines.




---


⚡ With these steps, the ORA-12514 error can usually be resolved quickly, ensuring a smooth database connection.



---

Comments