Build your professional network on facebook via our app Go to app
 
 
 
Industry : IT Products
Functional Area : Application Software
Activity: Question posted: 06 02 2008 23:51:42 +0000, 2 answers, 105 views, last activity 07 06 2010 20:18:08 +0000
 
Share
 
 
  Rate : 
 
 
  Answered by     sachin , Team Leader -(NonTechnical), Infor Global Solutions  | 06 03 2008 05:44:29 +0000
[ Delete ]
[ Edit ]
Not Rated

Oracle has an "instant client" for Mac OS X and it's available for free from their site. Unfortunately it's PowerPC only and nobody knows when they going to release an Intel or Universal version. It works through Rosetta though and if you just install the client as they say, you may use sqlplus and other PowerPC applications linked with that client this way.

The problem for me was that I couldn't use those libraries with Perl: DBD::Oracle just wouldn't build properly, because by default gcc builds everything for Intel only, and this code cannot be linked with PowerPC libraries. So the idea is simple: run Perl through Rosetta when you have to deal with Oracle and everything should be fine.

Here are step-by-step instructions showing how I made it work. I assume that the Oracle instant client is already installed and works; I used version 10.1.0.3. Also, make a backup. Nothing special happens here, but you never know.

1. We need to create a PowerPC-only Perl binary. To do this type this command in Terminal:
sudo lipo -thin ppc -output /usr/bin/perl.ppc /usr/bin/perl 
Perl in Mac OS X 10.4 is universal and the command simply copies it's PowerPC part to file perl.ppc. The original perl binary is still universal and is not changed in any way.

2. We need universal DBI (DBD::Oracle is just a driver for DBI). Download the latest DBI (version 1.52 at the moment), extract it and go to the DBI-1.52 directory. Here you need to create a directory named "hints" and create the file darwin.pl with this content:
#!/usr/bin/perl

$arch = "-arch i386 -arch ppc";
print "Adding $archn";

$self->{CCFLAGS} = "$arch $Config{ccflags}";
$self->{LDFLAGS} = "$arch $Config{ldflags}";
$self->{LDDLFLAGS} = "$arch $Config{lddlflags}";

3. Do regular:
perl Makefile.PL
make
make test
sudo make install
"make test" will test the Intel instance of the DBI, but if you use perl.ppc in the first line instead of perl it will run all tests through Rosetta through PowerPC instance of the DBI.

Now we have the universal DBI installed.

4. Download DBD::Oracle. I used version 1.18a. Again extract it, go to the newly created DBD-Oracle-1.18, create a directory named "hints", and put there darwin.pl with slightly different content:

#!/usr/bin/perl

$arch = "-arch ppc";
print "Adding $archn";

$self->{CCFLAGS} = "$arch $Config{ccflags}";
$self->{LDFLAGS} = "$arch $Config{ldflags}";
$self->{LDDLFLAGS} = "$arch $Config{lddlflags}";
5. Again, but with the perl.ppc we created before:

perl.ppc Makefile.PL
make
make test
sudo make install
"make test" may or may not work depending on your setup: check the documentation for DBD::Oracle for details.

That's it - now we have everything installed and your old scripts should just work if instead of regular /usr/bin/perl you use /usr/bin/perl.ppc. DBI is universal and should work for Intel and PowerPC. The only problem is that Perl in Rosetta works a lot slower, but I guess this is better than nothing.

  Answered by     Arun Sarin, Business Analyst, Oracle  | 06 02 2008 23:52:37 +0000
[ Delete ]
[ Edit ]
Not Rated

The problem is newer mac's which use x86 processors thus the perl compiled on them runs natively, DBI requires certain Oracle libraries. the Oracle libraries available for mac are ppc only and run in a emulated mode via rosetta. There is no way get DBI to work on intel mac unless you build a ppc only version of perl or convince Oracle that they need to release a intel version of Oracle for mac.

 
Leading HR Outsourcing Company
MindsDirect is an initiative focusing on providing Strategic, Tactical and Operational HR solutions and services to organizations in India. Over years of experience we found that it is imperative for organizations to have a creative and concrete HR team that provides seamless services to their......
Viewers also viewed
Though media vs Self
 
157 referals 105 arguments, 3016 views
Windows the very word which changed how we use our PC's and other Computer or laptop related...
 
1317 referals 32 arguments, 485 views
more...  
Unanswered Questions (68)
While selling Loans Different types of Loans what policy one should adopt to build the Brand and...
 
0 referals 0 answers, 0 views
I mean that it sector totally depends on outsourcing.But it might happen that in future other...
 
0 referals 0 answers, 0 views
More From Author
There are many people who are apple computer users across the world Mr. Dikshit and this tablet PC will surely change the way one uses a PC with everything just happening by a touch and the way the iphone's success one saw is rest assured that Apple's...
hi, I also support that the Inner self is the best God. Listen to that. But most of the time we do not listen that. But that give us the best Idea at the time of difficulty.
To me, if one wants to be a good product manager then one should be able to adapt his/her practices to the organization and situation. Product management is not yet an advanced science. Instead of laws and rules, one has guidelines and experiences to...
more...