windows - Perl 脚本引发 oci.dll 错误,DBD

标签 windows perl oracle-call-interface dbd

我有 perl 脚本,它连接到 Oracle 数据库,打开一个文本文件并将文件中的数据加载到数据库表中,该脚本在我的开发计算机(windows xp 32 位)上完美运行,但是当我加载将脚本发送到生产服务器(Windows 2003 64 位)并从命令行运行它,它会打开一个 perl.exe - 无法找到组件窗口,消息显示

This application has failed to start because OCI.dll was not found. Re-installing the application may fix this problem.

命令行输出为:

install_driver(Oracle) failed: Can't load 'C:/Perl64/lib/auto/DBD/Oracle/Oracle.dll' for module DBD::Oracle: load_file:%1 is not a valid Win32 application at C:/Perl64/lib/DynaLoader.pm line 191. at (eval 14) line3 Compilation failde in require at (eval 14) line 3. Perhaps a required shared library or dll isn;t installde where expected at c:\warranty\warrantyImport.pl line 15

我已经重新安装了 oracle 客户端,我尝试卸载事件的 perl 和 oracle 客户端,然后在 perl 之前安装 oracle 客户端,因为听说这可能会导致问题。

我认为这可能是权限问题,所以我编写了一个简单的 perl 脚本来打开 oci.dll,如果无法打开,则会引发错误,但它能够正确打开它。

我已确保 C:\oracle\product\10.2.0\client_1\bin 位于 PATH 环境变量中。

我可以使用 SQLPlus 连接到数据库

我已将 OCI.dll 添加到与 perl 脚本相同的目录中。

现在我终于没有想法了......任何人都可以提出任何建议,我正在努力让它发挥作用。

详情 服务器正在运行 ActivePerl 5.14.1 Build 1401(64 位) Oracle数据库是10g Oracle客户端是10.2.0

最佳答案

我遇到了类似的问题,但对于 64 位版本的 Perl。我通过获取正确的客户端库并阅读本指南设法解决了这个问题:
http://www.pythian.com/news/11115/dbdoracle-and-windows-64bit/

基本上,我运行的是 Oracle 11g XE R2,它只有 32 位。所以我怀疑它正在寻找 64 位客户端库,但没有找到它们。所以我下载了:
instantclient-basic-windows.x64-11.2.0.3.0.zip
instantclient-sqlplus-windows.x64-11.2.0.3.0.zip
instantclient-sdk-windows.x64-11.2.0.3.0.zip
来自: http://www.oracle.com/technetwork/topics/winx64soft-089540.html
并安装到c:\oraclexe\instantclient_11_2

我将这些添加到我的路径中:
C:>设置 PATH = c:\oraclexe\instantclient_11_2;%PATH%
但不幸的是错误仍然存​​在:(

检查我的路径:
回显%PATH%
我可以看到该集合被忽略了。我猜这是一个权限问题。

所以我编辑了系统路径变量并重新启动了命令提示符。这解决了问题并允许我连接:)

关于windows - Perl 脚本引发 oci.dll 错误,DBD,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6847482/

相关文章:

windows - Perl 到 Linux 上的静态可执行文件

perl - 对作为哈希键

php - 天花板函数的 PHP 代码

PHP OCI、Oracle 和默认数字格式

c - Oracle 节点故障转移成功后临时 lob 的行为

windows - D 对 COM 的支持

c++ - 如何制作一个全屏但仍显示任务栏的窗口

php - fatal error : Call to undefined function oci_connect()

python - 适用于 Windows 的 gstreamer python 绑定(bind)

python - 如何检查制表符分隔文件中的列是否具有有效值?