davidb dives in

various musings and babblings.

How to Install DBD::Oracle on Mac OS X

| Comments

Today, I figured out how to get DBD::Oracle to work on Mac OS X Leopard (intel). Since it isn’t (yet) entirely straightforward, I thought I’d describe the process here:

  1. Install instantclient. You will need the basic and sdk modules. I suggest also getting the sqlplus module while you are at it. I put this in /usr/local/instantclient_10_2.
  2. Modify your .bashrc (or whatever) to set ORACLE_HOME and DYLIB_LIBRARY_PATH to /usr/local/instanclient_10_2.
  3. Get DBD::Oracle from CPAN. (I got 1.22). Here is where it gets tricky: In Terminal:

    % perl Makefile.PL

    This generates Makefile.

  4. Edit Makefile, changing: NMEDIT=nmedit to NMEDIT=echo
  5. Edit dbimp.c, removing all code that references dump_env_to_trace(). I found a patch at macosxhints.com, but this is tied to a particular release of DBD::Oracle. I decided to use my mad programming skillz to logically do what was needed. Hopefully this will be fixed in some future version of DBD::Oracle.
  6. Again, in Terminal:

    % make && sudo make install

And that should do it.

Comments