Perl 脚本引发 oci.dll 错误,DBD
我有 perl 脚本,它连接到 Oracle 数据库,打开一个文本文件并从数据库表中的文件加载数据,该脚本在我的开发计算机(windows xp 32 位)上完美运行,但是当我将脚本加载到生产服务器(Windows 2003 64 位)并从命令行运行它,它会打开一个 perl.exe - 无法找到组件窗口,消息说
由于找不到 OCI.dll,该应用程序无法启动。重新安装应用程序可能会解决此问题。
命令行输出为:
install_driver(Oracle) 失败:无法加载 模块 DBD::Oracle 的“C:/Perl64/lib/auto/DBD/Oracle/Oracle.dll”: load_file:%1 不是有效的 Win32 应用程序 C:/Perl64/lib/DynaLoader.pm 第 191 行。在 (eval 14) line3 编译 在 (eval 14) 第 3 行的 require 中失败。也许需要共享 库或 dll 未安装在预期位置 c:\warranty\warrantyImport.pl 第 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
I have perl script which connects to an Oracle database, opens a text file and loads the data from the file in a database table, the script works perfectly on my development machine (windows xp 32 bit), however when i load the script to the production server (windows 2003 64 bit) and run it from a command line, it opens a perl.exe - unable to locate component windows, the message says
This application has failed to start because OCI.dll was not found. Re-installing the application may fix this problem.
The command line output is:
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
I have reinstalled the oracle client, i have tried uninstalling both active perl and the oracle client and then installing the oracle client before perl as heard this might cause the issue.
I thought it could be permissions so i wrote a simple perl script to open to oci.dll and raised an error if unable, it was able to open it correctly.
I have ensured C:\oracle\product\10.2.0\client_1\bin is in the PATH enviroment variable.
I can connect to the database using SQLPlus
I have added the OCI.dll to the same directory as the perl script.
and i've now finally run out of ideas....can anyone suggest anything, i'm tearing my hair out trying to get it working.
Details
Server is running ActivePerl 5.14.1 Build 1401 (64-bit)
Oracle database is 10g
Oracle client is 10.2.0
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我有一个类似的问题,但对于 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%
我可以看到该集合被忽略了。我猜这是一个权限问题。
所以我编辑了系统路径变量并重新启动了命令提示符。这解决了问题并允许我连接:)
I had a similar issue but for the 64bit version of Perl. I managed to resolve it by getting the correct client libraries and reading this guide:
http://www.pythian.com/news/11115/dbdoracle-and-windows-64bit/
Bascially, I’m running Oracle 11g XE R2, which only comes as 32bit. So I suspected that it was looking for the 64bit client libraries and not finding them. So I downloaded:
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
From:
http://www.oracle.com/technetwork/topics/winx64soft-089540.html
And installed to c:\oraclexe\instantclient_11_2
I added these to my path:
C:>set PATH = c:\oraclexe\instantclient_11_2;%PATH%
But unfortunately the error persisted :(
On checking my PATH:
echo %PATH%
I could see that the set was getting ignored. I guess that was a permissions issue.
So I edited the system path variable and restarted the command prompt. This fixed the issue and allowed me to connect :)
您是否混合了一些 32 位和 64 位组件。显然,您需要 64 位 Perl、64 位 DBI 和 DBD::Oracle 以及用于 Oracle 客户端的 64 位 dll。我只建议您检查,因为错误显示“不是有效的 Win32 应用程序”。
Have you mixed some 32 bit and 64 bit components. Obviously you need 64 bit Perl, 64 bit DBI and DBD::Oracle and 64 bit dlls for Oracle client. I only suggest you check as the error says "is not a valid Win32 application at".