0

I am trying to connect to the database via Python ? I use oracle with the sqldevolper and have no problems there, but now when connecting between oracle and python the problem appears. When I try to connect, I get the following error :

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

I tried the script with spyder:

import cx_Oracle

con = cx_Oracle.connect(
    user="abc",
    password ="pass",
    dsn="....")
2
  • You can check solution of similar question Commented May 28, 2022 at 10:57
  • If you're just starting out with Python and Oracle, then start with the latest version of the driver. cx_Oracle got renamed to python-oracledb recently, see the release announcement. Documentation is now here. Functionality will effectively be the same as with cx_Oracle: you just use a different name. Commented May 28, 2022 at 22:55

1 Answer 1

1

ORA-12514 means you are connecting to a listener, but the service name you specified in your connection string, isn't known by the listener. As you omitted the definition of the connect string (from SQL Developer and Python), hard to say if there is a typo or what caused it...

On the server you can check with "lsnrctl status" on the known services... maybe that gives you a hint, what might be wrong.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.