Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

DBD::Oracle install

by rider754 (Novice)
on Jul 17, 2013 at 22:44 UTC ( #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/Oracle.so' for module DBD::Oracl +e: libclntsh.so.11.1: cannot open shared object file: No such file or + directory at /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/DynaLo +ader.pm line 230. at t/00versions.t line 10 String found where operator expected at t/nchar_test_lib.pl 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 libclntsh.so.11.1 and it turned up two locations
lrwxrwxrwx 1 weblogic weblogic /opt/oracleas/product/11.2.0/client_1/ +instantclient/libclntsh.so.11.1 -rwxr-xr-x 1 weblogic weblogic /opt/oracleas/product/11.2.0/client_1/ +lib/libclntsh.so.11.1

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.0.1 (11.2) Found /opt/oracleas/product/11.2.0/client_1/rdbms/lib/ins_rdbms.mk Using /opt/oracleas/product/11.2.0/client_1/rdbms/lib/ins_rdbms.mk 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/ins_rdbms.mk Reading /opt/oracleas/product/11.2.0/client_1/rdbms/lib/env_rdbms.mk WARNING: Oracle /opt/oracleas/product/11.2.0/client_1/rdbms/lib/ins_rd +bms.mk 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=\"11.2.0.1 +\" -DORA_OCI_102 -DORA_OCI_112 Checking for functioning wait.ph System: perl5.008008 linux x86-002.build.bos.redhat.com 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 README.help.tx +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 libclntsh.so.11.1 happening? Is it a permissions issue for libclntsh.so.11.1 or Oracle.so? (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. http://www.perlmonks.org/?node_id=913262 (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, Oracle.so thinks libclntsh.so.11.1 is not found. How would I go about fixing that?
      ldd -v /opt/oracleas/product/11.2.0/client_1/lib/libclntsh.so.11.1 linux-vdso.so.1 => (0x00007fff1d1fd000) libnnz11.so => /opt/oracleas/product/11.2.0/client_1/lib/libnn +z11.so (0x00002b0cdc6cf000) libdl.so.2 => /lib64/libdl.so.2 (0x00002b0cdcab1000) libm.so.6 => /lib64/libm.so.6 (0x00002b0cdccb5000) libpthread.so.0 => /lib64/libpthread.so.0 (0x00002b0cdcf38000) libnsl.so.1 => /lib64/libnsl.so.1 (0x00002b0cdd154000) libc.so.6 => /lib64/libc.so.6 (0x00002b0cdd36c000) libaio.so.1 => /usr/lib64/libaio.so.1 (0x00002b0cdd6c4000) /lib64/ld-linux-x86-64.so.2 (0x000000348a800000) Version information: /opt/oracleas/product/11.2.0/client_1/lib/libclntsh.so.11.1: libdl.so.2 (GLIBC_2.3.3) => /lib64/libdl.so.2 libdl.so.2 (GLIBC_2.2.5) => /lib64/libdl.so.2 libm.so.6 (GLIBC_2.2.5) => /lib64/libm.so.6 libaio.so.1 (LIBAIO_0.4) => /usr/lib64/libaio.so.1 libaio.so.1 (LIBAIO_0.1) => /usr/lib64/libaio.so.1 libc.so.6 (GLIBC_2.3.2) => /lib64/libc.so.6 libc.so.6 (GLIBC_2.3.3) => /lib64/libc.so.6 libc.so.6 (GLIBC_2.3) => /lib64/libc.so.6 libc.so.6 (GLIBC_2.2.5) => /lib64/libc.so.6 libpthread.so.0 (GLIBC_2.3.2) => /lib64/libpthread.so. +0 libpthread.so.0 (GLIBC_2.2.5) => /lib64/libpthread.so. +0 /opt/oracleas/product/11.2.0/client_1/lib/libnnz11.so: libc.so.6 (GLIBC_2.3) => /lib64/libc.so.6 libc.so.6 (GLIBC_2.2.5) => /lib64/libc.so.6 /lib64/libdl.so.2: ld-linux-x86-64.so.2 (GLIBC_PRIVATE) => /lib64/ld-linu +x-x86-64.so.2 libc.so.6 (GLIBC_PRIVATE) => /lib64/libc.so.6 libc.so.6 (GLIBC_2.2.5) => /lib64/libc.so.6 /lib64/libm.so.6: libc.so.6 (GLIBC_2.2.5) => /lib64/libc.so.6 /lib64/libpthread.so.0: ld-linux-x86-64.so.2 (GLIBC_2.3) => /lib64/ld-linux-x8 +6-64.so.2 ld-linux-x86-64.so.2 (GLIBC_2.2.5) => /lib64/ld-linux- +x86-64.so.2 ld-linux-x86-64.so.2 (GLIBC_PRIVATE) => /lib64/ld-linu +x-x86-64.so.2 libc.so.6 (GLIBC_2.3.2) => /lib64/libc.so.6 libc.so.6 (GLIBC_PRIVATE) => /lib64/libc.so.6 libc.so.6 (GLIBC_2.2.5) => /lib64/libc.so.6 /lib64/libnsl.so.1: libc.so.6 (GLIBC_2.3) => /lib64/libc.so.6 libc.so.6 (GLIBC_2.2.5) => /lib64/libc.so.6 /lib64/libc.so.6: ld-linux-x86-64.so.2 (GLIBC_2.3) => /lib64/ld-linux-x8 +6-64.so.2 ld-linux-x86-64.so.2 (GLIBC_PRIVATE) => /lib64/ld-linu +x-x86-64.so.2 ldd -v /home/root/.cpan/build/DBD-Oracle-1.58/blib/arch/auto/DBD/Oracl +e/Oracle.so linux-vdso.so.1 => (0x00007fffbfbfd000) libclntsh.so.11.1 => not found libdl.so.2 => /lib64/libdl.so.2 (0x00002b75bac93000) libm.so.6 => /lib64/libm.so.6 (0x00002b75bae97000) libpthread.so.0 => /lib64/libpthread.so.0 (0x00002b75bb11a000) libnsl.so.1 => /lib64/libnsl.so.1 (0x00002b75bb336000) libc.so.6 => /lib64/libc.so.6 (0x00002b75bb54e000) /lib64/ld-linux-x86-64.so.2 (0x000000348a800000) Version information: /home/root/.cpan/build/DBD-Oracle-1.58/blib/arch/auto/DBD/Orac +le/Oracle.so: libpthread.so.0 (GLIBC_2.2.5) => /lib64/libpthread.so. +0 libc.so.6 (GLIBC_2.4) => /lib64/libc.so.6 libc.so.6 (GLIBC_2.3.4) => /lib64/libc.so.6 libc.so.6 (GLIBC_2.2.5) => /lib64/libc.so.6 /lib64/libdl.so.2: ld-linux-x86-64.so.2 (GLIBC_PRIVATE) => /lib64/ld-linu +x-x86-64.so.2 libc.so.6 (GLIBC_PRIVATE) => /lib64/libc.so.6 libc.so.6 (GLIBC_2.2.5) => /lib64/libc.so.6 /lib64/libm.so.6: libc.so.6 (GLIBC_2.2.5) => /lib64/libc.so.6 /lib64/libpthread.so.0: ld-linux-x86-64.so.2 (GLIBC_2.3) => /lib64/ld-linux-x8 +6-64.so.2 ld-linux-x86-64.so.2 (GLIBC_2.2.5) => /lib64/ld-linux- +x86-64.so.2 ld-linux-x86-64.so.2 (GLIBC_PRIVATE) => /lib64/ld-linu +x-x86-64.so.2 libc.so.6 (GLIBC_2.3.2) => /lib64/libc.so.6 libc.so.6 (GLIBC_PRIVATE) => /lib64/libc.so.6 libc.so.6 (GLIBC_2.2.5) => /lib64/libc.so.6 /lib64/libnsl.so.1: libc.so.6 (GLIBC_2.3) => /lib64/libc.so.6 libc.so.6 (GLIBC_2.2.5) => /lib64/libc.so.6 /lib64/libc.so.6: ld-linux-x86-64.so.2 (GLIBC_2.3) => /lib64/ld-linux-x8 +6-64.so.2 ld-linux-x86-64.so.2 (GLIBC_PRIVATE) => /lib64/ld-linu +x-x86-64.so.2
Re: DBD::Oracle install
by Anonymous Monk on Jul 17, 2013 at 23:59 UTC

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

    Um, what error message mentions libclntsh.so.11.1?

      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/Oracle.so' for module DBD::Oracle:libclntsh.so.11.1: cannot open shared object file: No such file or directory " Since it mentioned both Oracle.so and libclntsh.so.11.1, I wasn't sure which is the real issue... but fresher eyes today (I want to say it's Oracle.so)

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (5)
As of 2022-11-29 10:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?