Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Perl DBD::Oracle Module installation

Tags:

Could someone guide me how to install the Perl DBD::Oracle module?

Here is what I have done so far:

  • Platform: RHEL 5.8 64 bit
  • Installed Perl DBI package
  • Installed Oracle Instant client for Linux 64 bit (basi + sdk + sqlplus component for the instant client
  • Have set the correct $ORACLE_HOME and $LD_LIBRARY_PATH
  • Then when I do perl Makefile.pl it fails with the following error:

    I'm having trouble finding your Oracle version number... trying harder  WARNING: I could not determine Oracle client version so I'll just default to version 8.0.0.0. Some features of DBD::Oracle may not work. Oracle version based logic in Makefile.PL may produce erroneous results. You can use "perl Makefile.PL -V X.Y.Z" to specify a your client version.  Oracle version 8.0.0.0 (8.0) DBD::Oracle no longer supports Oracle client versions before 9.2  Try a version before 1.25 for 9 and 1.18 for 8! at Makefile.PL line 271. 
  • The instant client version: 11.1.0

  • The DBD::Oracle version is 1.44

If you have installed successfully with the Oracle instant client, then could you please let me know what am I missing?

Is it possible to install DBD::Oracle without using the Oracle instant client?

like image 652
slayedbylucifer Avatar asked Jul 10 '12 06:07

slayedbylucifer


People also ask

Can't locate DBI pm in @INC (@ INC contains?

DBI isn't in your @INC path, which tells perl where to look for custom modules. This is probably because you've installed them using the cpan tool as a non-root user, which won't have write access to the default include paths. You will need to locate DBI.pm and other packages, and move them into your @INC path.

Does Oracle use Perl?

Perl is a powerful scripting language that supports Oracle integration and is available on almost all operating systems. It is also included with the Oracle 10g and Oracle 11g database server.


1 Answers

  • Install if missing ExtUtils-MakeMaker module (sudo yum install perl-ExtUtils-MakeMaker)
  • Install Perl DBI module ($ yum install perl-DBI)
  • Manually install below three RPMs for Oracle instant client (from Instant Client Downloads for Linux x86-64. The example is for v11.2.0.3.0-1: adapt the commands below to the actual version.)

    oracle-instantclient11.2-basic-11.2.0.3.0-1 oracle-instantclient11.2-devel-11.2.0.3.0-1 oracle-instantclient11.2-sqlplus-11.2.0.3.0-1 

I am using 64 bit Linux box, so select your RPM filenames accordingly. Something like sudo yum -y install oracle-instantclient*rpm should do)

  • set below variables:

    export LD_LIBRARY_PATH=/usr/lib/oracle/11.2/client64/lib export ORACLE_HOME=/usr/lib/oracle/11.2/client64 

    MacOS users will need:

    DYLD_LIBRARY_PATH=/usr/lib/oracle/11.2/client64/ 

    Also add ORACLE_HOME to your PATH variable.

  • download DBD::Oracle from CPAN

  • untar the module and run below commands in given sequence:

    perl Makefile.PL make sudo make install 

In case you get complaints about missing gcc you can (temporarily) install it and then remove it.

DONE !!!

Issues I had faced were due to the wrong LD_LIBRARY_PATH. I had set it to /usr/lib/oracle/11.2/client64 whereas the correct value is /usr/lib/oracle/11.2/client64/lib.

Certainly, this was a great learning for a newbie like me.

like image 106
slayedbylucifer Avatar answered Feb 12 '23 21:02

slayedbylucifer