I am trying to connect to an Oracle Data instance (ORAD) with a Python script.
Here is the basic script:
import cx_Oracle
conn = cx_Oracle.connect("username/password@//server:1560/orad")
c = conn.cursor()
c.execute('select distinct * from table1')
for row in c:
print(row)
conn.close()
I currently have the instance's port
, SID
, and hostname
, too, if that helps.
Running this script yields a: cx_Oracle.DatabaseError: ORA-12514: TNS:listener does not currently know of service requested in connect descriptor
error,
while using the other connections (that is commented out) yields an error SyntaxError: invalid syntax
I am unsure of what I am doing wrong. I did check my TNSNAMES.ORA
file which contains a few ifile
links to DBA secured (I don't have access to see or edit) other files.
I have viewed this post and this post, but I don't have the IP, just the host name.
Any assistance would be appreciated.