develooper Front page | perl.dbi.users | Postings from February 2005

DBD-Oracle and Oracle Instant Client recipe

Thread Next
From:
Tim Barrass
Date:
February 17, 2005 06:58
Subject:
DBD-Oracle and Oracle Instant Client recipe
Message ID:
d3e22fa9ef501e7b6c9a9320641f2cf9@physics.org
Not sure if this has been solved already, but here's how I built  
DBD-Oracle against the Oracle Instant Client ..

Build DBD against Oracle Instant Client SDK

Building on ScientificLinux3, perl 5.8.0 (basically RHE3).

Need OIC version 10.1.0.3. Download the basic, sqlplus and devel zips.  
You need to rejiggle the files (not many) to form a reasonable  
directory structure. Assume $BASE holds your top level directory for  
installation, then:

mkdir $BASE
cd $BASE
# download instantclient-basic-linux32-10.1.0.3.zip
# download instantclient-sqlplus-linux32-10.1.0.3.zip
# download instantclient-sdk-linux32-10.1.0.3.zip
unzip *.zip # creates dir instantclient10_1
export ORACLE_HOME=${BASE}/instantclient10_1
cd $ORACLE_HOME
ln -s libclntsh.so.10.1 libclntsh.so
mkdir lib
mkdir bin
mkdir java
mv lib* lib
mv sqlplus bin
mv glogin.sql bin
mv *jar java
mv sdk/demo .
mv sdk/include .
rm -fr sdk
export PATH=$ORACLE_HOME/bin:$PATH
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:$LD_LIBRARY_PATH
export SQLPATH=$ORACLE_HOME/bin
cd ..
mkdir perl-modules
cd perl-modules
wget  
http://search.cpan.org/CPAN/authors/id/T/TI/TIMB/DBD-Oracle-1.16.tar.gz
tar zxvf DBD-Oracle-1.16.tar.gz

# Need to edit the Makefile.PL- here's my diff
diff Makefile.PL.orig Makefile.PL
1122a1123,1126
 >     # Tim Barrass: hacked for Oracle Instant Client
 >     if ( $OH =~ /instantclient/ ) {
 >         $linkvia = "$ENV{ORACLE_HOME}/lib/libclntsh.so";
 >     }
1254a1259
 >        "$OH/include", # Tim Barrass, hacked for OIC install from zips

perl Makefile.PL prefix=$BASE/perl-modules -m $ORACLE_HOME/demo/demo.mk

# If you see WARNING: I could not determine Oracle client version ...
# remove the trailing slash from ORACLE_HOME

make
make install

# Create and environment script
export BASE=<your base dir>
export ORACLE_HOME=${BASE}/instantclient10_1
export LD_LIBRARY_PATH=${ORACLE_HOME}/lib:${LD_LIBRARY_PATH}
export PATH=${ORACLE_HOME}/bin:${PATH}
export SQLPATH=${ORACLE_HOME}/bin
# Note the trailing end of perl5lib might vary with architecture-
# look out for where your DBD-Oracle actually gets installed
export  
PERL5LIB=${ORACLE_HOME}/perl-modules/lib/perl5/site_perl/5.8.0/i386- 
linux-thread-multi
export TNS_ADMIN=<path to your tnsnames.ora file>

# test at will ...

Cheers,
Tim


Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About