免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
12
最近访问板块 发新帖
楼主: majia_520
打印 上一主题 下一主题

安装perl 的DBD::Oracle,一直报错 [复制链接]

论坛徽章:
0
11 [报告]
发表于 2011-08-02 17:16 |只看该作者
指定到另外一个目录试试,最好能把log都贴出来。如果 make test 失败, 强制安装试试。

论坛徽章:
0
12 [报告]
发表于 2011-08-06 13:32 |只看该作者
回复 1# majia_520


    2.2.2.2 Installing DBD::Oracle
Follow these steps to install the DBD::Oracle module:

At this point, make sure you have a test Oracle database running, with the appropriate TNS listener up. Also, if you're the root user, make sure you have the usual Oracle environment variables set up: ORACLE_HOME and ORACLE_SID (you may choose to use TWO_TASK, instead of ORACLE_SID, depending on your setup). You particularly need ORACLE_HOME to locate the OCI code libraries. Note that DBD::Oracle is similar in concept to the Type II fat JDBC drivers for use with the java.sql database connectivity package in Java. It needs at least Oracle client libraries available, in order to compile successfully:[5]

[5] That is why DBI:roxyServer and DBD:roxy may be of interest for remote clients. They let you sidestep the requirement for Oracle client libraries at the remote end (see Figure 2-4).

$ ORACLE_HOME=/u01/app/oracle/product/8.1.5

$ export ORACLE_HOME

$ ORACLE_SID=orcl

$ export ORACLE_SID
To make sure the DBD::Oracle driver is working correctly (before its full installation in the make test step described later), you'll also need to set up the following special ORACLE_USERID environment variable. (Simply change the scott/tiger@orcl string on your own installation to a valid connection string on your own test database.)

$ ORACLE_USERID=scott/tiger@orcl

$ export ORACLE_USERID
As a final environmental gotcha, you may also need to have your LD_LIBRARY_PATH environmental value pointing to all of the right little places on various Unix flavors. This will help ensure that DBD::Oracle will pick up the correct Oracle libraries:

$ LD_LIBRARY_PATH=$LD_LIBRARY_PATHORACLE_HOME/lib

$ export LD_LIBRARY_PATH
We're now ready to unpack DBD::Oracle:

$ gzip -d DBD-Oracle-1.12.tar.gz

$ tar xvf DBD-Oracle-1.12.tar

$ cd DBD-Oracle-1.12

$ vi README
As the Captain himself might have once said, "Transporter room, this is Kirk. Configure, build, and install":

$ perl Makefile.PL

$ make

$ make test

$ make install
If you do encounter any errors with this installation (particularly on the make test step), you must sort them out before running the final make install step — even if the errors appear to be nonfatal. That way, you'll have greater confidence when you're running production DBI scripts later on. Following this error hit list should remove most of the gremlins:

Ensure that ORACLE_USERID is set correctly, as described earlier.

Check that LD_LIBRARY_PATH can access the libraries residing in $ORACLE_HOME/lib.

Make sure your Oracle database is up and running with adequate memory available in the shared pool, particularly if you know that the machine's memory is tight.

Check that the correct Oracle listener is responding correctly. You can do this by connecting to it via a SQL*Plus session, from the same machine on which you're installing DBD::Oracle.

Scan through the README files again with a fine-toothed comb.

If you can't solve your problem (which should be a very rare case), you may be able to get help from the DBI users mailing lists or from the helpful information in the DBI FAQs. We explain how to access these at the end of Chapter 1.

Once you've successfully completed the make install step, you'll find plenty of up-to-date Perl DBI documentation automatically loaded onto your system. You can ensure that the documentation has been loaded by running the following pair of commands:

$ perldoc DBD::Oracle

$ perldoc DBI

论坛徽章:
0
13 [报告]
发表于 2011-08-06 17:52 |只看该作者
先删除以前安装的文件,然后设置这些环境变量,然后再重新安装,我试过无数次,安装都不会有报错:
export ORACLE_SID=ORCL
export ORACLE_BASE=/opt/oracle
export ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1
export ORA_NLS33=$ORACLE_HOME/ocommon/nls/admin/data
export PATH=$ORACLE_HOME/bin:$HOME/bin:$HOME/localperl/bin:$PATH
export NLS_LANG=AMERICAN_AMERICA.AL32UTF8
export ORACLE_USERID=scott/tiger@ORCL
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME/lib


