需要帮助在Cygwin上安装DBD :: Oracle

时间:2013-11-24 11:06:09

标签: oracle perl cygwin dbd

我想在Cygwin中安装DBD::Oracle模块。我已经在C:\Oracle\instantclient_12_1下载了Oracle Instant Client(版本12.1)。我还下载了SDK和SQLPlus并将它们解压缩到instantclient_12_1目录中。我将ORACLE_HOME路径设置为export ORACLE_HOME=/cygdrive/c/Oracle/instantclient_12_1,将LD_LIBRARY_PATH设置为export LD_LIBRARY_PATH=/cygdrive/c/Oracle/instantclient_12_1/lib。当我尝试安装软件包时,我得到以下内容:

I'm having trouble finding your Oracle version number... trying harder

WARNING: I could not determine Oracle client version so I'll just
default to version 8.0.0.0. Some features of DBD::Oracle may not work.
Oracle version based logic in Makefile.PL may produce erroneous results.
You can use "perl Makefile.PL -V X.Y.Z" to specify a your client version.

Oracle version 8.0.0.0 (8.0)
DBD::Oracle no longer supports Oracle client versions before 9.2
 Try a version before 1.25 for 9 and 1.18 for 8! at Makefile.PL line 271.
Warning: No success on command[/usr/bin/perl Makefile.PL]
'YAML' not installed, will not store persistent state
  PYTHIAN/DBD-Oracle-1.66.tar.gz
  /usr/bin/perl Makefile.PL -- NOT OK
Running make test
  Make had some problems, won't test
Running make install
  Make had some problems, won't install

为什么安装程序无法检测到版本?如何成功安装模块?

编辑:根据下面的建议,我尝试了perl Makefile.PL -V 12.1.0。我得到的输出为:

Installing on a cygwin, Ver#1.7
Using Oracle in /cygdrive/c/Oracle/instantclient_12_1

            If sqlplus failed due to a linker/symbol/relocation/library error or similar problem
            then it's likely that you've not configured your environment correctly.
            Specifically, your PATH environment variable
            set to include the directory containing the Oracle libraries.

Forcing Oracle version to be treated as 12.1.0
Oracle version 12.1.0 (12.1)
Using OCI directory 'sdk'

client_version=12.1


DEFINE= -Wall -Wno-comment -DUTF8_SUPPORT -DORA_OCI_VERSION=\"12.1.0\" -DORA_OCI_102 -DORA_OCI_112


Checking for functioning wait.ph


System: perl5.014004 cygwin_nt-6.1 yaakov04 1.7.18(0.26353) 2013-03-07 19:25 x86_64 cygwin
Compiler:   gcc -O3 -DPERL_USE_SAFE_PUTENV -U__STRICT_ANSI__ -fno-strict-aliasing -pipe -fstack-protector
Linker:     /usr/bin/ld
Sysliblist:

Checking if your kit is complete...
Looks good
LD_RUN_PATH=/cygdrive/c/Oracle/instantclient_12_1/lib:/cygdrive/c/Oracle/instantclient_12_1/rdbms/lib
Using DBD::Oracle 1.66.
Using DBD::Oracle 1.66.
Using DBI 1.623 (for perl 5.014004 on cygwin-thread-multi) installed in /usr/lib/perl5/vendor_perl/5.14/x86_64-cygwin-threads/auto/DBI/
Generating a GNU-style Makefile
Writing Makefile for DBD::Oracle
Writing MYMETA.yml and MYMETA.json

但在make, make test and make install之后,模块仍未正确安装,我无法使用此运行任何脚本(make test返回37/38失败的情况)。我无法看到如何继续。

2 个答案:

答案 0 :(得分:0)

你是否尝试按照说明说:

perl Makefile.PL -V 12.1.0

答案 1 :(得分:0)

在我以管理员身份运行CygWin终端后,我跟着this guide,一切正常。

当然你需要download 32位win .zip版本而不是.rpm文件:

  • instantclient-basic- *
  • instantclient-sqlplus *(帮助确定oracle版本)
  • instantclient-SDK *

将所有内容解压缩到例如。 C:\甲骨文\

以管理员身份启动Cygwin终端并执行以下步骤:

export ORACLE_HOME=/cygdrive/c/Oracle/instantclient_12_1
export LD_LIBRARY_PATH=$ORACLE_HOME/lib
export ORACLE_DSN=DBI:Oracle:host=<oracle hostname>;sid=<oracle sid>
export ORACLE_USERID=user/password@<sid>

cpan get DBD::Oracle

进入.cpan / build / DBD-Oracle *文件夹

perl Makefile.PL

make

make install

选中cpan DBD::Oracle以验证安装。