• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1840
  • Last Modified:

Linux Oracle Perl DBD-Oracle help

Hi im getting an error when trying to use DBD-Oracle in a perl script.

install_driver(Oracle) failed: Can't load '/usr/lib/perl5/vendor_perl/5.8.5/i386-linux-thread-multi/auto/DBD/Oracle/Oracle.so' for module DBD::Oracle: libclntsh.so.10.1: cannot open shared object file: No such file or directory at /usr/lib/perl5/5.8.5/i386-linux-thread-multi/DynaLoader.pm line 230.
 at (eval 5) line 3
Compilation failed in require at (eval 5) line 3.
Perhaps a required shared library or dll isn't installed where expected
 at updateGwInfo.pl line 18
Process perl exited with code 255
0
Extreme66
Asked:
Extreme66
  • 2
  • 2
1 Solution
 
Adam314Commented:
It looks like DBD::Oracle was not installed correctly.  To install it, run this as root:  cpan DBD::Oracle
0
 
Extreme66Author Commented:
Hi Adam I did try running that but was returned with some errors

Checking if your kit is complete...
Warning: the following files are missing in your kit:
        META.yml
Please inform the author.
LD_RUN_PATH=/opt/oracle/product/10g/db/lib:/opt/oracle/product/10g/db/rdbms/lib
Using DBD::Oracle 1.22.
Using DBD::Oracle 1.22.
Multiple copies of Driver.xst found in: /usr/lib/perl5/site_perl/5.8.5/i386-linux-thread-multi/auto/DBI/ /usr/lib/perl5/vendor_perl/5.8.5/i386-linux-thread-multi/auto/DBI/ at Makefile.PL line 1693
Using DBI 1.607 (for perl 5.008005 on i386-linux-thread-multi) installed in /usr/lib/perl5/site_perl/5.8.5/i386-linux-thread-multi/auto/DBI/
Writing Makefile for DBD::Oracle

