Garrett, Philip (MAN-Corporate) wrote:
joe bayer wrote:
I just upgrade my Oracle to 10g to a new Oracle HOME. How could I
change the pointer of DBI and DBD::oracle to this new home before I
remove the old home?
You will need to rebuild DBD::Oracle against your new 10g Oracle
installation. Download DBD::Oracle from CPAN and follow the instructions
in the README.
Is there a way I can let DBI point to two Oracle HOMEs?
You can use a single DBD::Oracle installed with a single version of the
Oracle
client library (i.e., one Oracle HOME) and specify different Oracle
servers on
your connect string. The Oracle client library does not always have to
be exactly
the same version as the server instance. You don't want to mix very old
and new
combinations of client and server, but I would expect one version +/- to
usually
work unless you need new Oracle features that are not in the old
version. I have
not yet worked with 10g, so some of this is an educated guess, but I
have used
this with 8 and 9.
You can install DBD::Oracle into two different library locations and
then put those in your PERL5LIB (or perl -I/path/to/lib).
First, install for 9iR2:
$ export ORACLE_HOME=/path/to/oracle9iR2
$ perl Makefile.PL INSTALLSITELIB=$HOME/DBD-Oracle-9iR2
$ make test && make install
Now, install for 10g:
$ export ORACLE_HOME=/path/to/oracle10g
$ perl Makefile.PL INSTALLSITELIB=$HOME/DBD-Oracle-10g
$ make test && make install
Now, you can switch between them by changing ORACLE_HOME and PERL5LIB:
$ export ORACLE_HOME=/path/to/oracle10g
$ export PERL5LIB=$HOME/DBD-Oracle-10g:$PERL5LIB
$ ./script.pl # runs with 10g client
$ export ORACLE_HOME=/path/to/oracle9iR2
$ export PERL5LIB=$HOME/DBD-Oracle-9iR2:$PERL5LIB
$ ./script.pl # runs with 9i client
I think you'll also need to also point LD_LIBRARY_PATH at
$ORACLE_HOME/lib.
- Philip