简体   繁体   English

无法用python的cx_Oracle连接oracle远程数据库

[英]Can't connect with cx_Oracle of Python to oracle remote database

I issue this statement: db = cx_Oracle.connect("user/pass@IP/BKTDW")我发出这个声明: db = cx_Oracle.connect("user/pass@IP/BKTDW")

and I get this error: Traceback (most recent call last): File "", line 1, in cx_Oracle.DatabaseError: Error while trying to retrieve text for error ORA-01804我收到此错误: Traceback(最近一次调用最后一次):文件“”,第 1 行,在 cx_Oracle.DatabaseError 中:尝试检索错误 ORA-01804 的文本时出错

It seems that connect method doen't work at all.似乎连接方法根本不起作用。 I have installed the Oracle Client and I am connecting normally via Toad or Sql Developer.我已经安装了 Oracle 客户端,并且通过 Toad 或 Sql Developer 正常连接。

Please Help!请帮忙!

I had to set the ORACLE_HOME variable in the system variables and also add the bin directory in the PATH system variable.我必须在系统变量中设置 ORACLE_HOME 变量,并在 PATH 系统变量中添加 bin 目录。 THNX THNX

Ensure that sqlplus is working from cmd line.确保sqlplus正在从 cmd 行工作。 It could be if on 64bit windows in has in PATH there is a target to non-64 bin version of oracle bin folder.如果在 PATH 中的64 位Windows 上有一个目标指向非 64 bin 版本的 oracle bin 文件夹。 In our case we ensured that 64bit location is placed in PATH .在我们的例子中,我们确保将 64 位位置放置在PATH 中 For instance place c:\\Oracle\\Ora11g_r2_x64\\bin\\ and remove c:\\Oracle\\ora11g_2\\bin\\ , it was not related with ORACLE_HOME .例如放置c:\\Oracle\\Ora11g_r2_x64\\bin\\并删除c:\\Oracle\\ora11g_2\\bin\\ ,它与 ORACLE_HOME无关

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM