【发布时间】:2017-07-19 16:54:22
【问题描述】:
现在我想通过 vpn 连接到 oracle 数据库,我已经用 cli 和 programmatically 设置了 vpn 配置。
当我使用 SqlAlchemy 或 cx_Oracle 连接到数据库时,出现连接超时
Python == 2.7
cx_Oracle == 6.01rc
甲骨文 == 10g
操作系统 = linux ubuntu 16.04
oracle_instant_client = 12.2 基础版
使用 cx_Oracle
ip = '<ip>'
port = 1521
service = '<dbname>'
sd = cx_Oracle.makedsn(ip, port, service)
db = cx_Oracle.connect('<username>', '<pass>', sd)
cx_Oracle是6.01rc,oracle版本是10g,返回给我
DatabaseError: ORA-12170: TNS:Connect timeout occurred
首先
我应该使用什么ip,我在vpn中已经连接的ip是41.22x.x.8或ifconfig时的ip >> ppp0 >>> p-t-p:10.0.xx.21x ??
问题出在哪里?是身份验证还是什么,我不明白为什么它的超时错误
我认为cx_Oracle 6.01rc 不是连接到 oracle 10g 的正确版本,所以我尝试了 cx_Oracle 5.3 但无法安装
VPN客户端是PPTP
参考:cx_Oracle & Connecting to Oracle DB Remotely
【问题讨论】:
-
可以tnsping db,还是通过sqlplus 连接?
-
你的意思是oracle即时客户端吗?它是 oracle_instant_client = 12.2 Basic