in reply to Can't load '/soft/perl-5.10.1/lib/site_perl/5.10.1/x86_64-linux-thread-multi/auto/DBD/Oracle/Oracle.so'

I think the problem is not with Oracle.so but that Oracle.so loads other .so files, which might load more .so files, and one of them is libclntsh.so.11.1, and that file is not found (or not in $ENV{LD_LIBRARY_PATH}).

You could try looking at the output of ld Oracle.so and maybe that lists which files need to be present/readable for it to load.

  • Comment on Re: Can't load '/soft/perl-5.10.1/lib/site_perl/5.10.1/x86_64-linux-thread-multi/auto/DBD/Oracle/Oracle.so'
  • Select or Download Code

Replies are listed 'Best First'.
Re^2: Can't load '/soft/perl-5.10.1/lib/site_perl/5.10.1/x86_64-linux-thread-multi/auto/DBD/Oracle/Oracle.so'
by jmacloue (Beadle) on Feb 06, 2015 at 12:53 UTC

    Not ld Oracle.so but ldd Oracle.so, otherwise you're right.

Re^2: Can't load '/soft/perl-5.10.1/lib/site_perl/5.10.1/x86_64-linux-thread-multi/auto/DBD/Oracle/Oracle.so'
by luxAeterna (Acolyte) on Feb 06, 2015 at 16:20 UTC

    Much to my dismay, you are completely right

    The problem is, I don't have an Oracle client installed in the machine. It is a server that has to communicate with a Data Base in a remote machine

    The script was supposed to be ran in the server precisely to perform a simple query to a remote database and check that the connectivity is OK

    I ran a:

    $ ldd /soft/perl-5.10.1/bin/perl verify_database_connection.pl

    To check which libraries and modules the script needs to load and where it is trying to look for them, and got:

    open("/soft/ora1120/db/lib/tls/x86_64/libclntsh.so.11.1", O_RDONLY) = +-1 ENOENT (No such file or directory) stat("/soft/ora1120/db/lib/tls/x86_64", 0x7fff4406c740) = -1 ENOENT (N +o such file or directory) open("/soft/ora1120/db/lib/tls/libclntsh.so.11.1", O_RDONLY) = -1 ENOE +NT (No such file or directory) stat("/soft/ora1120/db/lib/tls", 0x7fff4406c740) = -1 ENOENT (No such +file or directory) open("/soft/ora1120/db/lib/x86_64/libclntsh.so.11.1", O_RDONLY) = -1 E +NOENT (No such file or directory) stat("/soft/ora1120/db/lib/x86_64", 0x7fff4406c740) = -1 ENOENT (No su +ch file or directory) open("/soft/ora1120/db/lib/libclntsh.so.11.1", O_RDONLY) = -1 ENOENT ( +No such file or directory) stat("/soft/ora1120/db/lib", 0x7fff4406c740) = -1 ENOENT (No such file + or directory) open("/etc/ld.so.cache", O_RDONLY) = 5 fstat(5, {st_mode=S_IFREG|0644, st_size=53762, ...}) = 0 mmap(NULL, 53762, PROT_READ, MAP_PRIVATE, 5, 0) = 0x7f012034a000 close(5) = 0 open("/lib64/tls/x86_64/libclntsh.so.11.1", O_RDONLY) = -1 ENOENT (No +such file or directory) stat("/lib64/tls/x86_64", 0x7fff4406c740) = -1 ENOENT (No such file or + directory) open("/lib64/tls/libclntsh.so.11.1", O_RDONLY) = -1 ENOENT (No such fi +le or directory) stat("/lib64/tls", 0x7fff4406c740) = -1 ENOENT (No such file or d +irectory) open("/lib64/x86_64/libclntsh.so.11.1", O_RDONLY) = -1 ENOENT (No such + file or directory) stat("/lib64/x86_64", 0x7fff4406c740) = -1 ENOENT (No such file or d +irectory) open("/lib64/libclntsh.so.11.1", O_RDONLY) = -1 ENOENT (No such file o +r directory) stat("/lib64", {st_mode=S_IFDIR|0755, st_size=12288, ...}) = 0 open("/usr/lib64/tls/x86_64/libclntsh.so.11.1", O_RDONLY) = -1 ENOENT +(No such file or directory) stat("/usr/lib64/tls/x86_64", 0x7fff4406c740) = -1 ENOENT (No such fil +e or directory) open("/usr/lib64/tls/libclntsh.so.11.1", O_RDONLY) = -1 ENOENT (No suc +h file or directory) stat("/usr/lib64/tls", 0x7fff4406c740) = -1 ENOENT (No such file or d +irectory) open("/usr/lib64/x86_64/libclntsh.so.11.1", O_RDONLY) = -1 ENOENT (No +such file or directory) stat("/usr/lib64/x86_64", 0x7fff4406c740) = -1 ENOENT (No such file or + directory) open("/usr/lib64/libclntsh.so.11.1", O_RDONLY) = -1 ENOENT (No such fi +le or directory)

    The machine where the connection to the Oracle database works does have the libclntsh.so.11.1 module in

    $ ls -ltr /soft/ora1020/lib | grep libclntsh.so.11.1

    lrwxrwxrwx 1 root sys 17 Aug 20 2012 libclntsh.so.11.1 -> libclntsh.so.10.1

    Then I copied the module from the remote machine to a local folder in my machine and edited the start as:

    MYORACLELIBS=/pathtothefolder ; export MYORACLELIBS LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${MYORACLELIBS} ; export LD_LIBRARY_P +ATH

    I still located one more Oracle module it needed to compile

    Unluckily, once it compiled, it failed, because it needs an Oracle client installed. My code:

    use strict; use warnings; use DBD::Oracle; use DBI; my $dbh = DBI->connect("dbi:Oracle://$host:1522:$db",$dbUser, $dbPass) + or die;

    It died with the error

    DBI connect('//yval1bk0:1522:RUM','DYNATRACE',...) failed: ERROR OCIEnvNlsCreate. Check ORACLE_HOME (Linux) env var  or PATH (Windows) and or NLS settings, permissions, etc. at /users/rum00/exploit/script/rum_verify_database_connection.pl line 44

    I am not going to request the extra installation of an oracle client in a server that does not host any database

    So I'll continue with my research but I'm afraid I will have to use the existing .jar to do this verification, instead of my adored Perl :)

      I am not going to request the extra installation of an oracle client in a server that does not host any database

      That is exactly the kind of machine that needs a client ... and its exactly what DBD::Oracle needs ... how did you install DBD::Oracle without having a client installed? Thats impossible you know :) Maybe you should just find the already installed client and adjust your LD_LIBRARY_PATH or ... so that DBD/Oracle.so can find it

      You likely don't need a full fledged client install, but can get away with an instant client instead