How to install perl DBD::Oracle on SLES10 (without CPAN)

Written by - 0 comments

Published on - Listed in Linux Databases


Installing perl modules on SLES can be a pain, if the relevant rpm files don't exist. In this case I was looking for DBD::Oracle, which is a pre-requisite for the Nagios plugin check_oracle_health.

First, I was looking if an rpm package called perl-DBD-oracle already exists, but unfortunately all the rpm links I've found were dead. So I gave it a shot using CPAN:

cpan> install DBD::Oracle

But this failed because the actual DBD::Oracle package requires perl-DBI newer or equal than 1.51. SLES10 is using 1.50. As I'm not a huge fan of cpan installations, I decided not to try and force the installation but to do the manual path instead.

First you need to download the source file of perl-DBD-oracle (DBD::Oracle):

/tmp # wget http://www.perl.org/CPAN/authors/id/P/PY/PYTHIAN/DBD-Oracle-1.28.tar.gz
/tmp # tar -xvzf DBD-Oracle-1.28.tar.gz
/tmp # cd DBD-Oracle-1.28

Now if you launch 'perl Makefile.PL' the output will tell you that at least Perl-DBI 1.51 is required.
(I tried to change the entry in Makefile.PL, suggesting that 1.50 would be OK and 'perl Makefile.PL' worked fine then, but make failed badly.)

So we NEED at least 1.51. Yes, I know, SLES10 uses 1.50 but there's a small workaround: We can use the rpm's for opensuse 10.2:

/tmp # wget http://ftp.hosteurope.de/mirror/ftp.opensuse.org/discontinued/10.2/repo/oss/suse/i586/perl-DBI-1.52-17.i586.rpm
/tmp # rpm -ivh perl-DBI-1.52-17.i586.rpm

This rpm installed without trouble, without having had to update other rpm's or other perl modules. Maybe one could also try to install even newer versions but the newer the package is, the more dependencies could turn up from other packages.

To build perl-DBD-oracle, the Oracle library and header files are necessary. So you must install the following rpm's which you can find on opensuse.org:

  • oracle-instantclient-10.2.0.4-6.1.i386.rpm
  • oracle-instantclient-devel-10.2.0.4-6.1.i386.rpm
  • oracle-instantclient-sqlplus-10.2.0.4-4.1.i386.rpm

This will install the Oracle files into /usr/lib/oracle/10.2.0.4/client/ .

Finally all pre-requisites were installed and ready to go for the manual build of perl-DBD-oracle. Before the final commands are launched, be sure that you set the environment variables $ORACLE_HOME and $LD_LIBRARY_PATH according to your instantclient path:

/tmp # export ORACLE_HOME=/usr/lib/oracle/10.2.0.4/client/lib
/tmp # export LD_LIBRARY_PATH=$ORACLE_HOME
/tmp # cd DBD-Oracle-1.28
/tmp/DBD-Oracle-1.28 # perl Makefile.PL
Using DBI 1.52 (for perl 5.008008 on i586-linux-thread-multi) installed in /usr/lib/perl5/vendor_perl/5.8.8/i586-linux-thread-multi/auto/DBI/
Configuring DBD::Oracle for perl 5.008008 on linux (i586-linux-thread-multi)
Remember to actually *READ* the README file! Especially if you have any problems

Installing on a linux, Ver#2.6
Using Oracle in /usr/lib/oracle/10.2.0.4/client/lib
DEFINE _SQLPLUS_RELEASE = "1002000400" (CHAR)
Oracle version 10.2.0.4 (10.2)
Looks like an Instant Client installation, okay
Your LD_LIBRARY_PATH env var is set to '/usr/lib/oracle/10.2.0.4/client/lib'
Oracle sysliblist:
Found header files in /usr/include/oracle/10.2.0.4/client.

client_version=10.2

DEFINE= -Wall -Wno-comment -DUTF8_SUPPORT -DORA_OCI_VERSION=\"10.2.0.4\" -DORA_OCI_102

Checking for functioning wait.ph

System: perl5.008008 linux cara 2.6.16 #1 smp thu may 17 14:00:09 utc 2007 i686 i686 i386 gnulinux
Compiler:   cc -O2 -march=i586 -mtune=i686 -fmessage-length=0 -Wall -D_FORTIFY_SOURCE=2 -g -Wall -pipe -D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS -DDEBUGGING -fno-strict-aliasing -pipe -Wdeclaration-after-statement -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
Linker:     /usr/bin/ld
Sysliblist:
Linking with -lclntsh.

WARNING: META_MERGE is not a known parameter.
'META_MERGE' is not a known MakeMaker parameter name.
LD_RUN_PATH=/usr/lib/oracle/10.2.0.4/client/lib
Using DBD::Oracle 1.28.
Using DBD::Oracle 1.28.
Using DBI 1.52 (for perl 5.008008 on i586-linux-thread-multi) installed in /usr/lib/perl5/vendor_perl/5.8.8/i586-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?)
/tmp/DBD-Oracle-1.28 # make
/tmp/DBD-Oracle-1.28 # make install

 And this is it! perl-DBD-oracle is successfully installed as perl module!

Update February 17th 2012:
By the way the same procedure can also be applied on a SLES11 server! The installation of DBD::Oracle via cpan didn't work for me either, so I applied the same procedure as on SLES10.
The files are a little bit newer (oracle-instantclient) and the perl-DBI rpm (provided in the SLES11 source) works fine.


Add a comment

Show form to leave a comment

Comments (newest first)

No comments yet.

RSS feed

Blog Tags:

  AWS   Android   Ansible   Apache   Apple   Atlassian   BSD   Backup   Bash   Bluecoat   CMS   Chef   Cloud   Coding   Consul   Containers   CouchDB   DB   DNS   Databases   Docker   ELK   Elasticsearch   Filebeat   FreeBSD   Galera   Git   GlusterFS   Grafana   Graphics   HAProxy   HTML   Hacks   Hardware   Icinga   Influx   Internet   Java   KVM   Kibana   Kodi   Kubernetes   LVM   LXC   Linux   Logstash   Mac   Macintosh   Mail   MariaDB   Minio   MongoDB   Monitoring   Multimedia   MySQL   NFS   Nagios   Network   Nginx   OSSEC   OTRS   Observability   Office   OpenSearch   PHP   Perl   Personal   PostgreSQL   PowerDNS   Proxmox   Proxy   Python   Rancher   Rant   Redis   Roundcube   SSL   Samba   Seafile   Security   Shell   SmartOS   Solaris   Surveillance   Systemd   TLS   Tomcat   Ubuntu   Unix   VMWare   VMware   Varnish   Virtualization   Windows   Wireless   Wordpress   Wyse   ZFS   Zoneminder    Linux