Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How To Install DBI/DBD

Status
Not open for further replies.

dkyrtata

Programmer
Aug 13, 2010
107
CA
Does anyone have any instructions to install Perl's DBI/DBD package for Oracle 11g on a HPUX-11 system running on a HP Itanium Box?

My Unix administrator has never had a problem doing so for Oracle 10g, but things fail to compile (using an ANSI C compiler) for Oracle 11g. From what I understand, it is the DBD component that is the problem.

Is there a particular version of Perl we should download from CPAN to increase our chances of success?

Should I be asking this Question at the Oracle forum?
 
What version of perl (perl -V), C compiler (cc --version or similar) and exact OS release is it (uname -r)?

Annihilannic.
 
I have two general points for you to take into account, discovered when I spent a lot of time trying to get XML_Parser installed on an HPUX 11.11 server:

(1) I had perl 5.10.0 compiled using the free HPUX compiler and was trying to install expat and XML_Parser using gcc make. Firstly, it is apparent that trying to use gcc make to install modules does NOT work with perl when the latter has been compiled using the HP compiler. If you want to use gcc make, you have to compile perl using gcc as well.

(2)The free compiler supplied with HP 11 is buggy and requires a patch from the HP website. It does then work.
 
Annihilannic

Here is the information your requested. Thanks for providing the exact commands:

Perl version: V5.8.8 built for IA64.ARCHREV_0-thread-multi, copyright 1987-2006, Larry Wall

C Compiler: CC: GP C/ac B3910B A.06.15 (May 16 2007)

OS Release: B.11.31


tonykent

Yes, we figured it out back in 2005 that the default C compiler that HP provides does not work. We ended up purchasing one. After loosing the original CD we had HP send us another one just recently. How can I be sure that they did not send us the buggy Gcc compiler?

 
It's probable that if your perl came with the machine it was compiled using an HP compiler, but it may well be a different one (or at least a different version) from the one you have now. My experience of trying to compile and link perl modules leads me to believe that the process is very sensitive to issues surrounding how perl itself was compiled and how subsequent modules are compiled.

I was only able to get everything to work by compiling a fresh perl installation myself and then using the same compiler to do the modules.
 
I recommend trying to follow the instructions in README.hpux.txt (which comes with DBD::Oracle) which supports what tonykent has been saying, especially the section "Appendix B (64 bit build with /usr/bin/cc -- bundled C compiler)".

Annihilannic.
 
Tonykent, Annihilannic

Thank you for your advice. We are going to try your suggestions. In the meantime, we downloaded the latest version of Perl (5.14?) from CPAN, but got compilation errors. So that is a step backwards. We will be asking the Unix Administrator to rebuild the box from scratch when he returns from vacation and try again. We are even considering getting the DBA to reinstall Oracle 11g, but he is not going to be happy about that.

Tonykent

Can I assume that you succeeded in doing the DBI/DBD installation on HPUX for Oracle 11g? Knowing that you succeeded gives us hope that this endeavor is indeed possible.


I will let you know what happens. So please continue to monitor this thread.

Thanks
 
Yes, I fianlly got everything I needed installed (over 320 modules!) including DBI/DBD. This was done using gcc and gmake to compile both perl itself (5.88 amd 5.10.0) and then all the modules on half a dozen HPUX11 and Solaris servers.
 
TonyKent

I am surprised that you actually succeeded in getting this work done using the Gcc compiler. We always used an ANSI C compiler in the past. I have a few more questions, if you do not mind.

1) Did you get a successful installation on a HP Itanium box? Does it even matter whether the hardware is Itanium or PA-RISC?

2) How do I verify what compiler we are using? In my previous post the "cc --version" command returned "CC: GP C/ac B3910B A.06.15 (May 16 2007)". How can I be sure whether this is the Gcc compiler or the ANSI compiler?

3) We are installing the latest version of Perl (5.14.1) from CPAN. Should we use the highest version you used (5.10.0)? Do we need to remove the Perl that HP provides?

Thank you so much for the information you have provided so far!!
 
We decided to use gcc because the pre-installed HP ANSI C compiler was faulty (and, if I remember rightly, of limited functionality). By the time we had sorted out what was wrong with the HP compiler and got HP's agreement not to charge us for their full product we had already proceeded using gcc.

The HP boxes were PA_RISC, but the Solaris boxes were new Itanium ones. I encountered no issues specific to the box types.

The command "gcc -v" will return full information about the gcc compiler IF you have it installed. My guess is that you have the hp compiler, although there is no problem in having both installed simultaneously.

At the time I was doing the installations 5.10.0 was the latest perl release available. It's generally best to use whatever is the most recent. I would go with 5.14.1 and only fall back to an earlier release if you encounter problems.

