2013-11-24 49 views
0

我想在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。當我嘗試安裝軟件包時,出現以下錯誤:需要幫助在Cygwin上安裝DBD :: Oracle

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失敗的案例)。我無法看到如何繼續。

+0

http://stackoverflow.com/a/11408088/1251660 – slayedbylucifer

+0

這個鏈接的問題不涉及cygwin。我需要知道我設置的ORACLE_HOME應該是DOS格式還是POSIX格式。另外,我不能簡單地從cpan安裝模塊,而不是下載並手動安裝它? – user828647

+0

鏈接的答案提到設置'LD_LIBRARY_PATH',你沒有提到這樣做?你有沒有設定它,它的價值是什麼? – Joel

回答

0

而你嘗試按照指示,並說:

perl Makefile.PL -V 12.1.0 

+0

這裏沒有人似乎知道會發生什麼;嘗試cygwin郵件列表? – ysth

0

我以管理員身份運行CygWin終端並執行了所有工作後,關注了this guide

當然,你需要download 32位獲勝是.zip版本,而不是.rpm文件:

  • instantclient-basic- *
  • instantclient-的sqlplus *(有助於確定Oracle版本)
  • instantclient-sdk *

並將它們全部解壓到例如。 C:\ ORACLE \

開始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/[email protected]<sid> 

cpan get DBD::Oracle 

cd到.cpan /建設/ DBD甲骨文*文件夾

perl Makefile.PL 

make 

make install 

檢查與cpan DBD::Oracle驗證安裝。