problems with Oracle DBD

Discussion in 'Perl Misc' started by Kirt Loki Dankmyer, Nov 15, 2005.

  1. Okay, bear with me here. This is a long story, but I want to give all the
    details.

    I administrate a Solaris 8 box which is used for a large Oracle database.
    We've updated from Oracle 8i to Oracle 10g.

    There are some perl scripts that the main users of the database use, which
    use DBI. When they try to run them, they get errors like this:

    install_driver(Oracle) failed: Can't load
    '/usr/lib/perl5/site_perl/5.6.0/sun4-solaris/auto/DBD/Oracle/Oracle.so'
    for module DBD::Oracle: ld.so.1: /usr/bin/perl.tucker: fatal:
    libclntsh.so.8.0: open failed: No such file or directory at
    /usr/lib/perl5/5.6.0/sun4-solaris/DynaLoader.pm line 200.
    at (eval 1) line 3
    Compilation failed in require at (eval 1) line 3.
    Perhaps a required shared library or dll isn't installed where expected
    at ./do_uds.pl line 173

    Of course, that whole mention of libclntsh.so.8.0 implies I'm dealing with
    an old version of DBI (and the Oracle DBD) that doesn't recognize Oracle
    10g.

    So, I download DBI-1.48 and DBD-Oracle-1.16... They don't seem to like the
    version of perl I'm using (5.6.0), so I download the 5.8.5 perl package
    from sunfreeware.com...

    I'm able to install DBI-1.48 just fine, but when I try to install
    DBD-Oracle-1.16 I get all sorts of errors (examples further below) and it
    complains that maybe I need to recompile perl to include threads.

    Well, I'd used a precompiled version of perl. I downloaded the source for
    perl 5.8.7 and tried compiling it... But after six attempts, I gave it. It
    had problems with dynamic loading, it had problems with B, you name it, it
    had problems. I couldn't get it to compile.

    At this point, suggestions on how to proceed are welcome. Below is a
    transcript of my last attempt to install DBD-Oracle-1.16 using the perl
    5.8.5 package I got from sunfreeware.com ...

    Using DBI 1.48 (for perl 5.008005 on sun4-solaris) installed in
    /usr/local/lib/perl5/site_perl/5.8.5/sun4-solaris/auto/DBI/

    Configuring DBD::Oracle ...

    >>> Remember to actually *READ* the README file!

    Especially if you have any problems.

    Using Oracle in /array/oracle/orahome/10.1.0
    DEFINE _SQLPLUS_RELEASE = "1001000400" (CHAR)
    Oracle version 10.1.0.4 (10.1)
    Found /array/oracle/orahome/10.1.0/rdbms/demo/demo_rdbms.mk
    Using /array/oracle/orahome/10.1.0/rdbms/demo/demo_rdbms.mk
    Reading /array/oracle/orahome/10.1.0/rdbms/demo/demo_rdbms.mk
    Reading /array/oracle/orahome/10.1.0/rdbms/lib/env_rdbms.mk

    Attempting to discover Oracle OCI build rules
    gcc -B/usr/ccs/bin/ -c -I/array/oracle/orahome/10.1.0/rdbms/demo
    -I/array/oracle/orahome/10.1.0/rdbms/public
    -I/array/oracle/orahome/10.1.0/plsql/public
    -I/array/oracle/orahome/10.1.0/network/public
    -I/array/oracle/orahome/10.1.0/rdbms/demo
    -I/array/oracle/orahome/10.1.0/plsql/public
    -I/array/oracle/orahome/10.1.0/rdbms/public
    -I/usr/local/lib/perl5/site_perl/5.8.5/sun4-solaris/auto/DBI/
    -fno-strict-aliasing -pipe -I/usr/local/include -D_LARGEFILE_SOURCE
    -D_FILE_OFFSET_BITS=64 -O -DVERSION=\"1.16\" -DXS_VERSION=\"1.16\"
    -fPIC "-I/usr/local/lib/perl5/5.8.5/sun4-solaris/CORE" -Wall -Wno-comment
    -DUTF8_SUPPORT -DNEW_OCI_INIT -DORA_OCI_VERSION=\"10.1.0.4\" DBD_ORA_OBJ.c
    by executing: [make -f
    /array/oracle/orahome/10.1.0/rdbms/demo/demo_rdbms.mk build ECHODO=echo
    ECHO=echo GENCLNTSH='echo genclntsh' CC=true OPTIMIZE= CCFLAGS=
    EXE=DBD_ORA_EXE OBJS=DBD_ORA_OBJ.o]
    Oracle oci build command:
    [true -xarch=v9 -L/array/oracle/orahome/10.1.0/lib/
    -L/array/oracle/orahome/10.1.0/rdbms/lib/ -o DBD_ORA_EXE DBD_ORA_OBJ.o
    -lclntsh `cat /array/oracle/orahome/10.1.0/lib/sysliblist`
    -R/array/oracle/orahome/10.1.0/lib -laio -lposix4 -lkstat -lm -lthread]

    Found header files in plsql/public rdbms/public.

    Checking for functioning wait.ph


    System: perl5.008005 sunos 5.8 generic_108528-11 sun4u sparc
    sunw,ultra-5_10
    Compiler: gcc -B/usr/ccs/bin/ -O -fno-strict-aliasing -pipe
    -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
    Linker: /usr/ucb/ld
    Sysliblist: -lnsl -lsocket -lgen -ldl
    Oracle makefiles would have used these definitions but we override them:
    CC: cc

    CFLAGS: $(GFLAG) $(OPTIMIZE) $(CDEBUG) $(CCFLAGS) $(PFLAGS)\
    $(SHARED_CFLAG) $(USRFLAGS)
    [$(GFLAG) -xO3 $(CDEBUG) -Xa $(PROFILE) -xstrconst -dalign -xF
    $(XS) $(MR) -xildoff -errtags=yes -v -xarch=v9 -xchip=ultra3 -W2,-AKNR_S
    -Wd,-xsafe=unboundsym -Wc,-Qiselect-funcalign=32 -xcode=abs44
    -Wc,-Qgsched-trace_late=1 -Wc,-Qgsched-T5 -xalias_level=weak -D_REENTRANT
    -DSS_64BIT_SERVER -DBIT64 -DMACHINE64 -K PIC
    -I/array/oracle/orahome/10.1.0/rdbms/demo
    -I/array/oracle/orahome/10.1.0/rdbms/public
    -I/array/oracle/orahome/10.1.0/plsql/public
    -I/array/oracle/orahome/10.1.0/network/public -DSLMXMX_ENABLE
    -DSLTS_ENABLE -D_SVID_GETTOD -D_REENTRANT $(LPFLAGS) $(USRFLAGS)]

    LDFLAGS: -o $@ $(LDPATHFLAG)$(PRODLIBHOME) $(LDPATHFLAG)$(LIBHOME)
    [-o $@ -L/array/oracle/orahome/10.1.0/rdbms/lib/ -L$(LIBHOME)]


    Linking with OTHERLDFLAGS = -xarch=v9 -L/array/oracle/orahome/10.1.0/lib/
    -L/array/oracle/orahome/10.1.0/rdbms/lib/ -lclntsh `cat
    /array/oracle/orahome/10.1.0/lib/sysliblist`
    -R/array/oracle/orahome/10.1.0/lib -laio -lposix4 -lkstat -lm -lthread
    [from 'build' rule]


    Warning: If you have problems you may need to rebuild perl with threading
    enabled.

    LD_RUN_PATH=/array/oracle/orahome/10.1.0/lib32:/array/oracle/orahome/10.1.0/rdbms/lib32
    Using DBD::Oracle 1.16.
    Using DBD::Oracle 1.16.
    Using DBI 1.48 (for perl 5.008005 on sun4-solaris) installed in
    /usr/local/lib/perl5/site_perl/5.8.5/sun4-solaris/auto/DBI/
    Writing Makefile for DBD::Oracle

    *** If you have problems...
    read all the log printed above, and the README and README.help files.
    (Of course, you have read README by now anyway, haven't you?)

    bash-2.03# make
    Skip blib/lib/DBD/Oracle.pm (unchanged)
    Skip blib/lib/oraperl.ph (unchanged)
    Skip blib/arch/auto/DBD/Oracle/dbdimp.h (unchanged)
    Skip blib/arch/auto/DBD/Oracle/ocitrace.h (unchanged)
    Skip blib/lib/Oraperl.pm (unchanged)
    Skip blib/arch/auto/DBD/Oracle/Oracle.h (unchanged)
    Skip blib/lib/DBD/Oracle/GetInfo.pm (unchanged)
    Skip blib/arch/auto/DBD/Oracle/mk.pm (unchanged)
    gcc -B/usr/ccs/bin/ -c -I/array/oracle/orahome/10.1.0/rdbms/demo
    -I/array/oracle/orahome/10.1.0/rdbms/public
    -I/array/oracle/orahome/10.1.0/plsql/public
    -I/array/oracle/orahome/10.1.0/network/public
    -I/array/oracle/orahome/10.1.0/rdbms/demo
    -I/array/oracle/orahome/10.1.0/plsql/public
    -I/array/oracle/orahome/10.1.0/rdbms/public
    -I/usr/local/lib/perl5/site_perl/5.8.5/sun4-solaris/auto/DBI/
    -fno-strict-aliasing -pipe -I/usr/local/include -D_LARGEFILE_SOURCE
    -D_FILE_OFFSET_BITS=64 -O -DVERSION=\"1.16\" -DXS_VERSION=\"1.16\"
    -fPIC "-I/usr/local/lib/perl5/5.8.5/sun4-solaris/CORE" -Wall -Wno-comment
    -DUTF8_SUPPORT -DNEW_OCI_INIT -DORA_OCI_VERSION=\"10.1.0.4\" Oracle.c
    Oracle.c: In function `XS_DBD__Oracle__db_ora_lob_append':
    Oracle.xs:191: warning: unused variable `startp'
    gcc -B/usr/ccs/bin/ -c -I/array/oracle/orahome/10.1.0/rdbms/demo
    -I/array/oracle/orahome/10.1.0/rdbms/public
    -I/array/oracle/orahome/10.1.0/plsql/public
    -I/array/oracle/orahome/10.1.0/network/public
    -I/array/oracle/orahome/10.1.0/rdbms/demo
    -I/array/oracle/orahome/10.1.0/plsql/public
    -I/array/oracle/orahome/10.1.0/rdbms/public
    -I/usr/local/lib/perl5/site_perl/5.8.5/sun4-solaris/auto/DBI/
    -fno-strict-aliasing -pipe -I/usr/local/include -D_LARGEFILE_SOURCE
    -D_FILE_OFFSET_BITS=64 -O -DVERSION=\"1.16\" -DXS_VERSION=\"1.16\"
    -fPIC "-I/usr/local/lib/perl5/5.8.5/sun4-solaris/CORE" -Wall -Wno-comment
    -DUTF8_SUPPORT -DNEW_OCI_INIT -DORA_OCI_VERSION=\"10.1.0.4\" dbdimp.c
    dbdimp.c: In function `dbd_rebind_ph_char':
    dbdimp.c:1061: warning: value computed is not used
    gcc -B/usr/ccs/bin/ -c -I/array/oracle/orahome/10.1.0/rdbms/demo
    -I/array/oracle/orahome/10.1.0/rdbms/public
    -I/array/oracle/orahome/10.1.0/plsql/public
    -I/array/oracle/orahome/10.1.0/network/public
    -I/array/oracle/orahome/10.1.0/rdbms/demo
    -I/array/oracle/orahome/10.1.0/plsql/public
    -I/array/oracle/orahome/10.1.0/rdbms/public
    -I/usr/local/lib/perl5/site_perl/5.8.5/sun4-solaris/auto/DBI/
    -fno-strict-aliasing -pipe -I/usr/local/include -D_LARGEFILE_SOURCE
    -D_FILE_OFFSET_BITS=64 -O -DVERSION=\"1.16\" -DXS_VERSION=\"1.16\"
    -fPIC "-I/usr/local/lib/perl5/5.8.5/sun4-solaris/CORE" -Wall -Wno-comment
    -DUTF8_SUPPORT -DNEW_OCI_INIT -DORA_OCI_VERSION=\"10.1.0.4\" oci8.c
    oci8.c: In function `fetch_func_varfield':
    oci8.c:540: warning: value computed is not used
    oci8.c: In function `fetch_func_nty':
    oci8.c:571: warning: value computed is not used
    oci8.c: In function `dbd_rebind_ph_lob':
    oci8.c:628: warning: value computed is not used
    oci8.c: In function `ora_blob_read_mb_piece':
    oci8.c:664: warning: value computed is not used
    oci8.c:672: warning: value computed is not used
    oci8.c:680: warning: value computed is not used
    oci8.c:708: warning: value computed is not used
    oci8.c: In function `ora_blob_read_piece':
    oci8.c:768: warning: value computed is not used
    oci8.c:775: warning: value computed is not used
    oci8.c:782: warning: value computed is not used
    oci8.c:812: warning: value computed is not used
    oci8.c:842: warning: value computed is not used
    oci8.c: In function `fetch_func_autolob':
    oci8.c:911: warning: value computed is not used
    oci8.c:944: warning: value computed is not used
    oci8.c:953: warning: value computed is not used
    oci8.c:973: warning: value computed is not used
    oci8.c: In function `ora_st_fetch':
    oci8.c:1449: warning: value computed is not used
    oci8.c:1468: warning: value computed is not used
    oci8.c: In function `post_execute_lobs':
    oci8.c:1950: warning: value computed is not used
    oci8.c:1953: warning: value computed is not used
    oci8.c: At top level:
    oci8.c:566: warning: `fetch_func_nty' defined but not used
    oci8.c:1012: warning: `fbh_setup_getrefpv' defined but not used
    Running Mkbootstrap for DBD::Oracle ()
    chmod 644 Oracle.bs
    rm -f blib/arch/auto/DBD/Oracle/Oracle.so
    LD_RUN_PATH="/array/oracle/orahome/10.1.0/lib32:/array/oracle/orahome/10.1.0/rdbms/lib32"
    gcc -B/usr/ccs/bin/ -G -L/usr/local/lib Oracle.o dbdimp.o oci8.o
    -xarch=v9 -L/array/oracle/orahome/10.1.0/lib/
    -L/array/oracle/orahome/10.1.0/rdbms/lib/ -lclntsh `cat
    /array/oracle/orahome/10.1.0/lib/sysliblist`
    -R/array/oracle/orahome/10.1.0/lib -laio -lposix4 -lkstat -lm -lthread
    -o blib/arch/auto/DBD/Oracle/Oracle.so
    ld: fatal: file /array/oracle/orahome/10.1.0/lib//libclntsh.so: wrong ELF
    class: ELFCLASS64
    ld: fatal: File processing errors. No output written to
    blib/arch/auto/DBD/Oracle/Oracle.so
    collect2: ld returned 1 exit status
    gcc: file path prefix `/usr/ccs/bin/' never used
    *** Error code 1
    make: Fatal error: Command failed for target
    `blib/arch/auto/DBD/Oracle/Oracle.so'
    bash-2.03# make test
    rm -f blib/arch/auto/DBD/Oracle/Oracle.so
    LD_RUN_PATH="/array/oracle/orahome/10.1.0/lib32:/array/oracle/orahome/10.1.0/rdbms/lib32"
    gcc -B/usr/ccs/bin/ -G -L/usr/local/lib Oracle.o dbdimp.o oci8.o
    -xarch=v9 -L/array/oracle/orahome/10.1.0/lib/
    -L/array/oracle/orahome/10.1.0/rdbms/lib/ -lclntsh `cat
    /array/oracle/orahome/10.1.0/lib/sysliblist`
    -R/array/oracle/orahome/10.1.0/lib -laio -lposix4 -lkstat -lm -lthread
    -o blib/arch/auto/DBD/Oracle/Oracle.so
    ld: fatal: file /array/oracle/orahome/10.1.0/lib//libclntsh.so: wrong ELF
    class: ELFCLASS64
    ld: fatal: File processing errors. No output written to
    blib/arch/auto/DBD/Oracle/Oracle.so
    collect2: ld returned 1 exit status
    gcc: file path prefix `/usr/ccs/bin/' never used
    *** Error code 1
    make: Fatal error: Command failed for target
    `blib/arch/auto/DBD/Oracle/Oracle.so'
    bash-2.03# make install
    rm -f blib/arch/auto/DBD/Oracle/Oracle.so
    LD_RUN_PATH="/array/oracle/orahome/10.1.0/lib32:/array/oracle/orahome/10.1.0/rdbms/lib32"
    gcc -B/usr/ccs/bin/ -G -L/usr/local/lib Oracle.o dbdimp.o oci8.o
    -xarch=v9 -L/array/oracle/orahome/10.1.0/lib/
    -L/array/oracle/orahome/10.1.0/rdbms/lib/ -lclntsh `cat
    /array/oracle/orahome/10.1.0/lib/sysliblist`
    -R/array/oracle/orahome/10.1.0/lib -laio -lposix4 -lkstat -lm -lthread
    -o blib/arch/auto/DBD/Oracle/Oracle.so
    ld: fatal: file /array/oracle/orahome/10.1.0/lib//libclntsh.so: wrong ELF
    class: ELFCLASS64
    ld: fatal: File processing errors. No output written to
    blib/arch/auto/DBD/Oracle/Oracle.so
    collect2: ld returned 1 exit status
    gcc: file path prefix `/usr/ccs/bin/' never used
    *** Error code 1
    make: Fatal error: Command failed for target
    `blib/arch/auto/DBD/Oracle/Oracle.so'
    bash-2.03#

    --
    Kirt "Loki" Dankmyer -- http://ivanhoeunbound.com -- xiomBRAG on AIM
    cats * hats * RPGs * love * Eris * Agent Patriot * anime * Dada * poetry
    "Only ONE MAN can kill this many Russians. Bring his guitar to me!" -Death
    Kirt Loki Dankmyer, Nov 15, 2005
    #1
    1. Advertising

  2. Kirt Loki Dankmyer wrote:
    > Okay, bear with me here. This is a long story, but I want to give all the
    > details.
    >
    > I administrate a Solaris 8 box which is used for a large Oracle database.
    > We've updated from Oracle 8i to Oracle 10g.
    >
    > There are some perl scripts that the main users of the database use, which
    > use DBI. When they try to run them, they get errors like this:
    >


    <snip>
    > Well, I'd used a precompiled version of perl. I downloaded the source for
    > perl 5.8.7 and tried compiling it... But after six attempts, I gave it. It
    > had problems with dynamic loading, it had problems with B, you name it, it
    > had problems. I couldn't get it to compile.
    >
    > At this point, suggestions on how to proceed are welcome. Below is a
    > transcript of my last attempt to install DBD-Oracle-1.16 using the perl
    > 5.8.5 package I got from sunfreeware.com ...


    <snip>

    > gcc -B/usr/ccs/bin/ -G -L/usr/local/lib Oracle.o dbdimp.o oci8.o
    > -xarch=v9 -L/array/oracle/orahome/10.1.0/lib/
    > -L/array/oracle/orahome/10.1.0/rdbms/lib/ -lclntsh `cat
    > /array/oracle/orahome/10.1.0/lib/sysliblist`
    > -R/array/oracle/orahome/10.1.0/lib -laio -lposix4 -lkstat -lm -lthread
    > -o blib/arch/auto/DBD/Oracle/Oracle.so
    > ld: fatal: file /array/oracle/orahome/10.1.0/lib//libclntsh.so: wrong ELF
    > class: ELFCLASS64


    I don't have access to a Solaris box to check this on, but I would guess
    that you are trying to link against 64-bit Oracle libraries when you
    have compiled DBD::Oracle as 32-bit. You could try convincing gcc to
    compile 64-bit binaries (flag is -m64), or linking against 32-bit
    libraries instead. Googling for "solaris wrong elfclass ELFCLASS64" may
    give you some more pointers.


    Mark
    Mark Clements, Nov 15, 2005
    #2
    1. Advertising

  3. Mark Clements wrote:
    > Kirt Loki Dankmyer wrote:
    >> Okay, bear with me here. This is a long story, but I want to give all
    >> the details.
    >>
    >> I administrate a Solaris 8 box which is used for a large Oracle
    >> database. We've updated from Oracle 8i to Oracle 10g.
    >>
    >> There are some perl scripts that the main users of the database use,
    >> which use DBI. When they try to run them, they get errors like this:
    >>

    >
    > <snip>
    >> Well, I'd used a precompiled version of perl. I downloaded the source
    >> for perl 5.8.7 and tried compiling it... But after six attempts, I
    >> gave it. It had problems with dynamic loading, it had problems with B,
    >> you name it, it had problems. I couldn't get it to compile.
    >>
    >> At this point, suggestions on how to proceed are welcome. Below is a
    >> transcript of my last attempt to install DBD-Oracle-1.16 using the
    >> perl 5.8.5 package I got from sunfreeware.com ...

    >
    > <snip>
    >
    >> gcc -B/usr/ccs/bin/ -G -L/usr/local/lib Oracle.o dbdimp.o oci8.o
    >> -xarch=v9 -L/array/oracle/orahome/10.1.0/lib/
    >> -L/array/oracle/orahome/10.1.0/rdbms/lib/ -lclntsh `cat
    >> /array/oracle/orahome/10.1.0/lib/sysliblist`
    >> -R/array/oracle/orahome/10.1.0/lib -laio -lposix4 -lkstat -lm
    >> -lthread -o blib/arch/auto/DBD/Oracle/Oracle.so ld: fatal: file
    >> /array/oracle/orahome/10.1.0/lib//libclntsh.so: wrong ELF class:
    >> ELFCLASS64

    >
    > I don't have access to a Solaris box to check this on, but I would guess
    > that you are trying to link against 64-bit Oracle libraries when you
    > have compiled DBD::Oracle as 32-bit. You could try convincing gcc to
    > compile 64-bit binaries (flag is -m64), or linking against 32-bit
    > libraries instead. Googling for "solaris wrong elfclass ELFCLASS64" may
    > give you some more pointers.


    come to think of it, I suspect that compiling DBD::Oracle as 64-bit
    probably isn't going to help much if your perl is 32-bit. Not having a
    Solaris box to hand, I can't confirm this and so am loathe to risk
    giving you more misinformation. Sorry about that.

    Mark
    Mark Clements, Nov 15, 2005
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Andrew Crook

    DBD::CSV questions and is there a DBD::XML?

    Andrew Crook, Sep 2, 2003, in forum: Perl Misc
    Replies:
    2
    Views:
    151
    Andrew Crook
    Sep 11, 2003
  2. Mike Solomon

    DBD::mysqlPP v DBD::mysql

    Mike Solomon, Feb 16, 2004, in forum: Perl Misc
    Replies:
    1
    Views:
    194
    James Willmore
    Feb 16, 2004
  3. Feyruz
    Replies:
    4
    Views:
    2,095
    Sherm Pendley
    Oct 14, 2005
  4. Replies:
    0
    Views:
    104
  5. Jim Cochrane
    Replies:
    0
    Views:
    103
    Jim Cochrane
    Aug 25, 2007
Loading...

Share This Page