UseStrict Consulting

Professional IT Solutions & Training

Perl: Installing DBD::Oracle + Oracle Instant Client on Ubuntu 9.04

A couple of weeks ago I finally got a new laptop at work – which meant of course that I had to reinstall everything. Although we use Windows XP, there’s one app that I have to run through Linux. The solution was Sun’s VirtualBox running Ubuntu 9.04. When I tried to run the app, I realized that I still needed to install DBI and DBD::Oracle – 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, and Perl 5.10. Since we’re using the Instant Client, you’ll need some Oracle DB you can connect to in order to do the testing. You can choose to skip testing altogether, but you might be into a 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 (1.607), DBD::Oracle (1.22), PAR (0.983), pp (0.982), 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