Hello Members,
I have installed DBD::Oracle from CPAN, following is the o/p of the "perl makefile"......
++++++++++++++++++++++++++++
Using DBI 1.633 (for perl 5.020002 on x86_64-linux-thread-multi) insta
+lled in /opt/perl/ActivePerl-5.20/lib/auto/DBI/
Configuring DBD::Oracle for perl 5.020002 on linux (x86_64-linux-threa
+d-multi)
Remember to actually *READ* the README file! Especially if you have an
+y problems.
Trying to find an ORACLE_HOME
Your LD_LIBRARY_PATH env var is set to '/u01/app/oracle/product/11.2.0
+/xe/lib'
Found /u01/app/oracle/product/11.2.0/xe
WARNING: Setting ORACLE_HOME env var to /u01/app/oracle/product/11.2.0
+/xe for you.
WARNING: If these tests fail you may have to set ORACLE_HOME yourself!
Installing on a linux, Ver#3.2
Using Oracle in /u01/app/oracle/product/11.2.0/xe
DEFINE _SQLPLUS_RELEASE = "1102000200" (CHAR)
Oracle version 11.2.0.2 (11.2)
Found /u01/app/oracle/product/11.2.0/xe/rdbms/demo/demo_xe.mk
Using /u01/app/oracle/product/11.2.0/xe/rdbms/demo/demo_xe.mk
Looks like Oracle XE (/u01/app/oracle/product/11.2.0/xe/rdbms/demo/dem
+o_xe.mk)
Reading /u01/app/oracle/product/11.2.0/xe/rdbms/demo/demo_xe.mk
Your LD_LIBRARY_PATH env var is set to '/u01/app/oracle/product/11.2.0
+/xe/lib'
client_version=11.2
DEFINE= -Wall -Wno-comment -DUTF8_SUPPORT -DORA_OCI_VERSION=\"11.2.0.2
+\" -DORA_OCI_102 -DORA_OCI_112
Checking for functioning wait.ph
System: perl5.020002 linux perl-stackato64-precise 3.2.0-24-virtual #3
+9-ubuntu smp mon may 21 18:44:18 utc 2012 x86_64 x86_64 x86_64 gnulin
+ux
Compiler: gcc -O2 -D_REENTRANT -D_GNU_SOURCE -DUSE_SITECUSTOMIZE -DP
+ERL_RELOCATABLE_INCPUSH -fno-merge-constants -fwrapv -fno-strict-alia
+sing -pipe -fstack-protector -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=
+64
Linker: not found
Sysliblist: -ldl -lm -lpthread -lnsl -lirc
Oracle makefiles would have used these definitions but we override the
+m:
CC: /usr/bin/gcc
LDFLAGS: -g
[-g]
Linking with -L/u01/app/oracle/product/11.2.0/xe/lib/ -lclntsh -lpthre
+ad
Warning (mostly harmless): No library found for -lpthread
LD_RUN_PATH=/u01/app/oracle/product/11.2.0/xe/lib
Using DBD::Oracle 1.74.
Using DBD::Oracle 1.74.
Using DBI 1.633 (for perl 5.020002 on x86_64-linux-thread-multi) insta
+lled in /opt/perl/ActivePerl-5.20/lib/auto/DBI/
Generating a Unix-style Makefile
Writing Makefile for DBD::Oracle
Writing MYMETA.yml and MYMETA.json
++++++++++++++++++++++++++++++++++++
Following is the output of "perl dbi.pl"
-----------------------------------
perl dbi.pl
Uncaught exception from user code:
install_driver(Oracle) failed: Can't load '/opt/perl/ActivePer
+l-5.20/lib/auto/DBD/Oracle/Oracle.so' for module DBD::Oracle: libclnt
+sh.so.12.1: cannot open shared object file: No such file or directory
+ at /opt/perl/ActivePerl-5.20/lib/DynaLoader.pm line 194.
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 dbi.pl line 8.
DBI::install_driver("DBI", "Oracle") called at /opt/perl/Activ
+ePerl-5.20/lib/DBI.pm line 662
DBI::connect("DBI", "dbi:Oracle:host=192.168.0.10", undef, und
+ef) called at dbi.pl line 8
------------------------------------
Following is the code
----------------------
----------------------
1 use DBI;
2 use diagnostics;
3 use strict;
4 #use DBD::Oracle;
5
6 my($dbh,$dbuser,$dbpass,$SEL,$sth,$db);
7
8 $dbh = DBI->connect("dbi:Oracle:host=192.168.0.10", $dbuser, $
+dbpass)|| die "$!";
9
10 $db->{AutoCommit} = 0;
11
12 $db->{RaiseError} = 1;
13
14 $db->{ora_check_sql} = 0;
15
16 $db->{RowCacheSize} = 16;
17
18 $SEL = "SELECT * FROM HR";
19 $sth = $db->prepare($SEL);
20 $sth->execute();
21
22 while ( my @row = $sth->fetchrow_array() ) {
23 foreach (@row) {
24 $_ = "\t" if !defined($_);
25 print "$_\t";
+++++++++++++++++++++++++++++++++++++++++++++++++++
ls -l | grep -i libclntsh.so
lrwxrwxrwx. 1 oracle dba 17 Sep 25 23:00 libclntsh.so -> libclnt
+sh.so.11.1
-rwxr-xr-x. 1 oracle dba 41051464 Aug 29 2011 libclntsh.so.11.1
[root@localhost lib]# pwd
/u01/app/oracle/product/11.2.0/xe/lib
+++++++++++++++++++++++++++++++++++++++++++++++++++
What I see is the library file is present, but the version mismatch is observed.
Any other suggestion would be highly appreciated.
Regards,
Amitesh