0

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?

PSK
  • 347
  • 2
  • 13
  • There is a good a discussion related to `ORA-12170` https://stackoverflow.com/questions/23970158/ora-12170-tnsconnect-timeout-occurred – Joe Thor May 17 '21 at 10:59
  • Thanks but I have looked at it already and that does not help my case. – PSK May 18 '21 at 08:01
  • 1
    Turns out that a couple of VIPs needed to be added to the network and security ACL. I hope this helps someone in the future. – PSK May 19 '21 at 09:24
  • PSK, i have the firewalld stopped and still cant connect, ¿What exactly have you do to to disable these ACLs? thanks – nugbe Oct 22 '21 at 06:43
  • I'm sorry but I can't help much here because my organisation's network and security teams sorted this out for me. Their suggestion was that when everything seems right but you still can't connect to a database then you must be blocked by some security layer. I suggest you ask a new question with more details about your particular case and someone may be able to help. – PSK Oct 26 '21 at 07:55

0 Answers0