I'm trying to connect to Oracle 10.2.0.4 on a remote system from my intel mac running OSX 10.6 snow leopard. I've tried using perl CPAN to install DBD::Oracle (DBI worked ok) but get compilation errors. Could someone provide an easy to follow guide?
相关问题
- $ENV{$variable} in perl
- Can I skip certificate verification oracle utl_htt
- Xcode debugger displays incorrect values for varia
- Is there a way to report errors in Apple documenta
- Advice for supporting both Mac and Windows Desktop
These are a great set of instructions. I have a few other comments about potential "gotchas".
Correction to this step
The last step should be
make install
During make, you may encounter an error that looks like :
To correct this you must edit the file "Makefile" created after the "perl Makefile.pl" step and remove all occurrences of the following text :
This will eliminate the error.
The same error described in (2.) will occur during the installation of the DBI module. You must edit the
Makefile
created after theperl Makefile.pl
step and remove all occurrences of the following text :Getting a mac install of perl to play nicely with oracle is a bit of a pain - once it's running it is fantastic, getting it running is a little frustrating..
The below has worked for me on a few different intel macs, there could well be superfluous steps in there and it is likely not going to be the same for other platforms.
This will require use of shell, the root user and a bit of CPANing - nothing too onerous
First off create a directory for the oracle pap - libraries, instant client etc
Download and extract all 64 bit instant client packages from oracle to the above directory
Create a symlink within that directory for one of the files in there
The following dir is hardcoded into the oracle instant client - god knows why - so need to create and symlink it
Need to add a couple of environment variables, so edit /etc/profile and add them so they exist for all users:
Now try and install DBD::Oracle through CPAN - this will fail, but it means any dependencies will be downloaded and it retrieves the module for us
When this fails exit CPAN and head to your .cpan/build dir - if you used automatic config of CPAN it'll be
if you didn't auto configure you can find your build directory with the following command in CPAN
Once in the build dir look for the DBD::Oracle dir which has just been created (it'll be called something like DBD-Oracle-1.28-?) and cd into it.
Now we need to switch to the root user. Root isn't enabled as default in osx - for details on enabling see this post on the apple website
Once logged in as root we need to set the above environment variables for root:
Now while still logged in as root we need to run the makefile for the module, then make, then install
Assuming that all worked without error log out of root: we're DBD'd up! If this didn't work it's time to bust out google on whatever errors you're seeing
Now just to install the DBI module
Now you're all set - enjoy your perly oracley new life
Additional info from user852637:
Correction to this step
The last step should be
make install
During make, you may encounter an error that looks like :
To correct this you must edit the file "Makefile" created after the "perl Makefile.pl" step and remove all occurrences of the following text :
This will eliminate the error.
The same error described in (2.) will occur during the installation of the DBI module. You must edit the
Makefile
created after theperl Makefile.pl
step and remove all occurrences of the following text :It looks with the XCode4 change (removal of PPC arch support) the Perl installation was not updated in any of the 10.6.X updates to also remove PPC binaries (probably because Rosetta is still present).
Because of this, the configuration files retain "-arch ppc" causing all CPAN module compiles with C libraries to fail because MakeMaker's output Makefile contains -arch ppc.
To fix this one can edit the following file:
at line 1219 you'll see:
change that to:
Once you do this the generated Makefile will be correct.
It seems as though the "Perl MakeFile.pl" command is not finding the version of Perl correctly and I get this error message:
If I force the version number like this:
It completes, but I receive the error message when running "make":
I realize this is because of the "-arch ppc" argument that needs to be removed from Makefile, but even after removal the removal of all 32-bit references, I still saw the error message.
Running 10.6.8 Snow Leopard with Oracle Driver version 10.2.0.4
I found that the key to this issue was making sure that MakeFile.pl could find the Oracle version.
The problem I ran into was that Safari was downloading the zip files from Oracle.com, but unzipping them and somehow corrupting the library.
Instead, I used a different browser and downloaded all the zip files into one directory. Then I ran the following tar commands:
The copy all the contents in the folder "instantclient_10_2" to $ORACLE_HOME (set previously)
Also, I did not need to edit the Makefile generated by the MakeFile.pl script to remove the "-arch ppc" references.
You should not recreate on your machine the same directory structure as of the client libraries packager.
Don't do
mkdir -p /b/227/rdbms/
Use MacOSX library header management tools:
otool
andinstall_name_tool
For instance, I have updated the library headers to my deployment architecture:
Check all files that come with the Oracle instantclient libraries and fix the path of all dependent libs
Then, you link your dynamic libraries to the place they're supposed to be.
And you can avoid using that
export DYLD_LIBRARY_PATH
because you know how to setup your system