install DBI
install DBD::Oracle

论坛徽章:
0
14 [报告]
发表于 2011-08-08 22:46 |只看该作者
一般在windows下安装都带DBI 和DBD的 ,其中有oracle的驱动
,可能是因为你没安装oracle的客户端的缘故吧,因为单独使用oracle的驱动是不行的

论坛徽章:
0
15 [报告]
发表于 2011-08-10 21:21 |只看该作者
perl Makefile.PL
执行后看有啥提示信息

论坛徽章:
0
16 [报告]
发表于 2011-09-04 09:32 |只看该作者
我也是 DBD::ORACLE 安裝不成功!



[root@10.1.1.30 DBD-Oracle-1.30]# perl Makefile.PL
Using DBI 1.616 (for perl 5.008008 on i386-linux-thread-multi) installed in /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/auto/DBI/

Configuring DBD::Oracle for perl 5.008008 on linux (i386-linux-thread-multi)

Remember to actually *READ* the README file! Especially if you have any problems.

Installing on a linux, Ver#2.6
Using Oracle in /u01/app/oracle/10g
DEFINE _SQLPLUS_RELEASE = "1002000400" (CHAR)
Oracle version 10.2.0.4 (10.2)
Found /u01/app/oracle/10g/rdbms/demo/demo_rdbms32.mk
Using /u01/app/oracle/10g/rdbms/demo/demo_rdbms32.mk
Your LD_LIBRARY_PATH env var is set to '/u01/app/oracle/10g/lib:/lib:/usr/lib'
Reading /u01/app/oracle/10g/rdbms/demo/demo_rdbms32.mk
Reading /u01/app/oracle/10g/rdbms/lib/env_rdbms.mk
cat: /u01/app/oracle/10g/lib32/sysliblist: 沒有此一檔案或目錄                     <===== 問題在這

我實際路徑只有 lib , 而没有 lib32,,,,,,,,,,,,不知為何它要找 lib 32,       並且我都把 lib COPY 多一個叫 lib 32 了,,,還是不行

求解:

[root@10.1.1.30 DBD-Oracle-1.30]# make all
Skip blib/lib/DBD/Oracle.pm (unchanged)
Skip blib/lib/oraperl.ph (unchanged)
Skip blib/arch/auto/DBD/Oracle/dbdimp.h (unchanged)
Skip blib/arch/auto/DBD/Oracle/ocitrace.h (unchanged)
Skip blib/lib/Oraperl.pm (unchanged)
Skip blib/arch/auto/DBD/Oracle/Oracle.h (unchanged)
Skip blib/lib/DBD/Oracle/Object.pm (unchanged)
Skip blib/arch/auto/DBD/Oracle/mk.pm (unchanged)
Skip blib/lib/DBD/Oracle/GetInfo.pm (unchanged)
gcc -c  -I/u01/app/oracle/10g/rdbms/public -I/u01/app/oracle/10g/rdbms/demo -I/u01/app/oracle/10g/rdbms/public -I/u01/app/oracle/10g/plsql/public -I/u01/app/oracle/10g/network/public -I/usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/auto/DBI -D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -pipe -Wdeclaration-after-statement -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables   -DVERSION=\"1.30\" -DXS_VERSION=\"1.30\" -fPIC "-I/usr/lib/perl5/5.8.8/i386-linux-thread-multi/CORE"  -Wall -Wno-comment -DUTF8_SUPPORT -DORA_OCI_VERSION=\"10.2.0.4\" -DORA_OCI_102 Oracle.c
gcc -c  -I/u01/app/oracle/10g/rdbms/public -I/u01/app/oracle/10g/rdbms/demo -I/u01/app/oracle/10g/rdbms/public -I/u01/app/oracle/10g/plsql/public -I/u01/app/oracle/10g/network/public -I/usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/auto/DBI -D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -pipe -Wdeclaration-after-statement -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables   -DVERSION=\"1.30\" -DXS_VERSION=\"1.30\" -fPIC "-I/usr/lib/perl5/5.8.8/i386-linux-thread-multi/CORE"  -Wall -Wno-comment -DUTF8_SUPPORT -DORA_OCI_VERSION=\"10.2.0.4\" -DORA_OCI_102 dbdimp.c
gcc -c  -I/u01/app/oracle/10g/rdbms/public -I/u01/app/oracle/10g/rdbms/demo -I/u01/app/oracle/10g/rdbms/public -I/u01/app/oracle/10g/plsql/public -I/u01/app/oracle/10g/network/public -I/usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/auto/DBI -D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -pipe -Wdeclaration-after-statement -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables   -DVERSION=\"1.30\" -DXS_VERSION=\"1.30\" -fPIC "-I/usr/lib/perl5/5.8.8/i386-linux-thread-multi/CORE"  -Wall -Wno-comment -DUTF8_SUPPORT -DORA_OCI_VERSION=\"10.2.0.4\" -DORA_OCI_102 oci8.c
oci8.c: In function 「describe_obj_by_tdo」:
oci8.c:3083: 警告:由於資料類型範圍限制,比較結果永遠為假
oci8.c:4672:2: 警告:檔案未以空白列結束
Running Mkbootstrap for DBD::Oracle ()
chmod 644 Oracle.bs
rm -f blib/arch/auto/DBD/Oracle/Oracle.so
gcc  -shared -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -L/usr/local/lib Oracle.o dbdimp.o oci8.o /u01/app/oracle/10g/rdbms/lib32/defopt.o  -o blib/arch/auto/DBD/Oracle/Oracle.so         \
           -ldl -lm     \
         
