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

Hi,

I am in a bit of a bind here, any help is appreciated.
Basically it goes like this:

I installed DBI on my HP-UX 11.0 system with no problems. DBD was a bit more complicated. After setting all the env variables, I was able to get DBD up by:

perl Makefile.PL LINKTYPE=static
And here is the part that gets me...
The make test works fine, and I've written a few hundred DBI scripts, but I keep getting the following error when I try to connect using the exact syntax from the test.pl script (error):

install_driver(Oracle) failed: Can't locate loadable object for module DBD::Orac le in @INC (@INC contains: /usr/local/lib/perl5/5.00503/PA-RISC1.1 /usr/local/li b/perl5/5.00503 /usr/local/lib/perl5/site_perl/5.005/PA-RISC1.1 /usr/local/lib/p erl5/site_perl/5.005 .) at (eval 1) line 3 Perhaps a module that DBD::Oracle requires hasn't been fully installed at ./connect.pl line 5

This is my script, even the basics don't work here:
#!/usr/local/bin/perl
use DBI;
$dbh = DBI->connect("dbi:Oracle:hostname=myhostnamehere;sid=mysidhere", usernamehere, 'passwordhere', { RaiseError => 1 });
$dbh->disconnect();

The DB I am trying to connect to accepts connections on port 1521(for Oracle, it tries 1526, and then 1521) and I am having no luck.

Has anyone had this happen? If anyone has suggestions or has had any success connecting to an Oracle DB via DBI on HP-UX 11, I would appreciate your insight.

Thanks, and take care,
Frank

Replies are listed 'Best First'.
Re: DBI Connect HP-UX Oracle
by chipmunk (Parson) on Feb 15, 2001 at 20:28 UTC
    Look under the site_perl directory for the extra DBD::Oracle files, and make sure they're world-readable.

    This might help you find them: find /usr/local/lib/perl5/site_perl -path '*/DBD/Oracle*'

      Thanks for the help!
      The problem turned out to be us not using the new perl binary after make perl.

      DOH!
      Thanks again,
      Frank
Re: DBI Connect HP-UX Oracle
by mikfire (Deacon) on Feb 15, 2001 at 20:45 UTC
    I might suggest rebuilding DBI with the same flag ( LINKTYPE=static ). install_driver is called from DBI.pm and the error message seems to imply it is looking for a shared module. DBI needs to be told that you linked statically.

    mikfire

Re: DBI Connect HP-UX Oracle
by BigJoe (Curate) on Feb 15, 2001 at 21:13 UTC
    To fix this error I type
    export LD_LIBRARY_PATH=$ORACLE_HOME/lib
    You will also want to put this in your /etc/profile file. And put SetEnv LD_LIBRARY_PATH=$ORACLE_HOME/lib in you httpd.conf

    --BigJoe

    Learn patience, you must.
    Young PerlMonk, craves Not these things.
    Use the source Luke.
      FYI, that solution actually solves a similar problem, the one evidenced by this error:
      install_driver(Oracle) failed: Can't load '/usr/local/lib/perl5/site_perl/5.005/i386-linux/auto/DBD/Oracle/Oracl +e.so' for module DBD::Oracle: ld.so.1:/usr/local/bin/perl: fatal: libclntsh.so.8.0: open failed: No such file or directory at /usr/local/lib/perl5/5.00503/i86pc-solaris-thread/DynaLoader.pm line 169.
      This error occurs when all the DBD::Oracle files are found, but the main Oracle libraries aren't. In the original poster's case the DBD::Oracle files weren't found (this problem actually isn't as common, though).