I am new to Perl and I work in a Linux OEL 5x server. I am trying to configure the Perl DB modules for Oracle connectivity (DBD and DBI modules). Can anyone help me out in the installation procedure?

I had tried CPAN didn't really worked out. Any help would be appreciated. I am not quite sure I need to initialize any variables other than $LD_LIBRARY_PATH and $ORACLE_HOME

These are my observations:

ISSUE:: I am getting the following issue while using the DBI module to connect to Oracle:

install_driver(Oracle) failed: Can't locate loadable object for module DBD::Oracle in @INC (@INC contains: /usr/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/site_perl/5.8.8 /usr/lib/perl5/site_perl /usr/lib64/perl5/vendor_perl/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.8 /usr/lib/perl5/vendor_perl /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/5.8.8 .) at (eval 3) line 3
Compilation failed in require at (eval 3) line 3.
Perhaps a module that DBD::Oracle requires hasn't been fully installed
at connectdb.pl line 57

I had installed the DBD for oracle from /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/DBD/DBD-Oracle-1.50

Could you please take a look into the steps and correct me if I am wrong:



This is how I tried to install the DBD module:

  1. Download the file DBD 1.50 for Oracle
  2. Copy to /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/DBD
  3. Untar and Makefile.PL


Message:  Using DBI 1.52 (for perl 5.008008 on x86_64-linux-thread-multi) installed in /usr/lib64/perl5/vendor_perl/5.8.8/x86_64-linux-thread-multi/auto/DBI/

Configuring DBD::Oracle for perl 5.008008 on linux (x86_64-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 /opt/oracle/product/10.2
Oracle version (10.2)
Found /opt/oracle/product/10.2/rdbms/demo/demo_rdbms.mk
Found /opt/oracle/product/10.2/rdbms/demo/demo_rdbms64.mk
Found /opt/oracle/product/10.2/rdbms/lib/ins_rdbms.mk
Using /opt/oracle/product/10.2/rdbms/demo/demo_rdbms.mk
Your LD_LIBRARY_PATH env var is set to '/usr/local/oracle/ORA/lib:/usr/dt/lib:/usr/openwin/lib:/usr/local/oracle/ORA/ows/cartx/wodbc/1.0/util/lib:/usr/local/oracle/ORA/lib:/usr/local/sybase/OCS-12_0/lib:/usr/local/sybase/lib:/home/oracle/jdbc/jdbcoci73/lib:./'
WARNING: Your LD_LIBRARY_PATH env var doesn't include '/opt/oracle/product/10.2/lib' but probably needs to.
Reading /opt/oracle/product/10.2/rdbms/demo/demo_rdbms.mk
Reading /usr/local/oracle/ORA/rdbms/lib/env_rdbms.mk

Attempting to discover Oracle OCI build rules
sh: make: command not found
by executing: [make -f /opt/oracle/product/10.2/rdbms/demo/demo_rdbms.mk build ECHODO=echo ECHO=echo GENCLNTSH='echo genclntsh' CC=true OPTIMIZE= CCFLAGS= EXE=DBD_ORA_EXE OBJS=DBD_ORA_OBJ.o]
WARNING: Oracle build rule discovery failed (32512)
Add path to make command into your PATH environment variable.
Oracle oci build prolog:
    [sh: make: command not found]
Oracle oci build command:
WARNING: Unable to interpret Oracle build commands from /opt/oracle/product/10.2/rdbms/demo/demo_rdbms.mk.
(Will continue by using fallback approach.)
Please report this to dbi-users@perl.org. See README for what to include.

Found header files in /opt/oracle/product/10.2/rdbms/public.



Checking for functioning wait.ph

System: perl5.008008 linux ca-build9.us.oracle.com 2.6.20-1.3002.fc6xen #1 smp thu apr 30 18:08:39 pdt 2009 x86_64 x86_64 x86_64 gnulinux
Compiler:   gcc -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -pipe -Wdeclaration-after-statement -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm
Linker:     not found
Sysliblist: -ldl -lm -lpthread -lnsl -lirc
Oracle makefiles would have used these definitions but we override them:
  CC:       cc
       [$(GFLAG) -O3 $(CDEBUG) -m32 $(TRIGRAPHS_CCFLAGS) -fPIC -I/usr/local/oracle/ORA/rdbms/demo -I/usr/local/oracle/ORA/rdbms/public -I/usr/local/oracle/ORA/plsql/public -I/usr/local/oracle/ORA/network/public -DLINUX -D_GNU_SOURCE -D_LARGEFILE64_SOURCE=1 -D_LARGEFILE_SOURCE=1 -DSLTS_ENABLE -DSLMXMX_ENABLE -D_REENTRANT -DNS_THREADS -fno-strict-aliasing $(LPFLAGS) $(USRFLAGS)]
  build:     $(CC) $(ORALIBPATH) -o $(EXE) $(OBJS) $(OCISHAREDLIBS)
       [ cc -L$(LIBHOME) -L/usr/local/oracle/ORA/rdbms/lib/ -o $(EXE) $(OBJS) -lclntsh     $(EXPDLIBS) $(EXOSLIBS) -ldl -lm -lpthread -lnsl -lirc -ldl -lm $(USRLIBS) -lpthread]
       [-m32 -o $@ -L/usr/local/oracle/ORA/rdbms//lib32/ -L/usr/local/oracle/ORA/lib32/ -L/usr/local/oracle/ORA/lib32/stubs/]
Linking with /usr/local/oracle/ORA/rdbms/lib/defopt.o  -lclntsh -ldl -lm -lpthread -lnsl -lirc -ldl -lm -lpthread [from $(DEF_OPT) $(OCISHAREDLIBS)]

Checking if your kit is complete...
Looks good
Using DBD::Oracle 1.50.
Using DBD::Oracle 1.50.
Using DBI 1.52 (for perl 5.008008 on x86_64-linux-thread-multi) installed in /usr/lib64/perl5/vendor_perl/5.8.8/x86_64-linux-thread-multi/auto/DBI/
Writing Makefile for DBD::Oracle
Writing MYMETA.yml and MYMETA.json

***  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?)
  • > sh: make: command not found Your build environment appears to be broken. – Joshua Hoblitt Sep 12 '12 at 21:28
  • rpm -q make?? – quanta Sep 13 '12 at 8:16
  • They should be available in a repository rpm -ivh perl-DBD-oracle and possilby rpm -ivh perl-DBI if it also fails to build – charlesbridge Sep 13 '12 at 11:28

That's a pretty old version of Perl (released Jan 2006). I did manage to get to work for similar versions of each component but it never passed the build tests. Besides your LD_LIBRARY_PATH (some systems use a 64-bit version) and ORACLE_HOME, I had to be careful with default character set and locale to get this to work. Be careful too of having multiple homes. In the end, I installed Oracle's Instant Client separately and defined the real instance through tnsnames.

Redoing this later with newer software was much easier on a very similar system. So, upgrade if possible or use an Instant Client for a simpler environment.


please read this article I wrote with about How to install DBD::Oracle.

It contains all the steps required to install DBD::Oracle CPAN module, which is not a straightforward installation. The purpose is to reduce headache and turn it into a repeatable process.

Hope it can help, and also let me contribute back to the great Perl community.

  • 2
    Whilst this may theoretically answer the question, it would be preferable to include the essential parts of the answer here, and provide the link for reference. Link-only answers can become invalid if the linked page changes. – masegaloeh Dec 22 '14 at 14:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.