【问题标题】:Can't connect with cx_Oracle of Python to oracle remote database无法用 Python 的 cx_Oracle 连接到 oracle 远程数据库
【发布时间】:2018-05-11 14:53:14
【问题描述】:

我发出此声明:db = cx_Oracle.connect("user/pass@IP/BKTDW")

我得到这个错误: 回溯(最近一次通话最后): 文件“”,第 1 行,在 cx_Oracle.DatabaseError: 尝试检索错误 ORA-01804 的文本时出错

似乎connect方法根本不起作用。我已经安装了 Oracle 客户端,并且通过 Toad 或 Sql Developer 正常连接。

请帮忙!

【问题讨论】:

标签: python oracle cx-oracle


【解决方案1】:

我必须在系统变量中设置 ORACLE_HOME 变量,并在 PATH 系统变量中添加 bin 目录。太棒了

【讨论】:

    【解决方案2】:

    确保 sqlplus 正在从 cmd 行运行。如果在 64 位 windows 上的 PATH 中有一个非 64 bin 版本的 oracle bin 文件夹的目标。在我们的例子中,我们确保将 64 位位置放置在 PATH 中。例如放置 c:\Oracle\Ora11g_r2_x64\bin\ 并删除 c:\Oracle\ora11g_2\bin\,它与 ORACLE_HOME 不相关

    【讨论】:

      猜你喜欢
      • 2020-02-06
      • 2010-09-19
      • 2020-08-10
      • 1970-01-01
      • 1970-01-01
      • 2012-07-16
      • 2018-12-29
      • 2016-12-07
      相关资源
      最近更新 更多