I compiled 5.10.0 as follows:

Code:
Configure:
./Configure -A prepend:libswanted='cl pthread ' -Dcc='/net/hn4k022/opt/product/ticm/build_tools/hp/gcc/gcc-3.4.6/bin/gcc' -Dprefix=/net/hn4k022/opt/product/ticm/build_tools/hp/perl/gcc/5.10.0

Manual step:
copy ./hints/t001.c to build location

Make:
/net/hn4xx22/opt/product/ticm/build_tools/hp/gnu/make-3.81/bin/make
/net/hn4xx22/opt/product/ticm/build_tools/hp/gnu/make-3.81/bin/make test
/net/hn4xx22/opt/product/ticm/build_tools/hp/gnu/make-3.81/bin/make install
 
CC: GP C/ac B3910B A.06.15 (May 16 2007)" is definitely the HP ANSI C compiler, and quite a new release too (compared to our systems).

Annihilannic.
 
Annihilannic (and TonyKent)

Thanks for the confirmation. The C compiler should be new since we asked HP to send us another one after loosing the original CD from 6 years ago. That version (A.06.12) is on our older boxes.

The problem we have now is that we can't even compile Perl. So now we wonder whether it is higher version of Perl we are compiling or the higher version of the C compiler?

I'll get back to you as we figure things out. Thanks to both of you for keeping on eye on this posting and providing very valuable information. Much appreciated
 
TonyKent, Annihilannic

We successfully compiled Perl 5.8.8 using the ANSI compiler (after failing to do the same thing with Perl 5.14.1). So it would seem that higher version of Perl may be problematic.

We also succeeded in compiling the DBI (file: DBI-1.61), but get errors compiling the DBD versions 1.15 and 1.27(files DBD-ORACLE-1.15, DBD-ORACLE-1.27). These are the lowest and highest versions we found at CPAN.

Are these DBD versions compatible with Perl 5.8.8? If not, what version do you suggest we try?

Is there a Perl command that will tell us the DBD version that we have installed on our old boxes? The command "print $DBI::VERSION" gives 1.48 on our old box, but I did not find an equivalent variable for DBD.


Here are the output messages of the "make" command:

Code:
make

cp Oracle.pm blib/lib/DBD/Oracle.pm
cp oraperl.ph blib/lib/oraperl.ph
cp dbdimp.h blib/arch/auto/DBD/Oracle/dbdimp.h
cp ocitrace.h blib/arch/auto/DBD/Oracle/ocitrace.h
cp Oraperl.pm blib/lib/Oraperl.pm
cp Oracle.h blib/arch/auto/DBD/Oracle/Oracle.h
cp lib/DBD/Oracle/GetInfo.pm blib/lib/DBD/Oracle/GetInfo.pm
cp mk.pm blib/arch/auto/DBD/Oracle/mk.pm
        /bin/perl -p -e "s/~DRIVER~/Oracle/g" /opt/perl5/lib/site_perl/5.8.6/IA64.ARCHREV_0/auto/DBI/Driver.xst > Oracle.xsi
        /bin/perl /opt/perl5/lib/5.8.6/ExtUtils/xsubpp  -typemap /opt/perl5/lib/5.8.6/ExtUtils/typemap -typemap typemap  Oracle.xs > Oracle.xsc && mv Oracle.xsc Oracle.c
        cc -c  -I/users/oracle/app/oracle/product/112010/rdbms/public -I/opt/perl5/lib/site_perl/5.8.6/IA64.ARCHREV_0/auto/DBI  -Ae -D_HPUX_SOURCE -Wl,+vnocompatwarnings -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 +O2 +Onolimit    -DVERSION=\"1.15\"  -DXS_VERSION=\"1.15\" +Z "-I/opt/perl5/lib/5.8.6/IA64.ARCHREV_0/CORE"  -DUTF8_SUPPORT Oracle.c
        cc -c  -I/users/oracle/app/oracle/product/112010/rdbms/public -I/opt/perl5/lib/site_perl/5.8.6/IA64.ARCHREV_0/auto/DBI  -Ae -D_HPUX_SOURCE -Wl,+vnocompatwarnings -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 +O2 +Onolimit    -DVERSION=\"1.15\"  -DXS_VERSION=\"1.15\" +Z "-I/opt/perl5/lib/5.8.6/IA64.ARCHREV_0/CORE"  -DUTF8_SUPPORT dbdimp.c
