Connect failure: OCIEnvNlsCreate (check ORACLE_HOME and NLS settingsetc.)
am 25.08.2005 16:16:48 von VictorHello all,
I've searched and found a few references to the above error, but none
that seems to suit my situation. I wonder if anyone here may have an
idea of what I should look for next...
I have a pretty straightforward setup (I hope!):
Database server on box "DB" :
Oracle Database 10g Release 10.1.0.3.0 - 64bit Production
Red Hat Enterprise Linux ES release 3 (Taroon Update 5), kernel
2.4.21-27.elsmp
Web server on box "WS" :
Perl 5.8.0
Apache 2.0.46
mod_perl is configured into the Apache by default but I am NOT using it
Oracle Instant Client 10.2
Red Hat Enterprise Linux ES release 3 (Taroon Update 5), kernel
2.4.21-23.elsmp
Also a development system on box "Dev":
perl 5.8.0
Oracle 8.1.7
Red Hat Fedora Core 3, kernel 2.4.18-11smp
Oracle Instant Client on WS has been set up following the 'recipe' (Tim
Barrass, 2/17/05 in this group). WS has a copy of tnsnames.ora
identifying both DB and Dev services.
WS Instant Client can connect to databases on DB and on Dev using
sqlplus from command-line.
As a check, Dev can connect to DB using sqlplus from command-line.
Here's the odd thing...
With a test script run from the command line, WS can connect to DB or to
Dev using DBD::Oracle.
From a CGI perl script it can't. Instead I see the dreaded
OCIEnvNlsCreate (check ORACLE_HOME and NLS settings etc.)
Both the manual test script (which works) and the CGI script (that
doesn't) make use of the same environment-setting comands, imported from
a "require"d file:
package dbProperties;
require Exporter;
@ISA=qw(Exporter);
@EXPORT = qw ( $ENV{'PATH'}
$ENV{'ORACLE_HOME'}
$ENV{'LD_LIBRARY_PATH'}
$ENV{'SQLPATH'}
$ENV{'TNS_ADMIN'}
$ENV{'PERL5LIB'}
$ENV{'NLS_LANG'}
$dsn $dbuser $dbpassword
$appIP $LXASIP $DDSIP );
#### Oracle Environment and variable assignments
$ENV{'PATH'} =
'/usr/local/OraClient/instantclient_10_2/bin:/usr/kerberos/b in:/usr/local/bin:/bin:/usr/bin:/usr/X11R6/bin';
$ENV{'ORACLE_HOME'} = '/usr/local/OraClient/instantclient_10_2';
$ENV{'LD_LIBRARY_PATH'} = '/usr/local/OraClient/instantclient_10_2/lib';
$ENV{'SQLPATH'} = '/usr/local/OraClient/instantclient_10_2/bin';
$ENV{'TNS_ADMIN'} = '/usr/local/OraClient';
$ENV{'PERL5LIB'} =
'/usr/local/OraClient/instantclient_10_2/perl-modules/lib/pe rl5/site_perl/5.8.0/i386-linux-thread-multi';
$ENV{'NLS_LANG'} = 'AMERICAN_AMERICA.UTF8';# '',
'WE8ISO8859P1','ENGLISH','AL32UTF8' also tried...;
$dsn = q{dbi:Oracle:QQ3_VLAN} ;
($dbuser,$dbpassword) = ("foo","foo");
Putting a print into the CGI script, and running 'env' on the command
line, shows that the two connection-attempots both have the same values
for these environment variables:
PERL5LIB=/usr/local/OraClient/instantclient_10_2/perl-module s/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi
LD_LIBRARY_PATH=/usr/local/OraClient/instantclient_10_2/lib:
TNS_ADMIN=/usr/local/OraClient
PATH=/usr/local/OraClient/instantclient_10_2/bin:/usr/kerber os/bin:/bin:/usr/bin:/usr/local/bin:/usr/bin/X11:/usr/X11R6/ bin:/home/qg/bin
LANG=en_US.UTF-8
SQLPATH=/usr/local/OraClient/instantclient_10_2/bin
ORACLE_HOME=/usr/local/OraClient/instantclient_10_2
It's obvious that I'm still missing something. It's not obvious to me
what that is. Can anyone suggest what I should look for next?
Thanks,
victor churchill