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

I get below errors 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 the required shared library or dll is not installed where expected

+6
source share
2 answers

Restore the DBD :: Oracle PERL module, making sure that the ORACLE environment is configured on the computer, including ORACLE_HOME and LD_LIBRARY_PATH. The $ ORACLE_HOME folder contains these three important folders:

 ls -la $ORACLE_HOME bin lib network ... 

and is defined as (please select / adapt if necessary):

 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 file "libclntsh.so.11.1" is located!), and this path LD_LIBRARY_PATH will help PERL DB :: Oracle find it!)

The following is an example of setting up a user environment on a server with an 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 

Hope this helps.

+2
source

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

-> Find Oracle.so

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

2) modify the Perl script:

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

therefore compilation knows where Oracle.so is located

+1
source

Source: https://habr.com/ru/post/975473/