"dbdimp.c", line 96: warning #2174-D: expression has no effect
        DBIh_EVENT2(drh, ERROR_event,
        ^

"dbdimp.c", line 176: warning #4276-D: relational operator ">" always
          evaluates to 'false'
      Newz(42, fb_ary->aindp,  size,        sb2);
      ^
"dbdimp.c", line 177: warning #4276-D: relational operator ">" always
          evaluates to 'false'
      Newz(42, fb_ary->arlen,  size,        ub2);
      ^
"dbdimp.c", line 178: warning #4276-D: relational operator ">" always
          evaluates to 'false'
      Newz(42, fb_ary->arcode, size,        ub2);
      ^
        cc -c  -I/users/oracle/app/oracle/product/112010/rdbms/public -I/opt/perl5/lib/site_perl/5.8.6/IA64.ARCHREV_0/auto/DBI  -Ae -D_HPUX_SOURCE -Wl,+vnocompatwarnings -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 +O2 +Onolimit    -DVERSION=\"1.15\"  -DXS_VERSION=\"1.15\" +Z "-I/opt/perl5/lib/5.8.6/IA64.ARCHREV_0/CORE"  -DUTF8_SUPPORT oci7.c
        cc -c  -I/users/oracle/app/oracle/product/112010/rdbms/public -I/opt/perl5/lib/site_perl/5.8.6/IA64.ARCHREV_0/auto/DBI  -Ae -D_HPUX_SOURCE -Wl,+vnocompatwarnings -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 +O2 +Onolimit    -DVERSION=\"1.15\"  -DXS_VERSION=\"1.15\" +Z "-I/opt/perl5/lib/5.8.6/IA64.ARCHREV_0/CORE"  -DUTF8_SUPPORT oci8.c
"oci8.c", line 134: warning #2236-D: controlling expression is constant
        && OCIErrorGet_log_stat(errhp, recno, (text*)NULL, &eg_errcode, errbuf,
           ^
"oci8.c", line 177: warning #2174-D: expression has no effect
      DBIh_EVENT2(h,
      ^
"oci8.c", line 986: warning #2186-D: pointless comparison of unsigned integer
          with zero

      if (long_readlen < 0)             /* trap any sillyness */
"oci8.c", line 676: warning #4276-D: relational operator ">" always evaluates
          to 'false'
        New(42, buffer, buflen, ub1);
        ^
"oci8.c", line 860: warning #4276-D: relational operator ">" always evaluates
          to 'false'
            New(42, buffer, alloclen, char);
            ^
"oci8.c", line 564: warning #2177-D: function "fetch_func_nty" was declared
          but never referenced
  fetch_func_nty(SV *sth, imp_fbh_t *fbh, SV *dest_sv)
  ^

"oci8.c", line 951: warning #2177-D: function "fbh_setup_getrefpv" was
          declared but never referenced
  fbh_setup_getrefpv(imp_fbh_t *fbh, int desc_t, char *bless)
  ^
Running Mkbootstrap for DBD::Oracle ()
        chmod 644 Oracle.bs
        rm -f blib/arch/auto/DBD/Oracle/Oracle.so
        LD_RUN_PATH="/users/oracle/app/oracle/product/112010/lib:/usr/lib/hpux32" /usr/bin/ld  -b +vnocompatwarnings -L/usr/local/lib -L/usr/lib/hpux32 Oracle.o  dbdimp.o  oci7.o  oci8.o  -o blib/arch/auto/DBD/Oracle/Oracle.so   -L/users/oracle/app/oracle/product/112010/lib -lclntsh -lrt -ldl -lm -lpthread -lnsl -lunwind -ldiskown
ld: Mismatched ABI for -lclntsh, found /users/oracle/app/oracle/product/112010/lib/libclntsh.so

Fatal error.

*** Error exit code 1
Stop.
 
Mismatched ABI (application binary interface) probably means that you are trying to link 32-bit and 64-bit components. A shot in the dark, but try CC='cc +DD64' make perhaps?

You may need to do that for the other components you have compiled too...

Annihilannic.
 
I compiled DBD-Oracle-1.19 with perl 5.8.8 with no problems, though I had to export the following variables before configuring:

ORACLE_HOME=/oracle01/product/8.1.7/64/a (or whatever the oracle home is)
ORACLE_SID=@UBRxxx03
ORACLE_USERID=build/build@UBRxxx02
ORACLE_USERID_2=build/build@UBRxxx03
 
Annihilannic

Where would I put that "CC" command? Is that a switch for "make"? I assume it is not an environment variable since you did not export it.

Can you give an approximate example?
 
Annihilannic

We tried the "make" command exactly the way you provided it. It gave the same results.

Being short of options, we will now try to do the installation under Oracle 10g (since we have also done it in the past on other boxes). If it fails with the same errors, we will question why this box is different than the others.

I will keep you posted
 
Exactly as I provided it was correct.

Specifying VAR=somevalue somecommand is the same as exporting it, but it is only for the duration of somecommand's execution.

Annihilannic.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top