How to install perl DBD :: Oracle on OSX Snow Leopard 10.6

I am trying to connect to Oracle 10.2.0.4 on a remote system from my Mac Mac running on the OSX 10.6 snow leopard. I tried using perl CPAN to install DBD :: Oracle (DBI worked fine) but get compilation errors. Can someone provide an easy to follow guide?

+3
source share
5 answers

Getting the mac perl installation for playing with the oracle is a bit of a pain - when it works, it is fantastic, its launch is a little disappointing.

Below I worked on several different Intel Macs, there may be extra steps, and probably it will not be the same for other platforms.

, root CPANing -

pap- oracle, ..

sudo mkdir /usr/oracle_instantClient64

64- oracle

sudo cd /usr/oracle_instantClient64
sudo ln -s /usr/oracle_instantClient64/libclntsh.dylib.10.1 libclntsh.dylib

dir oracle - -

sudo mkdir -p /b/227/rdbms/
sudo cd /b/227/rdbms/
sudo ln -s /usr/oracle_instantClient64/ lib

, /etc/profile , :

export ORACLE_HOME=/usr/oracle_instantClient64
export DYLD_LIBRARY_PATH=/usr/oracle_instantClient64

DBD:: Oracle CPAN - , , ,

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

CPAN .cpan/build dir - CPAN,

cd ~/.cpan/build

, CPAN

o conf build_dir

, dir dir DBD:: Oracle ( DBD-Oracle-1.28-?) cd.

root. Root osx - . -

root root:

export ORACLE_HOME=/usr/oracle_instantClient64
export DYLD_LIBRARY_PATH=/usr/oracle_instantClient64

, root, make , ,

perl Makefile.pl
make
make install

, , : DBD'd up! , google ,

DBI

sudo perl -MCPAN -e shell
install DBI

- oracley

852637:

  • perl Makefile.pl
    make
    install
    

    make install

  • make , :

    lipo: :/var/tmp//ccIevTzM.out( )

    , "Makefile", "perl Makefile.pl", :

    -arch ppc 
    

    .

  • , (2.), DBI. Makefile, perl Makefile.pl, :

    -arch ppc 
    
+4

XCode4 ( PPC), Perl ​​ 10.6.X, PPC (, , Rosetta ).

- "-arch ppc", - CPAN C, , MakeMaker Makefile -arch ppc.

, :

/System/Library/Perl/5.10.0/darwin-thread-multi-2level/Config_heavy.pl  

1219 :

$archflags = exists($ENV{ARCHFLAGS}) ? $ENV{ARCHFLAGS} : '-arch x86_64 -arch i386 -arch ppc';

:

$archflags = exists($ENV{ARCHFLAGS}) ? $ENV{ARCHFLAGS} : '-arch x86_64 -arch i386';

, Makefile .

+4

. "gotchas".

  • perl Makefile.pl
    make
    install
    

    make install

  • make , :

    lipo: :/var/tmp//ccIevTzM.out( )

    , "Makefile", "perl Makefile.pl", :

    -arch ppc 
    

    .

  • , (2.), DBI. Makefile, perl Makefile.pl, :

    -arch ppc 
    
+3

, Perl MakeFile.pl Perl , :

bash-3.2# perl Makefile.PL 
Multiple copies of Driver.xst found in: /Library/Perl/5.10.0/darwin-thread-multi-2level/auto/DBI/ /System/Library/Perl/Extras/5.10.0/darwin-thread-multi-2level/auto/DBI/ at Makefile.PL line 37
Using DBI 1.616 (for perl 5.010000 on darwin-thread-multi-2level) installed in /Library/Perl/5.10.0/darwin-thread-multi-2level/auto/DBI/

Configuring DBD::Oracle for perl 5.010000 on darwin (darwin-thread-multi-2level)

Remember to actually *READ* the README file! Especially if you have any problems.

Installing on a darwin, Ver#10.0
Using Oracle in /usr/oracle_instantClient64
Can't find sqlplus. Pity, it would have helped.
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 results.
You can use "perl Makefile.PL -V X.Y.Z" to specify a your client version.

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 175.

I've triple checked that I've downloaded and installed the proper 64-bit drivers from Oracle. I also checked to make sure that I'm running 64-bit Perl.

:

perl MakeFile.pl -V 10.2.0.4

, "make":

