7

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

3
  • 1
    5.8.8 is ancient, upgrade. Do you have the oracle client installed? Did you read the readme for your platform? Commented Sep 18, 2014 at 7:51
  • yes oracle client installed Commented Sep 18, 2014 at 9:12
  • please show how you installed DBD::Oracle Commented Sep 18, 2014 at 9:14

2 Answers 2

4

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.

Sign up to request clarification or add additional context in comments.

1 Comment

export LD_LIBRARY_PATH=$ORACLE_HOME/lib this line works like a charm, thanks a lot
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

1 Comment

i added the user lib command but i get the same error. use HTTP::Request::Common qw(POST); use LWP::UserAgent; use DBI qw(:sql_types); use lib "/usr/XXX/packages/oracle/current/Perlmod/lib/x86_64-linux-thread-multi/auto/DBD/Oracle/";

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.