Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using Oracle with Perl

I've been trying to install the perl-DBD-Oracle-1.19-1.el5.x86_64.rpm package all day. It keeps giving me the below error:

perl-DBD-Oracle-1.19-1.el5.x86_64 from /perl-DBD-Oracle-1.19-1.el5.x86_64 has depsolving problems
  --> Missing Dependency: libnnz10.so()(64bit) is needed by package perl-DBD-Oracle-1.19-    1.el5.x86_64 (/perl-DBD-Oracle-1.19-1.el5.x86_64)
perl-DBD-Oracle-1.19-1.el5.x86_64 from /perl-DBD-Oracle-1.19-1.el5.x86_64 has depsolving problems
  --> Missing Dependency: libocci.so.10.1()(64bit) is needed by package perl-DBD-Oracle-1.19-1.el5.x86_64 (/perl-DBD-Oracle-1.19-1.el5.x86_64)
perl-DBD-Oracle-1.19-1.el5.x86_64 from /perl-DBD-Oracle-1.19-1.el5.x86_64 has depsolving problems
  --> Missing Dependency: libocijdbc10.so()(64bit) is needed by package perl-DBD-Oracle-1.19-1.el5.x86_64 (/perl-DBD-Oracle-1.19-1.el5.x86_64)
perl-DBD-Oracle-1.19-1.el5.x86_64 from /perl-DBD-Oracle-1.19-1.el5.x86_64 has depsolving problems
  --> Missing Dependency: libclntsh.so.10.1()(64bit) is needed by package perl-DBD-Oracle-1.19-1.el5.x86_64 (/perl-DBD-Oracle-1.19-1.el5.x86_64)
perl-DBD-Oracle-1.19-1.el5.x86_64 from /perl-DBD-Oracle-1.19-1.el5.x86_64 has depsolving problems
  --> Missing Dependency: libociei.so()(64bit) is needed by package perl-DBD-Oracle-1.19-1.el5.x86_64 (/perl-DBD-Oracle-1.19-1.el5.x86_64)

As far as I know I have all the correct libraries installed, ie

oracle-instantclient-basic-10.2.0.5-1.x86_64.rpm
oracle-instantclient-devel-10.2.0.5-1.x86_64.rpm
oracle-instantclient-sqlplus-10.2.0.5-1.x86_64.rpm
perl-DBI-1.52-2.el5.x86_64.rpm

and all of the files it complains are missing are installed, eg the first dependency it claims is missing is libnnz10.so but this is installed in /usr/lib/oracle/10.2.0.5/client64/lib/libnnz10.so. Also if I ask yum to resolve this dependency then it does, eg

> yum provides */libnnz10.so
Loaded plugins: product-id, security, subscription-manager
Updating Red Hat repositories.
Excluding Packages in global exclude list
Finished
oracle-instantclient-basic-10.2.0.5-1.x86_64 : Instant Client for Oracle Database 10g
Repo        : installed
Matched from:
Filename    : /usr/lib/oracle/10.2.0.5/client64/lib/libnnz10.so

I have set the variable of

ORACLE_HOME="/usr/lib/oracle/10.2.0.5/client64"
LD_LIBRARY_PATH="/usr/lib/oracle/10.2.0.5/client64/lib"

I have also added the lib dir above to the path.

So why does yum say that it can resolve it but then says it can't?

like image 432
MikeKulls Avatar asked Jan 30 '26 16:01

MikeKulls


1 Answers

DBD::Oracle is one of the most notoriously difficult well-known CPAN modules to install. I've installed many CPAN modules over the last decade and every time I have to install DBD::Oracle I take a sharp intake of breath and prepare for hours of pain.

I recently installed DBD::Oracle on a 64-bit Ubuntu 12.04.2 LTS desktop. Let me see if I can remember what I did.

From the Oracle site I downloaded:

  • instantclient-basic-linux.x64-11.2.0.3.0.zip
  • instantclient-sdk-linux.x64-11.2.0.3.0.zip
  • instantclient-sqlplus-linux.x64-11.2.0.3.0.zip

I made a directory /usr/local/oracle, changed to that directory, and unzipped all three files.

Then I ran:

LD_LIBRARY_PATH=/usr/local/oracle/instantclient_11_2 \
  ORACLE_HOME=/usr/local/oracle/instantclient_11_2 \
  cpan DBD::Oracle

I might have left something out. Good luck.

like image 133
PP. Avatar answered Feb 02 '26 07:02

PP.