Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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'

Tags:

linux

oracle

perl

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

like image 543
kavuru Avatar asked Sep 18 '14 07:09

kavuru


2 Answers

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.

like image 168
Steve Baroti Avatar answered Nov 18 '22 09:11

Steve Baroti


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

like image 2
TontonZition Avatar answered Nov 18 '22 09:11

TontonZition