Closed avmcohen closed 1 year ago
Can you provide the syntax you are using? It looks like you are providing an empty string?
import oracledb as ora dbs = ora.connect(user = 'UserName', password = 'Pasword', dsn = 'TNS alias')
While using: import cx_Oracle as ora connection works.
Interesting! Are you able to share your tnsnames.ora file? You can e-mail it directly to me if you prefer not to share it here.
Sorry !! You are right.. followed your note I checked the TNS file, and it was corrupted.. few lines before the DB I connected, the Parenthesis was not closed.. Still it's interesting why sqlplus and cx_Oracle easily skipped on corrupted line and found my DB alias. Thanks a lot !
Hi While connecting to DB in thin mode, getting the title ERROR (DPY-4000). The scenario is only when providing the TNS alias in to dsn argument. (ERROR: oracledb.exceptions.DatabaseError: DPY-4000: cannot connect to database. Unable to find "<????>" in /tnsadmin/tnsnames.ora)
When providing full TNS address (IP address:port/DSN) - it connecting fine. This happened only in thin mode. In thick mode (and cx_Oracle) it work fine.