When I run the below command it works fine.
telnet hostname port
But when I try the below code from the same machine I get an error.
import cx_Oracle
cx_Oracle.connect(username, password, hostname:port/service_name)
DatabaseError: ORA-12170: TNS:Connect timeout occurred
I am able to connect to a different Oracle database using the same code.
I am able to connect to the database from a different machine using Oracle SQL Developer.
The database has 3 mirrored servers with 3 IP addresses and hostnames. I have tried all the IP addresses and hostnames along with the common hostname (which I'm assuming automatically resolves to one of the mirrored servers).
Can you please tell me what I may be doing wrong?