Hi,
Just attempted to install DBD::Oracle 1.19 on an Ubuntu Server 7.04
Feisty machine running Perl v5.8.8 (and instant client
10.2.0.3-20061115) and hit a problem with the Makefile.PL not being able
to determine my Oracle version. The symptom is:
==========
WARNING: Setting ORACLE_HOME env var to /home/XXX/instantclient_10_2/
for you.
WARNING: The tests will probably fail unless you set ORACLE_HOME yourself!
Using Oracle in /home/XXX/instantclient_10_2/
Error 6 initializing SQL*Plus
Message file sp1<lang>.msb not found
SP2-0750: You may need to set ORACLE_HOME to your Oracle software directory
<warnings here>
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)
Looks like an Instant Client installation, okay
==========
The real problem is that if you set ORACLE_HOME (which Makefile.PL does)
sqlplus does not work e.g.,
# echo $ORACLE_HOME
# ./instantclient_10_2/sqlplus -S /nolog \@/tmp/x.sql 2>&1
DEFINE _SQLPLUS_RELEASE = "1002000300" (CHAR)
# ORACLE_HOME=/home/XXX/instantclient_10_2/ ./instantclient_10_2/sqlplus
-S /nolog \@/tmp/x.sql 2>&1
Error 6 initializing SQL*Plus
Message file sp1<lang>.msb not found
SP2-0750: You may need to set ORACLE_HOME to your Oracle software directory
Contrary to the SP2-0750 error and description, Oracle's advice (on
their web page) for using InstantClient is NOT to set ORACLE_HOME but to
set LD_LIBRARY_PATH (or configure the dynamic linker using ldconfig
etc). I can't remember now exactly what the issue was but I've had other
problems using instant client with ORACLE_HOME set before. I don't think
DBD::Oracle's Makefile.PL should set ORACLE_HOME if it detects instant
client however, it is so ingrained in the Makefile.PL it might
compromise some other installation path to remove it. As a workaround (I
know not pretty) I changed Makefile.PL in get_client_version() around
line 1473 as follows:
open FH, ">define.sql" or warn "Can't create define.sql: $!";
print FH "DEFINE _SQLPLUS_RELEASE\nQUIT\n";
close FH;
my $sqlplus_release = `$sqlplus_exe -S /nolog [EMAIL PROTECTED] 2>&1`;
# +MJE
if ($sqlplus_release =~ /SP2-0750/) {
my $x = $ENV{ORACLE_HOME};
delete $ENV{ORACLE_HOME};
$sqlplus_release = `$sqlplus_exe -S /nolog [EMAIL PROTECTED] 2>&1`;
$ENV{ORACLE_HOME} = $x;
}
# -MJE
unlink "define.sql";
Originally, I just deleted ORACLE_HOME but it is used all over the place
later and led to use of uninitialised variable warnings.
Once change made the outcome is:
==========
WARNING: Setting ORACLE_HOME env var to /home/XXX/instantclient_10_2/
for you.
WARNING: The tests will probably fail unless you set ORACLE_HOME yourself!
Using Oracle in /home/XXX/instantclient_10_2/
DEFINE _SQLPLUS_RELEASE = "1002000300" (CHAR)
Oracle version 10.2.0.3 (10.2)
Looks like an Instant Client installation, okay
Your LD_LIBRARY_PATH env var is set to '/home/XXX/instantclient_10_2/'
==========
Martin
--
Martin J. Evans
Easysoft Limited
http://www.easysoft.com
--
Martin J. Evans
Easysoft Limited
http://www.easysoft.com