【问题标题】:TimeOut error through connection oracle 10g with python - cx_Oracle remotely通过使用 python 连接 oracle 10g 的超时错误 - cx_Oracle 远程
【发布时间】:2017-07-19 16:54:22
【问题描述】:

现在我想通过 vpn 连接到 oracle 数据库,我已经用 cliprogrammatically 设置了 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

标签: python oracle cx-oracle


【解决方案1】:

尝试通过 SQL*Plus 进行连接。一旦可以通过 SQL*Plus 进行连接,您也应该可以通过 cx_Oracle 进行连接。 5.3 和 6.0 应该以相同的方式工作,但如果您想尝试 5.3,您可以从 PyPI 下载预构建的二进制文件。

【讨论】:

  • 首先谢谢,其次我不知道如何仅使用 sql*plus 进行连接!我在 oracle 中没有任何 exp,在这种情况下必须通过 vpn 连接你的意思是:docs.oracle.com/cd/B25329_01/doc/admin.102/b25107/… ??
  • 是的,就像那样。您可能更容易弄清楚如何通过 SQL*Plus 进行连接——如果需要,您可以直接联系 Oracle 支持。
  • 谢谢我联系了服务提供商,他没有提供我应该使用哪个 IP 是他的错:) 谢谢
猜你喜欢
  • 2018-05-03
  • 2010-09-19
  • 1970-01-01
  • 2020-10-31
  • 1970-01-01
  • 2021-08-06
  • 1970-01-01
  • 1970-01-01
  • 2020-02-03
相关资源
最近更新 更多