getting error install_driver(Oracle) failed: Can't load '/usr/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi/auto/DBD/Oracle/Oracle.so'

12,375

Solution 1

Please rebuild DBD::Oracle PERL module, making sure that you have all the ORACLE environment set-up on the machine, including ORACLE_HOME and LD_LIBRARY_PATH. $ORACLE_HOME folder contains these three important folders:

ls -la $ORACLE_HOME
bin
lib
network
...

and it is defined as (please choose /adapt as needed):

ORACLE_HOME=/usr/lib/oracle/11.2/client64 (RHEL5, oracle-instantclient11.2-basic-11.2 rpm packages)
ORACLE_HOME=/usr/lib64/oracle/10.2.0.4/client64 (RHEL5, oracle-instantclient-basic-10.2.0.4 rpm packages)
ORACLE_HOME=/home/oracle/app/oracle/product/11.2.0/dbhome_1 (Oracle 11g server installation)

And almost always:

LD_LIBRARY_PATH=$ORACLE_HOME/lib

(this is the folder where the "libclntsh.so.11.1" file is located!! and this LD_LIBRARY_PATH path will help PERL DB::Oracle module to find it!)

Below is an example for user environment set-up on a server with a Oracle 11g server:

cat /etc/profile.d/oracle-profile.sh
ORACLE_OWNER=oracle
ORACLE_HOME=/home/oracle/app/oracle/product/11.2.0/dbhome_1
ORACLE_BASE=/home/oracle/app/oracle
PATH=$PATH:$ORACLE_HOME/bin
LD_LIBRARY_PATH=$ORACLE_HOME/lib
export ORACLE_OWNER ORACLE_HOME ORACLE_BASE PATH LD_LIBRARY_PATH

I hope it helps.

Solution 2

1) find where is Oracle.so (you can use locate commande)

-> locate Oracle.so

-> xxxxxx/perl/lib/site_perl/5.10.0/x86_64-linux-thread-multi/auto/DBD/Oracle

2) modify the scrip Perl :

use lib "xxxxxxx/perl/lib/site_perl/5.10.0/x86_64-linux-thread-multi/auto/DBD/Oracle/";

so Compilation knows where is Oracle.so

Share:
12,375
kavuru
Author by

kavuru

Updated on June 13, 2022

Comments

  • kavuru
    kavuru almost 2 years

    i am getting below error when trying to connect to database

    install_driver(Oracle) failed: Can't load '/usr/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-
    multi/auto/DBD/Oracle/Oracle.so' for module DBD::Oracle: libclntsh.so.11.1: cannot open shared object file: 
    
    No such file or directory at /usr/lib64/perl5/5.8.8/x86_64-linux-thread-
    multi/DynaLoader.pm line 230.
     at (eval 3) line 3
    
    Compilation failed in require at (eval 3) line 3.
    

    Perhaps a required shared library or dll isn't installed where expected