Oracle.c:2267: error: ‘SQLT_BIN’ undeclared (first use in this function)
Oracle.c:2277: error: ‘SQLCS_NCHAR’ undeclared (first use in this function)
Oracle.c:2281: error: ‘SQLT_INT’ undeclared (first use in this function)
Oracle.c:2283: error: ‘OCI_FETCH_PRIOR’ undeclared (first use in this function)
Oracle.c:2287: error: ‘OCI_FETCH_NEXT’ undeclared (first use in this function)
lipo: can't open input file: /var/tmp//ccyIFLPN.out (No such file or directory)
make: *** [Oracle.o] Error 1

, "-arch ppc", Makefile, 32- .

10.6.8 Snow Leopard Oracle 10.2.0.4

, , MakeFile.pl Oracle.

, , , Safari zip Oracle.com, - .

zip . tar:

tar -xf instantclient-basic-10.2.0.4.0-macosx-x64.zip 
tar -xf instantclient-sdk-10.2.0.4.0-macosx-x64.zip 
tar -xf instantclient-sqlplus-10.2.0.4.0-macosx-x64.zip

"instantclient_10_2" $ORACLE_HOME ( )

sudo cp -R instantclient_10_2/* $ORACLE_HOME

, Makefile, MakeFile.pl script, "-arch ppc".

+1

, .

mkdir -p /b/227/rdbms/

MacOSX: otool install_name_tool

, :

otool -L /usr/oracle_instantclient/11.2.0.3.0-64-bit/libclntsh.dylib.11.1
/usr/oracle_instantclient/11.2.0.3.0-64-bit/libclntsh.dylib.11.1:
    /ade/b/2649109290/oracle/rdbms/lib/libclntsh.dylib.11.1 (compatibility version 0.0.0, current version 0.0.0)
    /ade/b/2649109290/oracle/ldap/lib/libnnz11.dylib (compatibility version 0.0.0, current version 0.0.0)
    /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 159.1.0)

install_name_tool -id /usr/oracle_instantclient/11.2.0.3.0-64-bit/libclntsh.dylib.11.1 \
              -change /ade/b/2649109290/oracle/ldap/lib/libnnz11.dylib /usr/oracle_instantclient/11.2.0.3.0-64-bit/libnnz11.dylib /usr/oracle_instantclient/11.2.0.3.0-64-bit/libclntsh.dylib.11.1


otool -L /usr/oracle_instantclient/11.2.0.3.0-64-bit/libclntsh.dylib.11.1
/usr/oracle_instantclient/11.2.0.3.0-64-bit/libclntsh.dylib.11.1:
    /usr/oracle_instantclient/11.2.0.3.0-64-bit/libclntsh.dylib.11.1 (compatibility version 0.0.0, current version 0.0.0)
    /usr/oracle_instantclient/11.2.0.3.0-64-bit/libnnz11.dylib (compatibility version 0.0.0, current version 0.0.0)
    /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 159.1.0)

, Oracle instantclient,

otool -L adrci
otool -L genezi
otool -L libclntsh.dylib.11.1
otool -L libheteroxa11.dylib
otool -L libnnz11.dylib
otool -L libocci.dylib.11.1
otool -L libociei.dylib
otool -L libocijdbc11.dylib
otool -L libsqlplus.dylib
otool -L libsqlplusic.dylib
otool -L sqlplus
otool -L uidrvci

, .

export DYLD_LIBRARY_PATH, ,

cd /usr/lib
ln -s ../oracle_instantclient/11.2.0.3.0-64-bit/libclntsh.dylib.11.1 .
ln -s ../oracle_instantclient/11.2.0.3.0-64-bit/libclntsh.dylib.11.1 libclntsh.dylib
ln -s ../oracle_instantclient/11.2.0.3.0-64-bit/libheteroxa11.dylib .
ln -s ../oracle_instantclient/11.2.0.3.0-64-bit/libnnz11.dylib .
ln -s ../oracle_instantclient/11.2.0.3.0-64-bit/libocci.dylib.11.1 .
ln -s ../oracle_instantclient/11.2.0.3.0-64-bit/libocci.dylib.11.1 libocci.dylib
ln -s ../oracle_instantclient/11.2.0.3.0-64-bit/libociei.dylib .
ln -s ../oracle_instantclient/11.2.0.3.0-64-bit/libocijdbc11.dylib .
ln -s ../oracle_instantclient/11.2.0.3.0-64-bit/libsqlplus.dylib .
ln -s ../oracle_instantclient/11.2.0.3.0-64-bit/libsqlplusic.dylib .
+1

All Articles