Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.

DBD::Oracle install

by rider754 (Novice)
on Jul 17, 2013 at 22:44 UTC ( [id://1044919]=perlquestion: print w/replies, xml ) Need Help??

rider754 has asked for the wisdom of the Perl Monks concerning the following question:

Hello monks,

It seems there are some intricacies surrounding the installation of DBD::Oracle. I was hoping you can help clarify some questions of mine and help me troubleshoot the installation issue.

I am trying to install DBD::Oracle 1.58 (for Perl 5.8.8) on Linux RHEL 5.7 x86_64. Through trial and error installing through CPAN, the following environment variables were set:

ORACLE_HOME=/opt/oracleas/product/11.2.0/client_1 LD_LIBRARY_PATH=$ORACLE_HOME/lib

Then, we start encountering error messages around the tests. Two of the errors are:

t/00versions..................Can't load '/home/root/.cpan/build/DBD-O +racle-1.58/blib/arch/auto/DBD/Oracle/' for module DBD::Oracl +e: cannot open shared object file: No such file or + directory at /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/DynaLo line 230. at t/00versions.t line 10 String found where operator expected at t/ line 459, +near "note "set \$ENV{NLS_LANG='$ENV{NLS_LANG}'"" (Do you need to predeclare note?)
We've next tried to set NLS_LANG=AMERICAN_AMERICA.US7ASCII (the previous value on our Solaris box). But the error persists.

I ran locate and it turned up two locations
lrwxrwxrwx 1 weblogic weblogic /opt/oracleas/product/11.2.0/client_1/ +instantclient/ -rwxr-xr-x 1 weblogic weblogic /opt/oracleas/product/11.2.0/client_1/ +lib/

Update: It doesn't make sense to me why LD_LIBRARY_PATH is not picked up by the build

Installing on a linux, Ver#2.6 Using Oracle in /opt/oracleas/product/11.2.0/client_1 DEFINE _SQLPLUS_RELEASE = "1102000100" (CHAR) Oracle version (11.2) Found /opt/oracleas/product/11.2.0/client_1/rdbms/lib/ Using /opt/oracleas/product/11.2.0/client_1/rdbms/lib/ Your LD_LIBRARY_PATH env var is set to '' WARNING: Your LD_LIBRARY_PATH env var doesn't include '/opt/oracleas/p +roduct/11.2.0/client_1/lib' but probably needs to. Reading /opt/oracleas/product/11.2.0/client_1/rdbms/lib/ Reading /opt/oracleas/product/11.2.0/client_1/rdbms/lib/ WARNING: Oracle /opt/oracleas/product/11.2.0/client_1/rdbms/lib/ins_rd doesn't define a 'build' rule. WARNING: I will now try to guess how to build and link DBD::Oracle for + you. This kind of guess work is very error prone and Oracle-versio +n sensitive. It is possible that it won't be supported in future versions +of DBD::Oracle. *PLEASE* notify dbi-users about exactly _why_ you had to buil +d it this way. Found header files in /opt/oracleas/product/11.2.0/client_1/rdbms/publ +ic. client_version=11.2 DEFINE= -Wall -Wno-comment -DUTF8_SUPPORT -DORA_OCI_VERSION=\" +\" -DORA_OCI_102 -DORA_OCI_112 Checking for functioning System: perl5.008008 linux 2.6.18-194.26. +1.el5 #1 smp fri oct 29 14:21:16 edt 2010 x86_64 x86_64 x86_64 gnulin +ux Compiler: gcc -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexception +s -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_ +REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -pipe -Wdeclaration-afte +r-statement -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_B +ITS=64 -I/usr/include/gdbm Linker: /usr/bin/ld Sysliblist: -ldl -lm -lpthread -lnsl -lirc -lipgo -lsvml Oracle makefiles would have used these definitions but we override the +m: CC: $(COMPDIR)/bin/gcc CFLAGS: $(GFLAG) $(OPTIMIZE) $(CDEBUG) $(CCFLAGS) $(PFLAGS)\ $(SHARED_CFLAG) $(USRFLAGS) [$(GFLAG) -O3 $(CDEBUG) -m32 -trigraphs -fPIC -I/opt/oracle +as/product/11.2.0/client_1/rdbms/demo -I/opt/oracleas/product/11.2.0/ +client_1/rdbms/public -I/opt/oracleas/product/11.2.0/client_1/plsql/p +ublic -I/opt/oracleas/product/11.2.0/client_1/network/public -DLINUX +-D_GNU_SOURCE -D_LARGEFILE64_SOURCE=1 -D_LARGEFILE_SOURCE=1 -DSLTS_EN +ABLE -DSLMXMX_ENABLE -D_REENTRANT -DNS_THREADS -D__NO_CTYPE=1 -DLDAP_ +CM $(LPFLAGS) $(PLSQLNCGFLAGS) $(USRFLAGS)] LDFLAGS: $(LDFLAGS32) [-m32 -o $@ -L/opt/oracleas/product/11.2.0/client_1/rdbms// +lib32/ -L/opt/oracleas/product/11.2.0/client_1/lib32/ -L/opt/oracleas +/product/11.2.0/client_1/lib32/stubs/] Linking with -lclntsh -ldl -lm -lpthread -lnsl -lirc -lipgo -lsvml -l +dl -lm -lpthread [from $(OCISHAREDLIBS)] WARNING: META_MERGE is not a known parameter. Checking if your kit is complete... Looks good 'META_MERGE' is not a known MakeMaker parameter name. LD_RUN_PATH=/opt/oracleas/product/11.2.0/client_1/lib Using DBD::Oracle 1.58. Using DBD::Oracle 1.58. Using DBI 1.52 (for perl 5.008008 on x86_64-linux-thread-multi) instal +led in /usr/lib64/perl5/vendor_perl/5.8.8/x86_64-linux-thread-multi/a +uto/DBI/ Writing Makefile for DBD::Oracle *** If you have problems... read all the log printed above, and the README and +t files. (Of course, you have read README by now anyway, haven't you?)

My questions are:

  1. Why is LD_LIBRARY_PATH not picked up by the CPAN install?
  2. Why is the error with happening? Is it a permissions issue for or (We are running as root, why would permissions matter?)
  3. What is this issue with NLS_LANG and how should I go about fixing it?
  4. Are there other variables I need to set? (ex: TNS_ADMIN)
  5. There is a WebLogic installation here, and the LD_LIBRARY_PATH has many more locations than the one we used here for root. Does that matter?
  6. There seems to be some notion around not pointing to the actual Oracle instance, because Perl can change some settings(?), and it should point to a client instead. (I think I've done that?) But can this be explained in more detail on why or what happens?

Update #2 Hope this helps some other poor soul out there.
Some answers are:

  1. Turns out adding the environment variables to the .bashrc did the trick. (Probably when the make happens, it opens a new session so the temporary exports before launching CPAN will not stick)
  2. These errors went away when the LD_LIBRARY_PATH was correctly picked up
  3. Same thing, set in .bashrc
  4. Haven't tried to set other variables yet...
  5. ???
  6. ???
One additional is, we made sure to upgrade the DBI module also, which in turn upgraded ExtUtils::MakeMaker and something else. So in the end, it was glad to skip all the tests when a db connection wasn't found and happily installed.

Replies are listed 'Best First'.
Re: DBD::Oracle install
by Anonymous Monk on Jul 18, 2013 at 00:35 UTC
      Interestingly, thinks is not found. How would I go about fixing that?
      ldd -v /opt/oracleas/product/11.2.0/client_1/lib/ => (0x00007fff1d1fd000) => /opt/oracleas/product/11.2.0/client_1/lib/libnn (0x00002b0cdc6cf000) => /lib64/ (0x00002b0cdcab1000) => /lib64/ (0x00002b0cdccb5000) => /lib64/ (0x00002b0cdcf38000) => /lib64/ (0x00002b0cdd154000) => /lib64/ (0x00002b0cdd36c000) => /usr/lib64/ (0x00002b0cdd6c4000) /lib64/ (0x000000348a800000) Version information: /opt/oracleas/product/11.2.0/client_1/lib/ (GLIBC_2.3.3) => /lib64/ (GLIBC_2.2.5) => /lib64/ (GLIBC_2.2.5) => /lib64/ (LIBAIO_0.4) => /usr/lib64/ (LIBAIO_0.1) => /usr/lib64/ (GLIBC_2.3.2) => /lib64/ (GLIBC_2.3.3) => /lib64/ (GLIBC_2.3) => /lib64/ (GLIBC_2.2.5) => /lib64/ (GLIBC_2.3.2) => /lib64/ +0 (GLIBC_2.2.5) => /lib64/ +0 /opt/oracleas/product/11.2.0/client_1/lib/ (GLIBC_2.3) => /lib64/ (GLIBC_2.2.5) => /lib64/ /lib64/ (GLIBC_PRIVATE) => /lib64/ld-linu (GLIBC_PRIVATE) => /lib64/ (GLIBC_2.2.5) => /lib64/ /lib64/ (GLIBC_2.2.5) => /lib64/ /lib64/ (GLIBC_2.3) => /lib64/ld-linux-x8 (GLIBC_2.2.5) => /lib64/ld-linux- (GLIBC_PRIVATE) => /lib64/ld-linu (GLIBC_2.3.2) => /lib64/ (GLIBC_PRIVATE) => /lib64/ (GLIBC_2.2.5) => /lib64/ /lib64/ (GLIBC_2.3) => /lib64/ (GLIBC_2.2.5) => /lib64/ /lib64/ (GLIBC_2.3) => /lib64/ld-linux-x8 (GLIBC_PRIVATE) => /lib64/ld-linu ldd -v /home/root/.cpan/build/DBD-Oracle-1.58/blib/arch/auto/DBD/Oracl +e/ => (0x00007fffbfbfd000) => not found => /lib64/ (0x00002b75bac93000) => /lib64/ (0x00002b75bae97000) => /lib64/ (0x00002b75bb11a000) => /lib64/ (0x00002b75bb336000) => /lib64/ (0x00002b75bb54e000) /lib64/ (0x000000348a800000) Version information: /home/root/.cpan/build/DBD-Oracle-1.58/blib/arch/auto/DBD/Orac +le/ (GLIBC_2.2.5) => /lib64/ +0 (GLIBC_2.4) => /lib64/ (GLIBC_2.3.4) => /lib64/ (GLIBC_2.2.5) => /lib64/ /lib64/ (GLIBC_PRIVATE) => /lib64/ld-linu (GLIBC_PRIVATE) => /lib64/ (GLIBC_2.2.5) => /lib64/ /lib64/ (GLIBC_2.2.5) => /lib64/ /lib64/ (GLIBC_2.3) => /lib64/ld-linux-x8 (GLIBC_2.2.5) => /lib64/ld-linux- (GLIBC_PRIVATE) => /lib64/ld-linu (GLIBC_2.3.2) => /lib64/ (GLIBC_PRIVATE) => /lib64/ (GLIBC_2.2.5) => /lib64/ /lib64/ (GLIBC_2.3) => /lib64/ (GLIBC_2.2.5) => /lib64/ /lib64/ (GLIBC_2.3) => /lib64/ld-linux-x8 (GLIBC_PRIVATE) => /lib64/ld-linu
Re: DBD::Oracle install
by Anonymous Monk on Jul 17, 2013 at 23:59 UTC

    Why is the error with happening? Is it a permissions issue for or (We are running as root, why would permissions matter?)

    Um, what error message mentions

      I was thinking of the first error. It says "Can't load '/home/root/.cpan/build/DBD-Oracle-1.58/blib/arch/auto/DBD/Oracle/' for module cannot open shared object file: No such file or directory " Since it mentioned both and, I wasn't sure which is the real issue... but fresher eyes today (I want to say it's

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://1044919]
Approved by Corion
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (3)
As of 2024-04-16 21:32 GMT
Find Nodes?
    Voting Booth?

    No recent polls found