This isn't really a DBI problem, but it hit me with DBD::Oracle, so it
may be helpful for some of you (unless I've missed something obvious, in
which case I'll just confuse everybody):

For a long time I've used a construct like this:

    if (open(E, "$offl_root/dbi/env")) {
        printlog("reading environment from $offl_root/dbi/env");
        while (<E>) {
            chomp;
            my ($k, $v) = split(/=/);
            $ENV{$k} = $v;
            printlog("setting $k=$v");
        }
    }

    my $dbh;
    $dbh = DBI->connect($data_source, $username, $auth,
                        { AutoCommit => 0,
                          PrintError => 1, 
                          RaiseError => 1
                        }
                       );

to set up a suitable environment (ORACLE_HOME, NLS_LANG,
LD_LIBRARY_PATH, ...) before connecting to the database. I was aware
that this wasn't completely portable (doesn't work on Solaris), but it
worked on HP-UX and i386 Linux, and I sort of assumed that it would work
on other Linux platforms, too.

I was naive. It doesn't work on x86_64 Linux (at least not 2.6.18).
A change to LD_LIBRARY_PATH after program startup seems to be  ignored
and consequently libclntsh.so.10.1 isn't found. If I set LD_LIBRARY_PATH
before invoking the perl script it works, so the workaround is obvious,
but it's ugly.

Have others noticed the same thing? Does anyone know why x86_64 differs
from i386 Linux in this regard?

        hp

-- 
   _  | Peter J. Holzer    | Auf jedem Computer sollte der Satz Ludwigs II
|_|_) | Sysadmin WSR       | eingeprägt stehen: "Ein ewig Rätsel will ich
| |   | [email protected]      | bleiben, mir und andern."
__/   | http://www.hjp.at/ |    -- Wolfram Heinrich in desd

Attachment: pgp6iZ40yiWYm.pgp
Description: PGP signature

Reply via email to