***  If you have problems...
     read all the log printed above, and the README and README.help.txt files.
     (Of course, you have read README by now anyway, haven't you?)

cp Oracle.pm blib/lib/DBD/Oracle.pm
cp oraperl.ph blib/lib/oraperl.ph
cp dbdimp.h blib/arch/auto/DBD/Oracle/dbdimp.h
cp ocitrace.h blib/arch/auto/DBD/Oracle/ocitrace.h
cp Oraperl.pm blib/lib/Oraperl.pm
cp Oracle.h blib/arch/auto/DBD/Oracle/Oracle.h
cp lib/DBD/Oracle/GetInfo.pm blib/lib/DBD/Oracle/GetInfo.pm
cp mk.pm blib/arch/auto/DBD/Oracle/mk.pm
/usr/bin/perl -p -e "s/~DRIVER~/Oracle/g" /usr/lib/perl5/site_perl/5.8.5/i386-linux-thread-multi/auto/DBI/Driver.xst > Oracle.xsi
/usr/bin/perl /usr/lib/perl5/5.8.5/ExtUtils/xsubpp  -typemap /usr/lib/perl5/5.8.5/ExtUtils/typemap -typemap typemap  Oracle.xs > Oracle.xsc && mv Oracle.xsc Oracle.c
gcc -c  -I/opt/oracle/product/10g/db/rdbms/public -I/opt/oracle/product/10g/db/rdbms/demo -I/opt/oracle/product/10g/db/rdbms/public -I/opt/oracle/product/10g/db/plsql/public -I/opt/oracle/product/10g/db/network/public -I/usr/lib/perl5/site_perl/5.8.5/i386-linux-thread-multi/auto/DBI -D_REENTRANT -D_GNU_SOURCE -DDEBUGGING -fno-strict-aliasing -pipe -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm -O2 -g -pipe -m32 -march=i386 -mtune=pentium4   -DVERSION=\"1.22\" -DXS_VERSION=\"1.22\" -fPIC "-I/usr/lib/perl5/5.8.5/i386-linux-thread-multi/CORE"  -Wall -Wno-comment -DUTF8_SUPPORT -DNEW_OCI_INIT -DORA_OCI_VERSION=\"10.2.0.1\" Oracle.c
gcc -c  -I/opt/oracle/product/10g/db/rdbms/public -I/opt/oracle/product/10g/db/rdbms/demo -I/opt/oracle/product/10g/db/rdbms/public -I/opt/oracle/product/10g/db/plsql/public -I/opt/oracle/product/10g/db/network/public -I/usr/lib/perl5/site_perl/5.8.5/i386-linux-thread-multi/auto/DBI -D_REENTRANT -D_GNU_SOURCE -DDEBUGGING -fno-strict-aliasing -pipe -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm -O2 -g -pipe -m32 -march=i386 -mtune=pentium4   -DVERSION=\"1.22\" -DXS_VERSION=\"1.22\" -fPIC "-I/usr/lib/perl5/5.8.5/i386-linux-thread-multi/CORE"  -Wall -Wno-comment -DUTF8_SUPPORT -DNEW_OCI_INIT -DORA_OCI_VERSION=\"10.2.0.1\" dbdimp.c
dbdimp.c: In function `ora_st_execute_array':
dbdimp.c:3328: warning: unused variable `sv2'
gcc -c  -I/opt/oracle/product/10g/db/rdbms/public -I/opt/oracle/product/10g/db/rdbms/demo -I/opt/oracle/product/10g/db/rdbms/public -I/opt/oracle/product/10g/db/plsql/public -I/opt/oracle/product/10g/db/network/public -I/usr/lib/perl5/site_perl/5.8.5/i386-linux-thread-multi/auto/DBI -D_REENTRANT -D_GNU_SOURCE -DDEBUGGING -fno-strict-aliasing -pipe -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm -O2 -g -pipe -m32 -march=i386 -mtune=pentium4   -DVERSION=\"1.22\" -DXS_VERSION=\"1.22\" -fPIC "-I/usr/lib/perl5/5.8.5/i386-linux-thread-multi/CORE"  -Wall -Wno-comment -DUTF8_SUPPORT -DNEW_OCI_INIT -DORA_OCI_VERSION=\"10.2.0.1\" oci8.c
Running Mkbootstrap for DBD::Oracle ()
chmod 644 Oracle.bs
rm -f blib/arch/auto/DBD/Oracle/Oracle.so
gcc  -shared -L/usr/local/lib Oracle.o dbdimp.o oci8.o -L/opt/oracle/product/10g/db/lib/ -L/opt/oracle/product/10g/db/rdbms/lib/   -lclntsh   `cat /opt/oracle/product/10g/db/lib/sysliblist` -ldl -lm   -o blib/arch/auto/DBD/Oracle/Oracle.so
chmod 755 blib/arch/auto/DBD/Oracle/Oracle.so
cp Oracle.bs blib/arch/auto/DBD/Oracle/Oracle.bs
chmod 644 blib/arch/auto/DBD/Oracle/Oracle.bs
/usr/bin/perl "-Iblib/arch" "-Iblib/lib" ora_explain.PL ora_explain
Extracted ora_explain from ora_explain.PL with variable substitutions.
cp ora_explain blib/script/ora_explain
/usr/bin/perl "-MExtUtils::MY" -e "MY->fixin(shift)" blib/script/ora_explain
Manifying blib/man1/ora_explain.1
Manifying blib/man3/DBD::Oracle.3pm
Manifying blib/man3/DBD::Oraperl.3pm
  /usr/bin/make  -- OK
Running make test
PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
t/01base................# Test loading DBI, DBD::Oracle and version
t/01base................ok
t/10general.............Can't locate object method "no_diag" via package "Test::Builder" at t/nchar_test_lib.pl line 53.
Compilation failed in require at t/10general.t line 12.
# Looks like your test died before it could output anything.
t/10general.............dubious
        Test returned status 9 (wstat 2304, 0x900)
t/12impdata.............Can't locate object method "no_diag" via package "Test::Builder" at t/nchar_test_lib.pl line 53.
Compilation failed in require at t/12impdata.t line 27.
# Looks like your test died before it could output anything.
t/12impdata.............dubious
        Test returned status 9 (wstat 2304, 0x900)
DIED. FAILED tests 1-7
        Failed 7/7 tests, 0.00% okay
t/14threads.............Can't locate object method "no_diag" via package "Test::Builder" at t/nchar_test_lib.pl line 53.
Compilation failed in require at t/14threads.t line 30.
# Looks like your test died before it could output anything.
t/14threads.............dubious
        Test returned status 9 (wstat 2304, 0x900)
DIED. FAILED tests 1-19
        Failed 19/19 tests, 0.00% okay
t/15nls.................Can't locate object method "no_diag" via package "Test::Builder" at t/nchar_test_lib.pl line 53.
Compilation failed in require at t/15nls.t line 9.
# Looks like your test died before it could output anything.
t/15nls.................dubious
        Test returned status 9 (wstat 2304, 0x900)
t/20select..............Can't locate object method "no_diag" via package "Test::Builder" at t/nchar_test_lib.pl line 53.
Compilation failed in require at t/20select.t line 10.
# Looks like your test died before it could output anything.
t/20select..............dubious
        Test returned status 9 (wstat 2304, 0x900)
t/21nchar...............Can't locate object method "no_diag" via package "Test::Builder" at t/nchar_test_lib.pl line 53.
Compilation failed in require at t/21nchar.t line 9.
# Looks like your test died before it could output anything.
t/21nchar...............dubious
        Test returned status 9 (wstat 2304, 0x900)
t/22nchar_al32utf8......Can't locate object method "no_diag" via package "Test::Builder" at t/nchar_test_lib.pl line 53.
Compilation failed in require at t/22nchar_al32utf8.t line 12.
# Looks like your test died before it could output anything.
t/22nchar_al32utf8......dubious
        Test returned status 9 (wstat 2304, 0x900)
t/22nchar_utf8..........Can't locate object method "no_diag" via package "Test::Builder" at t/nchar_test_lib.pl line 53.
Compilation failed in require at t/22nchar_utf8.t line 12.
# Looks like your test died before it could output anything.
t/22nchar_utf8..........dubious
        Test returned status 9 (wstat 2304, 0x900)
t/23wide_db.............Can't locate object method "no_diag" via package "Test::Builder" at t/nchar_test_lib.pl line 53.
Compilation failed in require at t/23wide_db.t line 12.
# Looks like your test died before it could output anything.
t/23wide_db.............dubious
        Test returned status 9 (wstat 2304, 0x900)
t/23wide_db_8bit........Can't locate object method "no_diag" via package "Test::Builder" at t/nchar_test_lib.pl line 53.
Compilation failed in require at t/23wide_db_8bit.t line 12.
# Looks like your test died before it could output anything.
t/23wide_db_8bit........dubious
        Test returned status 9 (wstat 2304, 0x900)
t/23wide_db_al32utf8....Can't locate object method "no_diag" via package "Test::Builder" at t/nchar_test_lib.pl line 53.
Compilation failed in require at t/23wide_db_al32utf8.t line 12.
# Looks like your test died before it could output anything.
t/23wide_db_al32utf8....dubious
        Test returned status 9 (wstat 2304, 0x900)
t/24implicit_utf8.......Can't locate object method "no_diag" via package "Test::Builder" at t/nchar_test_lib.pl line 53.
Compilation failed in require at t/24implicit_utf8.t line 9.
# Looks like your test died before it could output anything.
t/24implicit_utf8.......dubious
        Test returned status 9 (wstat 2304, 0x900)
t/25plsql...............Can't locate object method "no_diag" via package "Test::Builder" at t/nchar_test_lib.pl line 53.
Compilation failed in require at t/25plsql.t line 9.
# Looks like your test died before it could output anything.
t/25plsql...............dubious
        Test returned status 9 (wstat 2304, 0x900)
t/26exe_array...........ok 1/14Can't locate object method "no_diag" via package "Test::Builder" at t/nchar_test_lib.pl line 53.
Compilation failed in require at t/26exe_array.t line 9.
# Looks like you planned 14 tests but only ran 1.
# Looks like your test died just after 1.
t/26exe_array...........dubious
        Test returned status 255 (wstat 65280, 0xff00)
DIED. FAILED tests 2-14
        Failed 13/14 tests, 7.14% okay
t/28array_bind..........Can't locate object method "no_diag" via package "Test::Builder" at t/nchar_test_lib.pl line 53.
Compilation failed in require at t/28array_bind.t line 27.
# Looks like your test died before it could output anything.
t/28array_bind..........dubious
        Test returned status 9 (wstat 2304, 0x900)
DIED. FAILED tests 1-15
        Failed 15/15 tests, 0.00% okay
t/30long................Can't locate object method "no_diag" via package "Test::Builder" at t/nchar_test_lib.pl line 53.
Compilation failed in require at t/30long.t line 12.
# Looks like your test died before it could output anything.
t/30long................dubious
        Test returned status 9 (wstat 2304, 0x900)
t/31lob.................Can't locate object method "no_diag" via package "Test::Builder" at t/nchar_test_lib.pl line 53.
Compilation failed in require at t/31lob.t line 9.
# Looks like your test died before it could output anything.
t/31lob.................dubious
        Test returned status 9 (wstat 2304, 0x900)
DIED. FAILED tests 1-9
        Failed 9/9 tests, 0.00% okay
t/31lob_extended........Can't locate object method "no_diag" via package "Test::Builder" at t/nchar_test_lib.pl line 53.
Compilation failed in require at t/31lob_extended.t line 22.
# Looks like your test died before it could output anything.
t/31lob_extended........dubious
        Test returned status 9 (wstat 2304, 0x900)
t/32xmltype.............ok 1/4Can't locate object method "no_diag" via package "Test::Builder" at t/nchar_test_lib.pl line 53.
Compilation failed in require at t/32xmltype.t line 9.
# Looks like you planned 4 tests but only ran 1.
# Looks like your test died just after 1.
t/32xmltype.............dubious
        Test returned status 255 (wstat 65280, 0xff00)
DIED. FAILED tests 2-4
        Failed 3/4 tests, 25.00% okay
t/34pres_lobs...........Can't locate object method "no_diag" via package "Test::Builder" at t/nchar_test_lib.pl line 53.
Compilation failed in require at t/34pres_lobs.t line 22.
# Looks like your test died before it could output anything.
t/34pres_lobs...........dubious
        Test returned status 9 (wstat 2304, 0x900)
t/40ph_type.............Can't locate object method "no_diag" via package "Test::Builder" at t/nchar_test_lib.pl line 53.
Compilation failed in require at t/40ph_type.t line 10.
# Looks like your test died before it could output anything.
t/40ph_type.............dubious
        Test returned status 9 (wstat 2304, 0x900)
t/50cursor..............Can't locate object method "no_diag" via package "Test::Builder" at t/nchar_test_lib.pl line 53.
Compilation failed in require at t/50cursor.t line 9.
# Looks like your test died before it could output anything.
t/50cursor..............dubious
        Test returned status 9 (wstat 2304, 0x900)
t/51scroll..............ok 1/33Can't locate object method "no_diag" via package "Test::Builder" at t/nchar_test_lib.pl line 53.
Compilation failed in require at t/51scroll.t line 9.
# Looks like you planned 33 tests but only ran 1.
# Looks like your test died just after 1.
t/51scroll..............dubious
        Test returned status 255 (wstat 65280, 0xff00)
DIED. FAILED tests 2-33
        Failed 32/33 tests, 3.03% okay
t/55nested..............Can't locate object method "no_diag" via package "Test::Builder" at t/nchar_test_lib.pl line 53.
Compilation failed in require at t/55nested.t line 9.
# Looks like your test died before it could output anything.
t/55nested..............dubious
        Test returned status 9 (wstat 2304, 0x900)
t/56embbeded............ok 1/5Can't locate object method "no_diag" via package "Test::Builder" at t/nchar_test_lib.pl line 53.
Compilation failed in require at t/56embbeded.t line 9.
# Looks like you planned 5 tests but only ran 1.
# Looks like your test died just after 1.
t/56embbeded............dubious
        Test returned status 255 (wstat 65280, 0xff00)
DIED. FAILED tests 2-5
        Failed 4/5 tests, 20.00% okay
t/60reauth..............Can't locate object method "no_diag" via package "Test::Builder" at t/nchar_test_lib.pl line 53.
Compilation failed in require at t/60reauth.t line 6.
# Looks like your test died before it could output anything.
t/60reauth..............dubious
        Test returned status 9 (wstat 2304, 0x900)
t/70meta................Can't locate object method "no_diag" via package "Test::Builder" at t/nchar_test_lib.pl line 53.
Compilation failed in require at t/70meta.t line 9.
# Looks like your test died before it could output anything.
t/70meta................dubious
        Test returned status 9 (wstat 2304, 0x900)
t/80ora_charset.........Can't locate object method "no_diag" via package "Test::Builder" at t/nchar_test_lib.pl line 53.
Compilation failed in require at t/80ora_charset.t line 13.
# Looks like your test died before it could output anything.
t/80ora_charset.........dubious
        Test returned status 9 (wstat 2304, 0x900)
Failed Test            Stat Wstat Total Fail  Failed  List of Failed
-------------------------------------------------------------------------------
t/10general.t             9  2304    ??   ??       %  ??
t/12impdata.t             9  2304     7   14 200.00%  1-7
t/14threads.t             9  2304    19   38 200.00%  1-19
t/15nls.t                 9  2304    ??   ??       %  ??
t/20select.t              9  2304    ??   ??       %  ??
t/21nchar.t               9  2304    ??   ??       %  ??
t/22nchar_al32utf8.t      9  2304    ??   ??       %  ??
t/22nchar_utf8.t          9  2304    ??   ??       %  ??
t/23wide_db.t             9  2304    ??   ??       %  ??
t/23wide_db_8bit.t        9  2304    ??   ??       %  ??
t/23wide_db_al32utf8.t    9  2304    ??   ??       %  ??
t/24implicit_utf8.t       9  2304    ??   ??       %  ??
t/25plsql.t               9  2304    ??   ??       %  ??
t/26exe_array.t         255 65280    14   26 185.71%  2-14
t/28array_bind.t          9  2304    15   30 200.00%  1-15
t/30long.t                9  2304    ??   ??       %  ??
t/31lob.t                 9  2304     9   18 200.00%  1-9
t/31lob_extended.t        9  2304    ??   ??       %  ??
t/32xmltype.t           255 65280     4    6 150.00%  2-4
t/34pres_lobs.t           9  2304    ??   ??       %  ??
t/40ph_type.t             9  2304    ??   ??       %  ??
t/50cursor.t              9  2304    ??   ??       %  ??
t/51scroll.t            255 65280    33   64 193.94%  2-33
t/55nested.t              9  2304    ??   ??       %  ??
t/56embbeded.t          255 65280     5    8 160.00%  2-5
t/60reauth.t              9  2304    ??   ??       %  ??
t/70meta.t                9  2304    ??   ??       %  ??
t/80ora_charset.t         9  2304    ??   ??       %  ??
Failed 28/29 test scripts, 3.45% okay. 102/112 subtests failed, 8.93% okay.
make: *** [test_dynamic] Error 9
  /usr/bin/make test -- NOT OK
0
 
Adam314Commented:
It looks like a problem with Test::Builder.  Try installing it first, then try installing DBD::Oracle again.

If that doesn't work, try this:
    at a prompt, type cpan
    at the cpan prompt, type force install DBD::Oracle
This will cause it to install even with some tests failing.
0
 
Extreme66Author Commented:
Tried this as well, but same errors, found a workaround using sqlplus for the time being.
0
 
Deepak KosarajuDevOps EngineerCommented:
Export Oracle LIB path as below
export LD_LIBRARY_PATH=$ORACLE_HOME/lib ## Provided ORACLE_HOME is defined.
(or)
export LD_LIBRARY_PATH=/usr/lib/oracle/xe/app/oracle/product/10.2.0/server/lib/

copy this to user .bash_profile to make it only for that user, its u like this to be global then copy the above to /etc/profile

0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Microsoft Windows 7 Basic

This introductory course to Windows 7 environment will teach you about working with the Windows operating system. You will learn about basic functions including start menu; the desktop; managing files, folders, and libraries.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now