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:
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.
Modify your .bashrc (or whatever) to set ORACLE_HOME and DYLIB_LIBRARY_PATH to /usr/local/instanclient_10_2.
Get DBD::Oracle from CPAN. (I got 1.22). Here is where it gets tricky: In Terminal:
% perl Makefile.PL
This generates Makefile.
Edit Makefile, changing: NMEDIT=nmedit to NMEDIT=echo
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.
Again, in Terminal:
% make && sudo make install
And that should do it.
Thanks a heap mate, this was all the information I needed to kick me in the right direction.
Him, Followed your instructions without success. Did “perl Makefile.PL -l ” first to include the SDK libraries (also tried without -l). Then edited Makefile, “make” runs okay. If I edit dbdimp.c then make fails. I can find three lines with dumpenvto_trace and have commented them out, is this all you meant?
If I run a test script I get:
dyld errors for _OCINlsEnvironmentVariabeGet
Mac OS X 10.5.6
Oracle 10.2.0
Perl 5.10.0
DBD:Oracle 1.23
Thanks for the tips, some other stuff.. I try on a MBP 2.5 C2D with 10.5.7. I download the last version of the oracle instanclient and i try 64bits… don’t work… work with 32bits version and perl Makefile.PL -l
Thank you for posting this, it worked, and now I feel like I’m living the dream again.
I know this is an old thread but just ran into the problem and this workaround worked perfectly. Thanks David.
@Rob – Don’t comment out the the method definition for dumpenvtotrace().. just comment out the lines where it is called. For me it was only used once on line 456:
if (DBIS->debug >= 6 || dbdverbose >= 6 )
/dump_env_to_trace();/
Cheers
I know this is an old thread but have been having problems. This workaround worked perfectly, thanks. But prior to finding the workaround I tried installing in CPAN sudo -MCPAN -e shell CPAN>install DBD::Oracle. Now I get this error whenever I run sqlplus:
dyld: Library not loaded: /b/227/rdbms/lib/libodm10.dylib
Referenced from: /Volumes/u01/app/oracle/product/10.2.0/db_1/bin/oracle
Reason: image not found
ERROR:
ORA-12547: TNS:lost contact
Workaround is to log in with @sid, e.g. sqlplus scott@sid. Anyone seen this? TIA.