Manual installation of DBD::Oracle Perl module on Debian Squeeze

The module DBD::Oracle can not be installed with apt-get despite that libdbd-oracle-perl is available in the Debian repositories.
This package requires an Oracle client which is not available by default.
Trying to install libdbd-oracle-perl leads us to the errors below :

The following packages have unmet dependencies:
libdbd-oracle-perl: Depends: oracle-instantclient-basic but it is not installable
E: Broken packages

Supposing you already have a functional Oracle database, such Oracle-XE, please install Oracle-XE client. It is free for use as development purpose.
Then, we will install the Perl module DBD::Oracle with CPAN :

root@localhost:~# perl -MCPAN -e shell

and we get the CPAN client prompt :
cpan[1]> install DBD::Oracle

You might encounter some errors and the “make test” process will fail.
Quit your CPAN client and set two compulsory environment variables :

root@localhost:~# export ORACLE_HOME=/usr/lib/oracle/xe/app/oracle/product/10.2.0/server
root@localhost:~ # export ORACLE_SID=XE

As a non-root user, please connect to your Oracle database, XE, and check whether the user SCOTT is created and has two roles : connect and resource. As a precaution, reset SCOTT’s password to ‘TIGER’.

Relaunch your CPAN client and reinstall the module DBD::Oracle :
cpan[1]> install DBD::Oracle

The process will not be long and at the end, a script is automatically run to check that connections to the database with the credentials SCOTT/TIGER work well with the DBD::Oracle module.

Quit your CPAN client. Please verify that DBD::Oracle is available in the Perl path variable @INC :

root@localhost:~# perldoc -l DBD::Oracle

For more information about installing Oracle-XE on Debian :


2 thoughts on “Manual installation of DBD::Oracle Perl module on Debian Squeeze

  1. This is a little lacking and leaves a default user SCOTT/TIGER set up on your database.
    This user is all over the internet so will be in many scipt kiddies default hack scripts.

    Also installing DBD-Oracle on debian when you are hosting the Oracle database is easy, hardly worth a guide… what about when the DB is remote..

  2. This user and all his objects can be dropped at the end of the installation. What would you like to do exactly with a remote DB? How to set up a connection with the DBD::Oracle Perl module with a remote DB?

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.