perlquestion
rider754
Hello monks,
<p>
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.
</p>
<p>
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:
</p>
<code>
ORACLE_HOME=/opt/oracleas/product/11.2.0/client_1
LD_LIBRARY_PATH=$ORACLE_HOME/lib
</code>
<p>
Then, we start encountering error messages around the tests. Two of the errors are:
<code>
t/00versions..................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 at /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/DynaLoader.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?)
</code>
We've next tried to set <code>NLS_LANG=AMERICAN_AMERICA.US7ASCII</code> (the previous value on our Solaris box). But the error persists.
</p>
I ran <code>locate libclntsh.so.11.1</code> and it turned up two locations
<code>
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
</code>
<p>
Update: It doesn't make sense to me why LD_LIBRARY_PATH is not picked up by the build
<code>
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/product/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_rdbms.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-version 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 build it this way.
Found header files in /opt/oracleas/product/11.2.0/client_1/rdbms/public.
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 gnulinux
Compiler: gcc -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -pipe -Wdeclaration-after-statement -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=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 them:
CC: $(COMPDIR)/bin/gcc
CFLAGS: $(GFLAG) $(OPTIMIZE) $(CDEBUG) $(CCFLAGS) $(PFLAGS)\
$(SHARED_CFLAG) $(USRFLAGS)
[$(GFLAG) -O3 $(CDEBUG) -m32 -trigraphs -fPIC -I/opt/oracleas/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/public -I/opt/oracleas/product/11.2.0/client_1/network/public -DLINUX -D_GNU_SOURCE -D_LARGEFILE64_SOURCE=1 -D_LARGEFILE_SOURCE=1 -DSLTS_ENABLE -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 -ldl -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) installed in /usr/lib64/perl5/vendor_perl/5.8.8/x86_64-linux-thread-multi/auto/DBI/
Writing Makefile for DBD::Oracle
*** If you have problems...
read all the log printed above, and the README and README.help.txt files.
(Of course, you have read README by now anyway, haven't you?)
</code>
<p>
My questions are: <br/>
<ol>
<li>Why is LD_LIBRARY_PATH not picked up by the CPAN install?</li>
<li>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?)</li>
<li>What is this issue with NLS_LANG and how should I go about fixing it?</li>
<li>Are there other variables I need to set? (ex: TNS_ADMIN)</li>
<li>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?</li>
<li>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?</li>
</ol>
</p>
<p>Update #2 Hope this helps some other poor soul out there.
<br/>Some answers are:
<ol>
<li>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)</li>
<li>These errors went away when the LD_LIBRARY_PATH was correctly picked up</li>
<li>Same thing, set in .bashrc</li>
<li>Haven't tried to set other variables yet...</li>
<li>???</li>
<li>???</li>
</ol>
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.
</p>