Skip to content

Compile DBD::Oracle on 64-Bit CentOS

I compiled the Perl DBD::Oracle  module on a CentOS 5.5 recently. It took a while to figure out, that the installed Oracle 10g Express Edition included just 32-Bit libs, but the Perl version was 64-Bit and the CentOS also. To solve the problem try this Howto:

Download Oracle Instant Client for Linux x86-64. Select the version you need. I need it to work with Oracle 10g XE, so I used 10.2.0.4. Download these rpms:

  • oracle-instaclient-base,
  • oracle-instaclient-sqlplus
  • oracle-instaclient-devel
  • oracle-instaclient-odbc

Install all rpms. If not already installed, install Perl with

yum install perl perl-DBI

We also need some libs and tools:

yum install gcc.x86_64 gcc-c++.x86_64 gcc-java.x86_64 libgcc.i386 libgcc.x86_64 compat-gcc-34.x86_64 compat-gcc-34-c++.x86_64 compat-gcc-34-g77.x86_64 compat-libgcc-296.i386 compat-libstdc++-33.i386 compat-libstdc++-33.x86_64

Now we need to set two enviroment variables:

export LD_LIBRARY_PATH /usr/lib/oracle/10.2.0.4/client64/lib/
export ORACLE_HOME /usr/lib/oracle/10.2.0.4/client64/

The next step is the compilation and installation of DBD::Oracle with CPAN-Shell(configuration needed, use defaults).

$> cpan
[cpan]> install DBD::Oracle

Persist the environment variables (/etc/profile.d/) if you DO NOT run the database on the same host. Otherwise you have to set the variables for the context you need them, e.g. in a Apache CGI:

SetEnv LD_LIBRARY_PATH  /usr/lib/oracle/10.2.0.4/client64/lib/

Hope you get it. If you have problems leave a comment.

2 Comments

  1. Robert Robert

    Hallo Patrick – dann bin ich der erste?

    Bei mir funktioniert der CPAN Install nicht – irgendwelche Empfehlungen von Dir?

    Failed 30/33 test scripts, 9.09% okay. 2/8 subtests failed, 75.00% okay.
    make: *** [test_dynamic] Error 255
    /usr/bin/make test — NOT OK
    Running make install
    make test had returned bad status, won’t install without force

    Systemumgebung:
    CentOS release 5.6 (Final)

    Linux 2.6.18-238.12.1.el5 #1 SMP Tue May 31 13:22:04 EDT 2011 x86_64 x86_64 x86_64 GNU/Linux

    Name : oracle-instantclient-basic Relocations: (not relocatable)
    Version : 10.2.0.4 Vendor: Oracle Corporation
    Name : oracle-instantclient-odbc Relocations: (not relocatable)
    Version : 10.2.0.4 Vendor: Oracle Corporation
    Name : oracle-instantclient-devel Relocations: (not relocatable)
    Version : 10.2.0.4 Vendor: Oracle Corporation
    Name : oracle-instantclient-sqlplus Relocations: (not relocatable)
    Version : 10.2.0.4 Vendor: Oracle Corporation

  2. Patrick Patrick

    Ich würde zunächst mal make bzw. make test manuell ausführen um eine Ausgabe zu sehen, in der (hoffentlich) Details stehen.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.