Connect failure: OCIEnvNlsCreate (check ORACLE_HOME and NLS settings etc.)



Hello 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/bin:/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/perl5/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-modules/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/kerberos/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
.



Relevant Pages

  • Re: ANNOUNCE: DBD::Oracle 1.17 *RELEASE CANDIDATE* RC6
    ... Oracle instant client v10.2.0.1 installed as rpms and running ldconfig ... However, when I execute the cgi script from my web server, I get the ... Check ORACLE_HOME env var, NLS settings, permissions, ... It is my understanding of the Oracle instant client Shared Data ...
    (perl.dbi.users)
  • Re: ssi and Perl/CGI
    ... How do I go about passing variables to the script via include virtual ... I'll give cmd a whirl, though cgi seems to work great if all my page ... content is coming from the CGI script. ...
    (perl.beginners)
  • Re: CGI Question
    ... leftframe.cgi, not javascript. ... > a CGI script (and it's initially called with NO ... > and the right frame contains an HTML file. ...
    (perl.beginners)
  • Re: Slightly OT: Incoming email triggers
    ... > I found a provider who offers Tcl as a scripting language - great ... > - a script gets activated ... The phrase you're looking for is "mail delivery agent," and the question ... you could always .htaccess protect a CGI script that you run which is a ...
    (comp.lang.tcl)
  • Re: perl/cgi exploit with bracketed module names passed in as CGI param
    ... > cgi script prints the raw cgi param value back out, ... which allows to evaluate a string inside of brackets, ... you put your CGI-parameters into a string and run that string through ...
    (comp.lang.perl.misc)