先安装DBI,再安装DBD
如果有,请忽略
yum install perl-ExtUtils-CBuilder perl-ExtUtils-MakeMaker
yum -y install perl-Digest-MD5
[root@host-10-227-222-144 DBI-1.636]# $LD_LIBRARY_PATH
bash: /tycj/app/oracle_client/product/11.2.0/client_1/lib:/tycj/app/oracle_client/product/11.2.0/client_1/jdbc/lib: No such file or directory
配置参考:
ORACLE_BASE=/u01/app/oracle_client
ORACLE_HOME=$ORACLE_BASE/product/11.2.0/client_1
LD_LIBRARY_PATH=${ORACLE_HOME}/lib:${ORACLE_HOME}/jdbc/lib
export PATH=$ORACLE_HOME/bin:$PATH
export LANG=en_US.UTF-8
#export LANG=C
export LD_LIBRARY_PATH
export TMOUT=6000
export ORACLE_BASE
export ORACLE_HOME
export ORACLE_SID=orcl
perl -version
[root@host]# perl -version
This is perl 5, version 16, subversion 3 (v5.16.3) built for x86_64-linux-thread-multi
(with 29 registered patches, see perl -V for more detail)
Copyright 1987-2012, Larry Wall
4.安装前要修改oracle_client/product/11.2.0/client_1/lib目录下两个软连接
cd /home/manager/oracle_client/product/11.2.0/client_1/lib
rm -rf libclntsh.so
rm -rf libclntsh.so.10.1
ln -s /home/manager/oracle_client/product/11.2.0/client_1/lib/libclntsh.so.11.1 /home/manager/oracle_client/product/11.2.0/client_1/lib/libclntsh.so
ln -s /home/manager/oracle_client/product/11.2.0/client_1/lib/libclntsh.so /home/manager/oracle_client/product/11.2.0/client_1/lib/libclntsh.so.10.1
#进DBI目录
#建议用root
cd DBI-1.636
#依次执行:
perl Makefile.PL
make
make test(或不执行)
make install
#进DBD目录
#建议用root
cd DBI-1.636
#依次执行:
perl Makefile.PL
make
make test(或不执行)
make install
BEGIN failed–compilation aborted at Makefile.PL line 11.
解决:
缺包
[root]yum install perl-ExtUtils-CBuilder perl-ExtUtils-MakeMaker
缺包
yum -y install perl-Digest-MD5
/usr/bin/ld: cannot find -lclntsh
collect2: ld returned 1 exit status
make: *** [blib/arch/auto/DBD/Oracle/Oracle.so] Error 1
就是没有更改软连接:
cd /home/manager/oracle_client/product/11.2.0/client_1/lib
rm -rf libclntsh.so
rm -rf libclntsh.so.10.1
ln -s /home/manager/oracle_client/product/11.2.0/client_1/lib/libclntsh.so.11.1 /home/manager/oracle_client/product/11.2.0/client_1/lib/libclntsh.so
ln -s /home/manager/oracle_client/product/11.2.0/client_1/lib/libclntsh.so /home/manager/oracle_client/product/11.2.0/client_1/lib/libclntsh.so.10.1
这个报错据说是环境变量原因,但具体不知道,按大佬说的这样处理的确解决了
vi /etc/ld.so.conf.d/oracle-x86_64.conf
echo "$ORACLE_HOME/lib" >> /etc/ld.so.conf.d/oracle-x86_64.conf && ldconfig
DBI-1.636.tar.gz
DBD-Oracle-1.75_2.tar.gz
Linux下安装Perl和Perl的DBI模块
Linux下安装DBI和DBD
Can’t locate ExtUtils/MakeMaker.pm in @INC 错误的解决方式
关于编译/usr/bin/ld: cannot find -lclntsh -小小经验分享
install_driver(Oracle) failed: Can’t load ‘/usr/local/lib/perl5/auto/DBD/Oracle/Oracle.so’ for module DBD::Oracle: libocci.so.11.1
install_driver(Oracle) failed: Can’t load `…/DBD/Oracle/Oracle.so’ for module DBD::Oracle