Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Getting the below error but when I do a
cpan> install DBD::Oracle
DBD::Oracle is up to date.

it says it is up to date? any ideas?

$./bal_batch.rc install_driver(Oracle) failed: Can't load'/usr/local/lib/perl5/site_pe +rl/5.8.0/sun4-solaris/auto/DBD/Oracle/Oracle.so' for module DBD::Orac +le: ld.so.1: /usr/local/bin/perl: fatal: libclntsh.so.1.0: open faile +d: No such file or directory at /usr/local/lib/perl5/5.8.0/sun4-solar +is/DynaLoader.pm line 229. 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 expecte +d at /usr/local/lib/perl5/site_perl/5.8.0/sun4-solaris/Oraperl.pm line +58 Compilation failed in require at /opt/phsupport/lib/AIM_Oracle.pm line + 22. BEGIN failed--compilation aborted at /opt/phsupport/lib/AIM_Oracle.pm +line 22. Compilation failed in require at /opt/phsupport/lib/AIM_Phoenix.pm lin +e 36. BEGIN failed--compilation aborted at /opt/phsupport/lib/AIM_Phoenix.pm + line 36. Compilation failed in require at /opt/phsupport/bin/aimsql-simple.pl l +ine 39. BEGIN failed--compilation aborted at /opt/phsupport/bin/aimsql-simple. +pl line 39. -Process returned 1 -ERROR- bal batch failed

Replies are listed 'Best First'.
Re: Oracle DBD problem
by vek (Prior) on Aug 26, 2003 at 03:50 UTC

    Make sure /usr/local/lib is in your LD_LIBRARY_PATH.

    -- vek --
Re: Oracle DBD problem
by mr_sparkle (Scribe) on Aug 26, 2003 at 12:31 UTC
    this might seem pretty obvious, but do you have the oracle client libraries installed?
Re: Oracle DBD problem
by sgifford (Prior) on Aug 25, 2003 at 21:19 UTC
    The error says that the file /usr/local/lib/perl5/site_perl/5.8.0/sun4-solaris/auto/DBD/Oracle/Oracle.so is missing. Is that file there?
      Not quite.
      It says that it can't load the Oracle.so file because it can't load libclntsh.so.1.0, so that seems to be the missing file.
      A search on google.com for libclntsh.so gave me some interesting links.
Re: Oracle DBD problem
by kennethwlangley (Novice) on Aug 26, 2003 at 17:53 UTC
    Check these things:
    1. Are the environment variables for ORACLE_HOME set to the Oracle install directory and either LD_LIBRARY_PATH or LD_RUNPATH set to the Oracle library directory for your script's execution? You might see a line like:
      $ENV{ORACLE_HOME} = /whatever;
      in a script.
    2. If so can you run the interactive sql client?
        Ken
Re: Oracle DBD problem
by LameNerd (Hermit) on Aug 25, 2003 at 20:45 UTC
    hmm ... what perl version are you running? I think you need to be running 5.6 atleast.
Re: Oracle DBD problem
by jmanning2k (Pilgrim) on Aug 26, 2003 at 17:07 UTC
    If you do have the libraries installed, try the following:

    (For gnu libc based systems - as root:)

    ldconfig
    or

    Force a re-build and re-install:

    cpan> force install DBD::Oracle
    (If your problem is elsewhere, forcing it to rebuild may cause more problems.)
Re: Oracle DBD problem
by hmerrill (Friar) on Aug 27, 2003 at 13:29 UTC
    Take this with a grain of salt since it's been a few years since I've worked with Oracle. Here's what I remember:
    1. add an entry similar to this to /etc/ld.so.conf /path/to/oracle/home 2. run 'ldconfig' Note: 1 & 2 should solve your .so error. 3. this is what we did in each perl script that accessed Oracle: #!/usr/bin/perl -w BEGIN { $ENV{ORACLE_HOME} = "/path/to/oracle/home"; } ### the rest of your script goes here ###
    HTH.