Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

DBD::Oracle install fail

by expresspotato (Beadle)
on Jan 18, 2011 at 15:50 UTC ( [id://882913]=perlquestion: print w/replies, xml ) Need Help??

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

Hi, I can't even seem to get DBD::Oracle installed properly. When using the default Makefile I get the following error that it could not find defopt.o.
gcc: /opt/oracle/product/10g/rdbms/lib32/defopt.o: No such file or dir +ectory
So I edited the make file to look in /opt/oracle/product/10g/rdbms/lib where the defopt.o file actually resides and make was a success. I still can't seem to use it though. After trying a small connect using DBD::Oracle I get the following error:
Can't load '/usr/lib/perl5/site_perl/5.8.5/i386-linux-thread-multi/aut +o/DBD/Oracle/Oracle.so' for module DBD::Oracle: /usr/lib/perl5/site_p +erl/5.8.5/i386-linux-thread-multi/auto/DBD/Oracle/Oracle.so: undefine +d symbol: kgefac_ at /usr/lib/perl5/5.8.5/i386-linux-thread-multi/Dyn +aLoader.pm line 230. at sql.pl line 3 Compilation failed in require at sql.pl line 3. BEGIN failed--compilation aborted at sql.pl line 3.
A quick google points me to add the oracle client directory to my path. I tried pointing it directly to the client dir to /opt/oracle/product/10g/ without success, the problem still occurs. At this point I'm at a loss for what the problem could actually be. EDIT: More information. Here is $ENV. I noticed another PerlMonks thread to change ORACLE_ENV, but none is set.
G_BROKEN_FILENAMES --> 1 HISTSIZE --> 1000 HOME --> /opt/kpiadmin HOSTNAME --> lsp1app124 INPUTRC --> /etc/inputrc KDEDIR --> /usr LANG --> en_US.UTF-8 LD_LIBRARY_PATH --> /opt/oracle/product/10g/lib LESSOPEN --> |/usr/bin/lesspipe.sh %s LOGNAME --> kpiadmin LS_COLORS --> no=00:fi=00:di=00;34:ln=00;36:pi=40;33:so=00;35:bd=40;33 +;01:cd=40;33;01:or=01;05;37;41:mi=01;05;37;41:ex=00;32:*.cmd=00;32:*. +exe=00;32:*.com=00;32:*.btm=00;32:*.bat=00;32:*.sh=00;32:*.csh=00;32: +*.tar=00;31:*.tgz=00;31:*.arj=00;31:*.taz=00;31:*.lzh=00;31:*.zip=00; +31:*.z=00;31:*.Z=00;31:*.gz=00;31:*.bz2=00;31:*.bz=00;31:*.tz=00;31:* +.rpm=00;31:*.cpio=00;31:*.jpg=00;35:*.gif=00;35:*.bmp=00;35:*.xbm=00; +35:*.xpm=00;35:*.png=00;35:*.tif=00;35: MAIL --> /var/spool/mail/kpiadmin OLDPWD --> /opt/kpiadmin/kevin/DBD-Oracle-1.27 ORACLE_BASE --> /opt/oracle ORACLE_HOME --> /opt/oracle/product/10g ORACLE_SID --> OEM10G ORACLE_TERM --> xterm PATH --> /opt/oracle/product/10g/bin:/usr/sbin:.:/usr/kerberos/bin:/us +r/local/bin:/bin:/usr/bin:/usr/X11R6/bin:/opt/kpiadmin/bin:/opt/kpiad +min/tools/bin PWD --> /opt/kpiadmin/kevin SHELL --> /bin/bash SHLVL --> 1 SSH_ASKPASS --> /usr/libexec/openssh/gnome-ssh-askpass SSH_CLIENT --> ::ffff:172.18.55.112 2145 22 SSH_CONNECTION --> ::ffff:172.18.55.112 2145 ::ffff:172.18.102.124 22 SSH_TTY --> /dev/pts/4 TERM --> xterm USER --> kpiadmin _ --> /usr/bin/perl

Replies are listed 'Best First'.
Re: DBD::Oracle install fail
by Anonyrnous Monk (Hermit) on Jan 18, 2011 at 18:49 UTC

    The symbol kgefac_ should be in the Oracle shared library libclntsh.so.

    With objdump -t (or nm) you can find out whether libclntsh.so does in fact provide the symbol, or not (e.g. wrong lib version):

    $ objdump -t libclntsh.so.10.1 | grep kgefac_

    (first find out where the lib resides, of course)

    And ldd will tell you if your Oracle.so maybe hasn't been linked against libclntsh.so at all (problem at build time):

    $ ldd /usr/lib/perl5/site_perl/5.8.5/i386-linux-thread-multi/auto/DBD/ +Oracle/Oracle.so

    (In case it has been linked properly (so it would try to load the lib), but the lib cannot be found at runtime, you should have gotten a different error ("... cannot open shared object file: No such file or directory", or some such).)

      This may have something to do with me manually editing the Makefile to point to /opt/oracle/product/10g/lib/ instead of where it was looking /opt/oracle/product/10g/lib32/ Is there a better way (say in Makefile.PL) rather than Makefile to make these changes

        The only thing I've ever had to do to get DBD::Oracle installed was set ORACLE_HOME. Its always installed fine for me after that.

Re: DBD::Oracle install fail
by tilly (Archbishop) on Jan 18, 2011 at 18:26 UTC
    My educated guess is that LD_LIBRARY_PATH should contain /opt/oracle/product/10g/rdbms/lib rather than /opt/oracle/product/10g/lib.
      The only problem with that is: /opt/oracle/product/10g/rdbms/lib/ does not contain libclntsh.so
      [kpiadmin@lsp1app124 ~/kevin/DBD-Oracle-1.27]$ ls /opt/oracle/product/ +10g/rdbms/lib/ Display all 111 possibilities? (y or n) config.c genezi.o hout.o kgupc.o kpundf +.o kzlnlbac.o libskgxpg.a rfsd.o sbbdpt.o + srfsd.o sulmain.o zsmsdrv.o config.o genksms.o hsxaora.o kgutc.o ksms.o + kzvndv.o libskgxpr.a rfsin.o shorm.o + ssbbded.o tg4pwd.o cursize.o hoaoci.o ins_rdbms.mk kkpoban.o ksnkcs +.o libdbtools10.a libskgxpu.a rfsxc.o shou.o + sskfeded.o tstshm.o dbfsize.o hoat.o jox.o kkxntp.o ksnkkp +o.o libdsga10.a libxdb.a s0exudrv.o sjsex.o + sskfoded.o ttcoerr.o defopt.o hoax.o joxoff.o kkxwtp.o ksnktd +.o libknlopt.a mapsga.o s0impdrv.o skfedpt.o + sskrmed.o ttcsoi.o dmndm.o homts.o kciwcx.o kopc.o ksnnni +.o libodm10.a maxmem.o s0kudbv.o skfodpt.o + sskrned.o wpspldrv.o dmndmse.o hormc.o kcsm.o kprnts.o ksnnt2 +.o libperfsrv10.a nmliblist s0kuzr.o skrmpt.o + sskrsed.o xaondy.o dmwdm.o hormd.o kecnr.o kprwts.o ktd.o + libqsmashr.a opimai.o s0kvpf.o skrnpt.o + ssoraed.o xaonsl.o dumpsga.o horm.o kecwr.o kpucb.o kxmnsd +.o libskgxns.a osh.o s0udexp.o skrspt.o + sstrced.o xsnoolap.o env_rdbms.mk hormt.o kfod.o kpudfo.o kxmwsd +.o libskgxpd.a rfscom.o s0udimp.o sllfls.o + strcpt.o xsyeolap.o
      [kpiadmin@lsp1app124 ~/kevin/DBD-Oracle-1.27]$ ls /opt/oracle/product/ +10g/lib/lib Display all 181 possibilities? (y or n) libagent10.a libdbcfg10.so libmgwagent.so l +ibnmastk.so libnmuc.so libocci10_343.a l +iborasdk.so.10.2 libsql10.a libagtsh.so libemmas10.so libmm.a l +ibnmastk.so.0 libnmuc.so.0 libocci10_343.so.10.1 l +ibordim10.a libsqlplus.a libagtsh.so.1.0 libexpat.a libn10.a l +ibnmcfhc.so libnmuk.so libocci10.a l +ibordim10.so libsqlplus.so libavstub10.a libexpat.la libnavhoa.a l +ibnmcfsga.so libnmuk.so.0 libocci.so l +ibordim10.soO libsqora.so.10.1 libclient10.a libexpat.so libnbeq10.a l +ibnmeclurac.so libnnet10.a libocijdbc10.so l +ibordimt10.a libsrvm10.so libclntsh.so libexpat.so.0 libncrypt10.a l +ibnmefos.so libnnetd10.a libocijdbcst10.a l +ibordsdo10.a libsrvm10.so0 libclntsh.so.10.1 libexpat.so.0.5.0 libnhost10.a l +ibnmefos.so.0 libnnz10.a libocr10.a l +ibOsUtils.so libsrvmhas10.so libclntst10.a libgeneric10.a libnid.a l +ibnmefsql.so libnnz10.so libocr10.so l +ibowm2.so libsrvmhas10.so0 libclsr10.a libgx10.a libnjni10.so l +ibnmefsql.so.0 libnoname10.a libocrb10.a l +ibplc10.a libsrvmocr10.so libclsra10.so libhasgen10.so libnjssl10.so l +ibnmefud.so libnque10.so libocrb10.so l +ibplp10.a libsrvmocr10.so0 libclsrx10.a libheteroxa10.so libnl10.a l +ibnmefud.so.0 libnro10.a libocrutl10.a l +ibpls10.a libuini10.a libcommon10.a libhsbase.so libnldap10.a l +ibnmefut.so libnsgr10.a libocrutl10.so l +ibpsa10.a libuini10.so libcore10.a libhsnav.so libnls10.a l +ibnmefut.so.0 libnsgrsh10.a libodm10.so l +ibqsmashr.so libunls10.a libcorejava.so libimf.so libnmadbg.so l +ibnmefvr.so libnsslb10.a libodmd10.so l +ibserver10.a libunwind.so.5 libcoresh10.so libirc.a libnmadbg.so.0 l +ibnmefvr.so.0 libntcp10.a liboevm.a l +ibskgxn2.so libvsn10.a libcprts.so.5 libisqlplus.so libnmadm.so l +ibnmefw.so libntcpaio10.so libolapapi10.so l +ibskgxns.so libvsn10_std.a.dbl libctx10.a libjmisc.so libnmadm.so.0 l +ibnmefw.so.0 libntcps10.a libons.so l +ibskgxp10.so libwwg.a libctxc10.a libjox10oraawt.so libnmalk.so l +ibnmemso.so libntcps10_std.a.dbl liboraioser.so l +ibskgxpd.so libxdb.so libctxs10.a libjox10.so libnmalk.so.0 l +ibnmemso.so.0 libntns10.a liborajaas.so l +ibskgxpg.so libxml10.a libcxaguard.so.5 libldapclnt10.a libnmarl.so l +ibnmeoci.so libnus10.a liboraolap10.a l +ibskgxpr.so libzx10.a libcxa.so.3 libldapjclnt10.a libnmarl.so.0 l +ibnmeoci.so.0 libnzjs10.a liborasdkbase.so l +ibskgxpu.so libcxa.so.5 libldapjclnt10.so libnmasf.so l +ibnmevq.so libocci10_296.a liborasdkbase.so.10.2 l +ibslax10.a libdbcfg10.a liblxled.a libnmasf.so.0 l +ibnmevq.so.0 libocci10_296.so.10.1 liborasdk.so l +ibsnls10.a
        LD_LIBRARY_PATH is a path. It can contain multiple things, separated by colons.

        That said, /opt/oracle/product/10g/rdbms/lib/ doesn't look like it contains any .so files. So my "educated guess" seems to be incorrect.

Re: DBD::Oracle install fail
by bart (Canon) on Jan 18, 2011 at 17:58 UTC
    I'm far from an expert in these matters, but "undefined symbol: kgefac_" seems to point towards bad linking, for example if you are loading the wrong .so file (more specifically: an older version).

    Perhaps it's as simple as properly setting some environment variables so the Oracle stuff can load the proper client library.

      It seems the linking may be good.
      [kpiadmin@lsp1app124 /opt/oracle/product/10g/lib]$ objdump -t libclnts +h.so.10.1 | grep kgefac_ 00d23a20 g O .rodata 00000004 kgefac_
        Mmm, that's not what I mean.

        I presume there are 2 "DLL"s for Oracle: one from Oracle itself with the client libraries, and the Perl compiled XS file, which is a glue file, for the most part.

        I think that, while your compiled XS file may be fine, that it and the client DLL are not compatible.

Re: DBD::Oracle install fail
by mje (Curate) on Jan 19, 2011 at 08:56 UTC

    Have you got sqlplus connecting to this Oracle yet?

    Set ORACLE_HOME env var to point into your oracle tree and export it, run perl Makefile.PL and make and post the output of both here. If the make succeeds, set ORACLE_USERID=username/password and DBI_DSN=dbi:Oracle:host=x;sid=y (or whatever you need to connect to Oracle) and run make test. Post the output here.

    It looks as if you have a 32 bit Perl but is this a 32bit machine?

Re: DBD::Oracle install fail
by Plankton (Vicar) on Jan 19, 2011 at 06:38 UTC
    If this is a linux system you may need to need to add an file to your /etc/ld.so.conf.d that contains the path to your Oracle.so file and run ldconfig. (see man ldconfig)

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (4)
As of 2024-04-19 16:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found