Install DBD::Oracle and Oracle Instant Client on Ubuntu

Update: If you’re looking for instructions for Ubuntu 12.04 and later, most of the steps below still apply, but there are a few small differences nicely explained by Rob Staveley at http://bimport.blogspot.com.au/2012/05/using-perl-dbi-with-oracle.html

Update 2: It turns out these steps can be used for Cygwin as well. Thanks to Marc for pointing it out.

A couple of weeks few years ago I finally got a new laptop at work – which meant of course that I had to reinstall everything. Although we used Windows XP, there was one app that I had to run through Linux. The solution was VirtualBox running Ubuntu. When I tried to run the app, I realized that I still needed to Install DBD::Oracle and Oracle Instant Client on Ubuntu – which brings me to this article. Nothing better than a reinstall to generate article material 🙂

DBD::Oracle is usually a pain to install if you haven’t already done it a gazillion times. After that, it’s just an annoying itch. In this article I’ll cover installing DBD::Oracle using Oracle Instant Client, Ubuntu 9.04 (at the time – I’ve had reports that this works on 12.04 and up), and Perl 5.10. Since we’re using the Instant Client, you’ll need an Oracle DB you can connect to in order to do the testing. You can choose to skip testing altogether, but you might be into an unpleasant surprise later. Continue Reading…

Perl: Connecting to an Oracle database WITHOUT having an installed client

I started this post with the intention of having it be a quickie, just showing people how to connect to Oracle with Perl/DBI without having to have Oracle client or even Perl installed, but it’s not that simple.  So I decided to rewrite it with detailed instructions.

Here is a list of what I used:

Machine: Sun Solaris SPARC on build and target machines
Oracle: Oracle 10g client (build machine only)
Perl: v. 5.10.0 (build machine only)
Perl modules: DBI, DBD::Oracle (1.22), PAR (1.008), pp (1.025), PerlIO (1.04) (build machine only)

Continue Reading…

DBD::Oracle + Cygwin: Undefined reference error during make

Yesterday I found myself in a position of having to re-master my computer – hence having to reinstall most of the applications including my trusty Cygwin – which always becomes somewhat of a headache when I reach the point of installing DBD::Oracle in it.

This time I got a undefined symbol error. A quick look in Google showed me that Erik Squires had the same exact problem. Lots of searching later, I find that Google can’t find a handy solution anywhere… So I send Erik an email asking about the solution and to my surprise, he answers only 1 (!!) minute after I click send. Talk about a fast reply!!

Hats off to Erik! You will find the solution here: http://cpae.typepad.com/capacity_planning_and_eng/

Hint: the oci.def that he mentions in his post is inside your DBD::Oracle build directory. Don’t get it confused with ocidef.h file in your $ORACLE_HOME/oci/include directory (that’s where I looked first).

I’m adding the error message below with a big SOLUTION header for any Googler out there having the same problem. No need to keep reading if the text above was enough to solve your problem.

Continue Reading…