3 Replies Latest reply: Aug 13, 2012 9:57 AM by Catch-22 RSS

    How to user Perl DBD to connect to Oracle

    AliD
      Hi,

      Someone from dev team asked me the question and I don't know anything about Perl. What I've done is to install the Oracle instant client 11g and our sysadmin installed latest DBD and DBI. I set LD_LIBRARY_PATH and ORACLE_HOME and created libclntsh.so link but somehow it is pointing to 10g libraries:
      [root@server lib]#  ll /usr/lib/oracle/11.1/client64/lib/
      total 147028
      -rw-r--r-- 1 root root      342 Nov 25  2008 glogin.sql
      lrwxrwxrwx 1 root root       17 Aug  9 11:44 libclntsh.so -> libclntsh.so.11.1
      -rw-r--r-- 1 root root 48166196 Nov 25  2008 libclntsh.so.11.1
      -rw-r--r-- 1 root root  8387704 Nov 25  2008 libnnz11.so
      -rw-r--r-- 1 root root  1632955 Nov 25  2008 libocci.so.11.1
      -rw-r--r-- 1 root root 85117504 Nov 25  2008 libociei.so
      -rw-r--r-- 1 root root   179678 Nov 25  2008 libocijdbc11.so
      -rw-r--r-- 1 root root  1512505 Nov 25  2008 libsqlplusic.so
      -rw-r--r-- 1 root root  1481762 Nov 25  2008 libsqlplus.so
      -rw-r--r-- 1 root root  1889756 Nov 25  2008 ojdbc5.jar
      -rw-r--r-- 1 root root  1987741 Nov 25  2008 ojdbc6.jar
      
      [root@server lib]# perl -e 'use DBD::Oracle; print $DBD::Oracle::VERSION,"\n";'
      Can't load '/usr/lib64/perl5/vendor_perl/5.8.8/x86_64-linux-thread-multi/auto/DBD/Oracle/Oracle.so' for module DBD::Oracle: libclntsh.so.10.1: cannot open shared object file: No such file or directory at /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/DynaLoader.pm line 230.
      at -e line 1
      Compilation failed in require at -e line 1.
      BEGIN failed--compilation aborted at -e line 1.
      Can anyone help me with the setup please?