gcc: /u01/app/oracle/10g/rdbms/lib32/defopt.o:沒有此一檔案或目錄   <===== 問題2
make: *** [blib/arch/auto/DBD/Oracle/Oracle.so] Error 1
[root@10.1.1.30 DBD-Oracle-1.30]#


[root@oracle DBD-Oracle-1.24]# more  /root/.bash_profile

export ORACLE_SID=orcl
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/10g
export PATH=$ORACLE_HOME/binHOME/binPATH
export ORACLE_USERID=nagios/redhat@orcl           <===== 這個2個應該可有可無吧
export NLS_LANG=AMERICAN_AMERICA.AL32UTF8   <===== 這個2個應該可有可無吧
export LD_LIBRARY_PATH=$ORACLE_HOME/lib32


我之前在公司的測試機可以裝成功,,,,現在在家裡的 VM裡裝不成功,,,,弄了2天了,,很郁悶


強行安裝後:
[oracle@oracle ~]$ /usr/local/nagios/libexec/check_oracle_health -H

是没問題, 能看東西的,,,,,證明安裝成功


[oracle@oracle ~]$ /usr/local/nagios/libexec/check_oracle_health --connect orcl --username nagios --password redhat --mode connected-users
CRITICAL - cannot connect to orcl. install_driver(Oracle) failed: Can't load '/usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/auto/DBD/Oracle/Oracle.so' for module DBD::Oracle: /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/auto/DBD/Oracle/Oracle.so: undefined symbol: upioep at /usr/lib/perl5/5.8.8/i386-linux-thread-multi/DynaLoader.pm line 230.
at (eval 13) line 3
Compilation failed in require at (eval 13) line 3.
Perhaps a required shared library or dll isn't installed where expected
at /usr/local/nagios/libexec/check_oracle_health line 4712

但到這裡就執行不了啦

求解:

论坛徽章:
0
17 [报告]
发表于 2011-09-10 07:50 |只看该作者
自己找到解決方法了

[root@10.1.1.30 DBD-Oracle-1.30]# perl Makefile.PL
Using DBI 1.616 (for perl 5.008008 on i386-linux-thread-multi) installed in /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/auto/DBI/

Configuring DBD::Oracle for perl 5.008008 on linux (i386-linux-thread-multi)

Remember to actually *READ* the README file! Especially if you have any problems.

Installing on a linux, Ver#2.6
Using Oracle in /u01/app/oracle/10g
DEFINE _SQLPLUS_RELEASE = "1002000400" (CHAR)
Oracle version 10.2.0.4 (10.2)
Found /u01/app/oracle/10g/rdbms/demo/demo_rdbms32.mk
Using /u01/app/oracle/10g/rdbms/demo/demo_rdbms32.mk
Your LD_LIBRARY_PATH env var is set to '/u01/app/oracle/10g/lib:/lib:/usr/lib'
Reading /u01/app/oracle/10g/rdbms/demo/demo_rdbms32.mk                     <===== 2. 解決方法在這:找到 lib32 修改成 lib 就行了
Reading /u01/app/oracle/10g/rdbms/lib/env_rdbms.mk
cat: /u01/app/oracle/10g/lib32/sysliblist: 沒有此一檔案或目錄                     <===== 1. 問題在這
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP