in reply to Re: DBD::Oracle install on Mac OSX 10.8.5 (Mountain Lion) (mwahaha)
in thread DBD::Oracle install on Mac OSX 10.8.5 (Mountain Lion)

Thanks!

I got it all to work, all on 64bit, and sqlplus even works. Here's my process:

First, I followed mostly what was at this stackoverflow accepted solution.

To that end, I did the following:

I created the directory /Applications/instantclient_11_2.

I downloaded from Oracle the following packages (not sure they are all necessary, but they were sufficient):

instantclient-basic-macos.x64-11.2.0.3.0.zip instantclient-sdk-macos.x64-11.2.0.3.0.zip instantclient-sqlplus-macos.x64-11.2.0.3.0.zip

This was all in my ~/Downloads directory, and they all unzipped into a local 'instantclient_11_2' directory, and I copied all of the results of unzipping that to /Applications/instantclient_11_2.

Then I did the DBD::Oracle install (see following code), which fails to completely install, but at least gets the files down, which I deal with manually after this step.

sudo perl -MCPAN -e shell install DBD::Oracle

That code downloaded to my ~/.cpan/build directory, but per the stack overflow post, you can follow the directions there if that is not where you cpan build directory is.

Once there I had to cd into the ~/.cpan/build/DBD-Oracle-1.66-(something) directory, then sudo su root. Now, on MacOSX, root is not enabled by default, follow the directions here to get a root account enabled on your machine.

Now I was ready to build. I had to set two environment variables (while I'm root), like so:

export ORACLE_HOME=/Applications/instantclient_11_2 export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:/Applications/instantclien +t_11_2

to make this work. The second one is paramount because that's why you have to su to root and not just sudo it -- if you try to sudo this, the shell tells you that it doesn't pick up the DYLD_LIBRARY_PATH info. I don't know why, but there you go.

Now I was ready to do the

perl Makefile.pl make make install
commands (while in the module build directory as root).

This installed, and I got a ton of warnings, but it worked.

Good luck to you, hope you find these instructions if you hit the same problem I did...

Replies are listed 'Best First'.
Re^3: DBD::Oracle install on Mac OSX 10.8.5 (Mountain Lion) (mwahaha)
by cristianabs (Initiate) on Dec 05, 2013 at 17:25 UTC

    Well nice tutorial but I have a question, I did all you explain and I have Mountain Lion.. but at the end when I launch < perl example.pl > an error message appear like this:

    DBD::oracle initialisation failed: Can't locate object method "driver" + via package "DBD::oracle" at /System/Library/Perl/Extras/5.16/darwin +-thread-multi-2level/DBI.pm line 808. Perhaps the capitalisation of DBD 'oracle' isn't right. at Modulos/lib +/ConectarDB.pm line 17.

    and this is ConectarDB.pm

    #!/usr/bin/perl package ConectarDB; use strict; use DBI; # variables BD my $db_user = "example"; my $db_pass = "example"; my $host_name = "example"; my $db_name = "example"; # vars my $q_string = "DBI:oracle:host=$host_name;database=$db_name"; sub connect{ return (DBI->connect ($q_string, $db_user, $db_pass, {PrintError => 0, + RaiseError => 1})); } 1;

    So, I try again, but it never works, can you help me??

      Did you read the hint in the error message?

      Perhaps the capitalisation of DBD 'oracle' isn't right. at Modulos/lib +/ConectarDB.pm line 17.

      So, is your DBI connect string really supposed to say oracle? Should it maybe say Oracle?

        yes, I see that after I wrote to you, but now I have another problem, and it happen when I run perl (program).
        dyld: lazy symbol binding failed: Symbol not found: _OCIAttrSet Referenced from: /Library/Perl/5.16/darwin-thread-multi-2level/auto/ +DBD/Oracle/Oracle.bundle Expected in: flat namespace dyld: Symbol not found: _OCIAttrSet Referenced from: /Library/Perl/5.16/darwin-thread-multi-2level/auto/ +DBD/Oracle/Oracle.bundle Expected in: flat namespace
        I hope you can help me.. Thanks
Re^3: DBD::Oracle install on Mac OSX 10.8.5 (Mountain Lion) (mwahaha)
by pillmill (Initiate) on Feb 04, 2014 at 21:00 UTC
    Following these instructions, I got the following errors:
    Trying to find an ORACLE_HOME Found /Library/Oracle/instantclient_11_2 WARNING: Setting ORACLE_HOME env var to /Library/Oracle/instantclient_ +11_2 for you. WARNING: If these tests fail you may have to set ORACLE_HOME yourself! Installing on a darwin, Ver#12.0 Using Oracle in /Library/Oracle/instantclient_11_2 Use of uninitialized value $sqlplus_release in pattern match (m//) at +Makefile.pl line 1626. Use of uninitialized value $sqlplus_release in print at Makefile.pl li +ne 1635. Use of uninitialized value $sqlplus_release in pattern match (m//) at +Makefile.pl line 1636. If sqlplus failed due to a linker/symbol/relocation/library er +ror or similar problem then it's likely that you've not configured your environment c +orrectly. Specifically, your DYLD_LIBRARY_PATH environment variable set to include the directory containing the Oracle libraries. I'm having trouble finding your Oracle version number... trying harder WARNING: I could not determine Oracle client version so I'll just default to version 8.0.0.0. Some features of DBD::Oracle may not work. Oracle version based logic in Makefile.PL may produce erroneous result +s. You can use "perl Makefile.PL -V X.Y.Z" to specify a your client versi +on. Oracle version 8.0.0.0 (8.0) DBD::Oracle no longer supports Oracle client versions before 9.2 Try a version before 1.25 for 9 and 1.18 for 8! at Makefile.pl line 2 +71.

      Following these instructions, I got the following errors:

      And then what happened