We need to set these 2 environment variables from Perl:
$ENV{DB2INSTANCE} = 'db2inst3';
$ENV{LD_LIBRARY_PATH} = '/export/home/db2inst3/sqllib/lib';
We even tried enclosing them in a BEGIN block, but we're getting:
install_driver(DB2) failed: Can't load
'/usr/iw-home/iw-perl/site/lib/auto/DBD/DB2/DB2.so' for module DBD:DB2:
ld.so.1: /usr/iw-home/iw-perl/bin/perl: fatal: libdb2.so.1: open failed: No
such file or directory at /usr/iw-home/iw-perl/lib/DynaLoader.pm line 229.
at (eval 6) line 3
Compilation failed in require at (eval 6) line 3.
Perhaps a required shared library or dll isn't installed where expected
at /usr/iw-home/custom/lib/dbAccess.pm line 62
In dbAccess.pm. just before issuing DBI->connect, we've added some logging
information, which shows:
key: |LD_LIBRARY_PATH| value: |/export/home/db2inst3/sqllib/lib|
key: |DB2INSTANCE| value: |db2inst3|
Issuing LD_LIBRARY_PATH=/export/home/db2inst3/sqllib/lib from the command
line results in the same error (at least some of the time), but the log
shows that LD_LIBRARY_PATH is correctly set.
However, issuing export LD_LIBRARY_PATH=/export/home/db2inst3/sqllib/lib
from the command line and running our test script works every time. So how
do we export those environment variables from Perl?
Incidentally, last week the following was causing trouble:
$ENV{'DB2INSTANCE'} = 'db2inst3';
$ENV{'LD_LIBRARY_PATH'} = '/export/home/db2inst3/sqllib/lib';
Note the single-quotes on the left side. Removing them worked (last week).
But not today. Double-quotes or no quotes ain't making a difference.
Looks like things stopped working without any changes to the Perl code. The
PATH changed, I think, but setting it to nothing didn't help. Incidentally,
which binary should be referring to LD_LIBRARY_PATH and loading libdb2.so.1?
Although, why would simply exporting LD_LIBRARY_PATH from the command line
make our test script work?
Any ideas?
Thanks,
S.
regards,
Renée
Am 30.09.2005 um 04:49 Uhr haben Sie geschrieben:
However, issuing export LD_LIBRARY_PATH=/export/home/db2inst3/sqllib/lib
Any ideas?
Thanks,
S.
This electronic message transmission is a PRIVATE communication which contains
information which may be confidential or privileged. The information is intended
to be for the use of the individual or entity named above. If you are not the
intended recipient, please be aware that any disclosure, copying, distribution
or use of the contents of this information is prohibited. Please notify the
sender of the delivery error by replying to this message, or notify us by
telephone (877-633-2436, ext. 0), and then delete it from your system.
My apologies.
LD_LIBRARY_PATH needs to be set before the process starts.
Tim.