Shendal has asked for the wisdom of the Perl Monks concerning the following question:
I'm having trouble with DBI and DBD::Oracle. I think that it has to do with setting of the LD_LIBRARY_PATH variable, so that DBI can dynamically load what it needs to access the Oracle database.
First, my initial code:
This file, is indeed in $LD_LIBRARY_PATH/libclntsh.so.8.0. As evidence, if I set LD_LIBRARY_PATH in my shell before executing this script, it works fine. That led me to try this with a BEGIN block:
Anyone know what I'm doing wrong?
Thanks,
Shendal
First, my initial code:
This fails with the following error:use DBI; $ENV{ORACLE_HOME} = '/common/oracle/product/v8.1.6'; $ENV{LD_LIBRARY_PATH} = "$ENV{ORACLE_HOME}/lib"; $ENV{TNS_ADMIN} = '/common/oracle/env'; $dbh = DBI->connect('','scmuser/scmuser@itopstst','','Oracle'); die $DBI::errstr unless defined $dbh;
install_driver(Oracle) failed: Can't load '/app/eol/perl/lib/site_perl +/5.005/sun4-solaris/auto/DBD/Oracle/Oracle.so' for module DBD::Oracle +: ld.so.1: /app/eol/perl/bin/perl: fatal: libclntsh.so.8.0: open fail +ed: No such file or directory at /app/eol/perl/lib/5.00503/sun4-solar +is/DynaLoader.pm line 169. at (eval 1) line 3 at ./tst line 15
This file, is indeed in $LD_LIBRARY_PATH/libclntsh.so.8.0. As evidence, if I set LD_LIBRARY_PATH in my shell before executing this script, it works fine. That led me to try this with a BEGIN block:
...which still doesn't work.BEGIN { $ENV{ORACLE_HOME} = '/common/oracle/product/v8.1.6'; $ENV{LD_LIBRARY_PATH} = "$ENV{ORACLE_HOME}/lib"; $ENV{TNS_ADMIN} = '/common/oracle/env'; } use DBI; $dbh = DBI->connect('','scmuser/scmuser@itopstst','','Oracle'); die $DBI::errstr unless defined $dbh;
Anyone know what I'm doing wrong?
Thanks,
Shendal
|
---|
Back to
Seekers of Perl Wisdom