0

Now I want to connect to oracle database through vpn, I already set up vpn configurations with cli and programmatically .

When I connect to the database using SqlAlchemy or cx_Oracle it gives me connection timeout occured

Python == 2.7
cx_Oracle == 6.01rc
oracle == 10g
os = linux ubuntu 16.04
oracle_instant_client = 12.2 Basic

using cx_Oracle

ip = '<ip>'
port = 1521
service = '<dbname>'
sd = cx_Oracle.makedsn(ip, port, service)
db = cx_Oracle.connect('<username>', '<pass>', sd)

cx_Oracle is 6.01rc and oracle version is 10g, it returns me

DatabaseError: ORA-12170: TNS:Connect timeout occurred

First of all

What ip should I use, the ip that I already connected to in the vpn which is 41.22x.x.8 or the ip when ifconfig >> ppp0 >>> p-t-p:10.0.xx.21x ??

Where is the problem ? Is it authentication one or what, I don't understand why its timeout error I think that cx_Oracle 6.01rc is not proper version to connect to oracle 10g so I tried cx_Oracle 5.3 but can't install

The VPN client is PPTP

VPN is up

Reference: cx_Oracle & Connecting to Oracle DB Remotely

A.Raouf
  • 2,171
  • 1
  • 24
  • 36

1 Answers1

1

Try connecting through SQL*Plus. Once you can connect through SQL*Plus you should be able to connect through cx_Oracle, too. 5.3 and 6.0 should work the same way but if you want to try 5.3 you can download pre-built binaries from PyPI.

Anthony Tuininga
  • 6,388
  • 2
  • 14
  • 23
  • First Thanks, Second I don't know how to connect using sql*plus only !! I don't have any exp in oracle and have to connect through a vpn at this case Do u mean that: https://docs.oracle.com/cd/B25329_01/doc/admin.102/b25107/connecting.htm#CEGIGEIJ ?? – A.Raouf Jul 22 '17 at 17:54
  • Yes, like that. You'll probably have an easier time figuring out how to connect through SQL*Plus -- and you can contact Oracle Support directly for it, if needed. – Anthony Tuininga Jul 22 '17 at 22:07
  • Thanks I contacted the provider of the service and it was his fault he didn't provide me which IP should I use :) Thanks – A.Raouf Aug 01 '17 at 21:22