The nightmare that is DBD::ORACLE on RHEL 5

Today I ran into a nagios machine that needed to check database stuff internally (connected users, corrupt blocks etc etc).. My perl scripts kept popping up errors about this oracle DBD.pm…. I have dealt with this in the past and I remember it being a nightmare…. I know there is some perl junky out there reading this saying ” Why didn’t you use cpan?”.. And in this case I would have rather have, but cpan was having issues with other perl modules and wasn’t worth my time… Any way here is how you can install DBD::ORACLE somewhat easily.

Firstly make sure you grab your dependencies..

compat-libstdc++-33-3.2.3-61.x86_64.rpm:

# wget ftp://rpmfind.net/linux/centos/5.11/os/x86_64/CentOS/compat-libstdc++-33-3.2.3-61.x86_64.rpm

 

oracle-lib-compat:

# wget http://spacewalk.redhat.com/yum/1.0/RHEL/5/x86_64/oracle-lib-compat-10.2-22.el5.x86_64.rpm

Now you need to grab the oracle instant client basic and sql plus .. I can’t post a snippit because you need to use your user credentials to grab it but here are the links with the version and everything you will need:

oracle-instantclient-basic-10.2.0.4-1.x86_64.rpm

oracle-instantclient-sqlplus-10.2.0.4-1.x86_64.rpm

Now that you have everything downloaded, go ahead and install them in the order you downloaded them in, using the “rpm -Uvh [filename].rpm” command. Once this is done we will need to set the LD_LIBRARY_PATH and the ORACLE_HOME paths in the environment (check this afterwards to make sure it took using the “env” command)..

# export ORACLE_HOME=/usr/lib/oracle/10.2.0.4/client64

# export LD_LIBRARY_PATH=/usr/lib/oracle/10.2.0.4/client64/lib

 

And last but not least download the perl-dbd-oracle rpm and install it using theĀ  “rpm -Uvh [filename].rpm” command again…

# wget http://spacewalk.redhat.com/yum/1.0/RHEL/5/x86_64/perl-DBD-Oracle-1.23-3.el5.x86_64.rpm

 

And now you should be all set….

 

 

 

 

Leave a Reply

Your email address will not be published.