I am trying to access an oracle database on another machine. I am using:
- Ubuntu Server 18.04
- oracle client 12.2
- python 3.6 and cx_oracle 6.4.1
I constanly get this error:
Error
File "basic_test.py", line 5, in <module>
con = cx_Oracle.connect('jalabe','jalabepass', cx_Oracle.makedsn('ipserver','port',None,'prod'))
cx_Oracle.DatabaseError: ORA-12514: TNS:listener does not currently know of service requested in connect descriptor
basic_tst.py
import cx_Oracle
# first attempt
# con = cx_Oracle.connect('jalabe/jalabepass@ipaddress/prod')
# second attempt
con = cx_Oracle.connect('jalabe','jalabepass', cx_Oracle.makedsn('ipaddress','port',None,'prod'))
print(con.version)
con.close()
tnsnames.ora
DATABASE.WORLD =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = ipaddress)(PORT = port))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = prod)
)
)
Other info
$ORACLE_HOME
as/usr/lib/oracle/12.1/client64/lib/
- File
tnsnames.ora
is inside/usr/lib/oracle/12.1/client64/network/admin
I have read many post without any luck. From all of the post I have read these are the ones I think are more usefull although they haven't work
- ORA-12514 TNS:listener does not currently know of service requested in connect descriptor
- https://stackguides.com/questions/46914943/can-not-connect-ora-12514-tnslistener-does-not-currently-know-of-service-reque
I am sure it might be some character somewhere.
I don't have sqlplus installed nor tnslistener. (Could it be the cause?) (I have read that tnslistener
should be in the oracle server which is why i haven't installed it)