Code Comments
Programming Forum and web based access to our favorite programming groups.Hi I had posted a few days ago about facing problems installing DBD::Oracle wit h Oracle 10g client under Cygwin. Though those were circumvented successfully, when I try to run a simple scri pt that calls DBI->Connect, I get DBI connect(....) failed: ERROR OCIEnvNlsCreate. Check ORACLE_HOME env var, NLS settings, permissions, etc. at tmp.pl line 12 Error ERROR OCIEnvNlsCreate. Check ORACLE_HOME env var, NLS settings, permis sions, etc. at tmp.pl line 12. ORACLE_HOME C:\oracle\product\10.2.0\client_2 ORACLE_SID DEVDB TWO_TASK DEVDB NLS_LANG WE8ISO8859P15 I saw some earlier threads on this issue which recommended ensuring that the permissions on ORACLE_HOME/bin and ORACLE_HOME/lib are set correctly. All user-accounts on this machine have "Full Control" for these directories. Any recommendations anyone? Thanks ________________________________________ ____________________________________ ________ Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06...tDypao8Wcj9tAcJ
Post Follow-up to this messageHi
I have updated my system per your instructions and also included these lines
as a preamble in my test script.
I have modified the security settings for every folder under ORACLE_HOME to
give full read-write permissions to every user-account on this computer.
However I still continue to encounter the same error.
Any input on resolving the above would be helpful!
Thanks
----- Original Message ----
From: Christian Merz <christian.merz@muenchen.de>
To: Dunston Rocks <rocksdunston@yahoo.com>
Cc: dbi-users@perl.org
Sent: Wednesday, April 23, 2008 6:50:57 AM
Subject: Re: OCIEnvNlsCreate error with DBD::Oracle 1.21 and Oracle 10g clie
nt in Cygwin
Hello Dunston,
in my test script i set:
$ENV{ORACLE_SID} = "ORCL";
$ENV{ORACLE_HOME} = "/path/to/oracle/home";
$ENV{NLS_LANG} = "AMERICAN_AMERICA.WE8DEC";
# or "GERMAN_GERMANY.WE8ISO8859P15";
$ENV{ORA_NLS} = $ENV{ORACLE_HOME} . "/ocommon/nls/admin/data";
$ENV{PATH} = $ENV{ORACLE_HOME} . "/bin:/usr/bin";
$ENV{LD_LIBRARY_PATH} = $ENV{ORACLE_HOME} . "/lib";
In Oracle10 you should replace NLS_LANG by s'thing like:
$ENV{ORA_NLS10} = '/oracle/product/10.2.0/nls/data';
cu, Christian
Dunston Rocks schrieb:
> Hi
> I had posted a few days ago about facing problems installing DBD::Oracle w
ith Oracle 10g client under Cygwin.
> Though those were circumvented successfully, when I try to run a simple sc
ript that calls DBI->Connect, I get
>
> DBI connect(....) failed: ERROR OCIEnvNlsCreate. Check ORACLE_HOME env var
, NLS settings, permissions, etc. at tmp.pl line 12
> Error ERROR OCIEnvNlsCreate. Check ORACLE_HOME env var, NLS settings, perm
issions, etc. at tmp.pl line 12.
>
> ORACLE_HOME C:\oracle\product\10.2.0\client_2
> ORACLE_SID DEVDB
> TWO_TASK DEVDB
> NLS_LANG WE8ISO8859P15
>
> I saw some earlier threads on this issue which recommended ensuring that t
he permissions on ORACLE_HOME/bin and ORACLE_HOME/lib are set correctly.
> All user-accounts on this machine have "Full Control" for these directorie
s.
>
> Any recommendations anyone?
>
> Thanks
>
>
>
>
>
>
>
> ________________________________________
____________________________
________________
> Be a better friend, newshound, and
> know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu0<...tDypao8Wcj9tAcJ
>
________________________________________
____________________________________
________
Be a better friend, newshound, and
know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06...tDypao8Wcj9tAcJ
Post Follow-up to this messageHi
Firstly, thanks for continuing to work with me on this.
Here's my script. and the output.
I am able to connect to all databases from the cygwin prompt, but am unable
to get the script to connect.
I have all the below-mentioned environment variables set in the Windows envi
ronment as well, which cygwin picks up at start-up as well.
Regardless, I set them in the script as well, as shown below.
I have tried all variations of the DBI->connect statement mentioned in the p
erldocs in the script below, but continue to encounter the OCIEnvNlsCreate e
rror.
It seems to be a permissions issue, but I don't know where to look.
*************************** SCRIPT *************************************
#!/usr/bin/perl
use strict;
use DBI;
print "Testing connection to DEV \n";
$ENV{ORACLE_SID} = 'CBDEV';
$ENV{TWO_TASK} = 'CBDEV';
$ENV{TNS_ADMIN} = 'C:\oracle\product\10.2.0\client_2\NETWORK\ADMIN\tn
snam
es.ora'; # Also tried replacing these with POSIX-Style paths
$ENV{ORACLE_HOME} = "C:\oracle\product\10.2.0\client_2";
$ENV{NLS_LANG} = "AMERICAN_AMERICA.WE8DEC";
$ENV{ORA_NLS} = $ENV{ORACLE_HOME}."/ocommon/nls/admin/data";
$ENV{LD_LIBRARY_PATH} = $ENV{ORACLE_HOME}."/lib";
$ENV{ORA_NLS10} = '/oracle/product/10.2.0/client_2/nls/data';
my @driver_names = DBI->available_drivers;
foreach my $driver_name (@driver_names) {
print $driver_name,"\n";
my %attr;
my @data_sources = DBI->data_sources($driver_name, \%attr);
foreach (@data_sources) {
print "Data Source: ",$_,"\n";
if ($_ =~/CBDEV) {
my $cHash = &getCytoband(); # fails with OCI Env NlsError
here.....
}
}
}
sub getCytoband() {
my($name, $id);
my %nameHash;
my $dbh = DBI->connect('DBI:Oracle:CBDEV', 'dunston', 'rocks') || die "Erro
r ".DBI->errstr;
my $sql = qq(SELECT * from GENE_NAMES);
my $sth = $dbh->prepare($sql);
$sth->execute();
$sth->bind_columns(\$id, \$name);
while($sth->fetch()) {
$name=~s/\s+//g;
$id=~s/\s+//g;
$nameHash{$name}=$id;
print "Name : $name ", $nameHash{$name}, "\n";
}
return \%nameHash;
}
exit;
*************************** OUTPUT *************************************
DBM
*****DBI:DBM:f_dir=.cpan
*****DBI:DBM:f_dir=.texmf
*****DBI:DBM:f_dir=acroread
*****DBI:DBM:f_dir=apache-ant-1.6.5
*****DBI:DBM:f_dir=apache-ant-1.7.0-bin
*****DBI:DBM:f_dir=AppName
*****DBI:DBM:f_dir=autorun
*****DBI:DBM:f_dir=caBIO
*****DBI:DBM:f_dir=cabioApp
*****DBI:DBM:f_dir=cygwin
*****DBI:DBM:f_dir=dell
*****DBI:DBM:f_dir=Documents and Settings
*****DBI:DBM:f_dir=Downloads
*****DBI:DBM:f_dir=drivers
*****DBI:DBM:f_dir=httpd-2.2.8
*****DBI:DBM:f_dir=i386
*****DBI:DBM:f_dir=indexes
*****DBI:DBM:f_dir=jboss-4.0.4.GA
*****DBI:DBM:f_dir=jboss-4.0.5.GA
*****DBI:DBM:f_dir=MSOCache
*****DBI:DBM:f_dir=MyApp
*****DBI:DBM:f_dir=NALCache
*****DBI:DBM:f_dir=NOVELL
*****DBI:DBM:f_dir=oracle
*****DBI:DBM:f_dir=Perl
*****DBI:DBM:f_dir=Perl-Critic-1.082
*****DBI:DBM:f_dir=Perl-Tidy-20071205
*****DBI:DBM:f_dir=Program Files
*****DBI:DBM:f_dir=RECYCLER
*****DBI:DBM:f_dir=ruby
*****DBI:DBM:f_dir=System Volume Information
*****DBI:DBM:f_dir=Tcl
*****DBI:DBM:f_dir=Temp
*****DBI:DBM:f_dir=WINDOWS
*****DBI:DBM:f_dir=.
ExampleP
*****dbi:ExampleP:dir=.
File
*****DBI:File:f_dir=.cpan
*****DBI:File:f_dir=.texmf
*****DBI:File:f_dir=acroread
*****DBI:File:f_dir=apache-ant-1.6.5
*****DBI:File:f_dir=apache-ant-1.7.0-bin
*****DBI:File:f_dir=AppName
*****DBI:File:f_dir=autorun
*****DBI:File:f_dir=caBIO
*****DBI:File:f_dir=cabioApp
*****DBI:File:f_dir=cygwin
*****DBI:File:f_dir=dell
*****DBI:File:f_dir=Documents and Settings
*****DBI:File:f_dir=Downloads
*****DBI:File:f_dir=drivers
*****DBI:File:f_dir=httpd-2.2.8
*****DBI:File:f_dir=i386
*****DBI:File:f_dir=indexes
*****DBI:File:f_dir=jboss-4.0.4.GA
*****DBI:File:f_dir=jboss-4.0.5.GA
*****DBI:File:f_dir=MSOCache
*****DBI:File:f_dir=MyApp
*****DBI:File:f_dir=NALCache
*****DBI:File:f_dir=NOVELL
*****DBI:File:f_dir=oracle
*****DBI:File:f_dir=Perl
*****DBI:File:f_dir=Perl-Critic-1.082
*****DBI:File:f_dir=Perl-Tidy-20071205
*****DBI:File:f_dir=Program Files
*****DBI:File:f_dir=RECYCLER
*****DBI:File:f_dir=ruby
*****DBI:File:f_dir=System Volume Information
*****DBI:File:f_dir=Tcl
*****DBI:File:f_dir=Temp
*****DBI:File:f_dir=WINDOWS
*****DBI:File:f_dir=.
Gofer
Oracle
*****dbi:Oracle:CBDEV
DBI connect('CBDEV','dunston',...) failed: ERROR OCIEnvNlsCreate. Check ORAC
LE_HOME env var, NLS settings, permissions, etc. at tmp.pl line 26
Error ERROR OCIEnvNlsCreate. Check ORACLE_HOME env var, NLS settings, permis
sions, etc. at tmp.pl line 26.
I would greatly appreciate your help in identifying the problem, if possible
!!!
Thanks much!
----- Original Message ----
From: Christian Merz <christian.merz@muenchen.de>
To: Dunston Rocks <rocksdunston@yahoo.com>
Cc: dbi-users@perl.org
Sent: Thursday, April 24, 2008 3:38:12 AM
Subject: Re: OCIEnvNlsCreate error with DBD::Oracle 1.21 and Oracle 10g clie
nt in Cygwin
Hello Dunston,
did you read
perldoc DBI
and
perldoc DBD::Oracle
? To detect if DBI is able to locate DBD::Oracle use:
@driver_names = DBI->available_drivers;
If so, you can idenitfy your oracle Instances via:
@data_sources = DBI->data_sources($driver_name, \%attr);
You may try:
use DBI;
print "available_drivers:\n";
print "$_\n" foreach DBI->available_drivers;
print "\ndata_sources:\n";
print "$_\n" foreach DBI->data_sources('Oracle');
The output of the latter may be used for the connect statement.
cu, Christian
Dunston Rocks schrieb:
> Hi
> I have updated my system per your instructions and also included these lin
es as a preamble in my test script.
>
> I have modified the security settings for every folder under ORACLE_HOME t
o give full read-write permissions to every user-account on this computer.
>
> However I still continue to encounter the same error.
>
> Any input on resolving the above would be helpful!
>
> Thanks
>
> ----- Original Message ----
> From: Christian Merz <christian.merz@muenchen.de>
> To: Dunston Rocks <rocksdunston@yahoo.com>
> Cc: dbi-users@perl.org
> Sent: Wednesday, April 23, 2008 6:50:57 AM
> Subject: Re: OCIEnvNlsCreate error with DBD::Oracle 1.21 and Oracle 10g cl
ient in Cygwin
>
> Hello Dunston,
>
> in my test script i set:
>
> $ENV{ORACLE_SID} = "ORCL";
> $ENV{ORACLE_HOME} = "/path/to/oracle/home";
> $ENV{NLS_LANG} = "AMERICAN_AMERICA.WE8DEC";
> # or "GERMAN_GERMANY.WE8ISO8859P15";
> $ENV{ORA_NLS} = $ENV{ORACLE_HOME} . "/ocommon/nls/admin/data";
> $ENV{PATH} = $ENV{ORACLE_HOME} . "/bin:/usr/bin";
> $ENV{LD_LIBRARY_PATH} = $ENV{ORACLE_HOME} . "/lib";
>
> In Oracle10 you should replace NLS_LANG by s'thing like:
> $ENV{ORA_NLS10} = '/oracle/product/10.2.0/nls/data';
>
> cu, Christian
>
>
> Dunston Rocks schrieb:
>
>
>
>
>
> ________________________________________
____________________________
________________
> Be a better friend, newshound, and
> know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu0<...tDypao8Wcj9tAcJ
>
________________________________________
____________________________________
________
Be a better friend, newshound, and
know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06...tDypao8Wcj9tAcJ
Post Follow-up to this messageOn 2008-05-05 10:46:05 -0700, pgodfrin wrote: > My install of Oracle, for reasons unknown to me, had this file set to > rwxr-x--- which doesn't work for 'others'. In recent versions of Oracle, by default the programs and libraries installed with a server installation are only usable by the DBA group. Oracle calls this a "hardened" installation and provides a script to soften it, if you need to. I assume there are security reasons for this, but I haven't been able to find an explanation (admittedly I haven't looked very hard). Or maybe they just want to nudge people into separating client and server installations ... hp -- _ | Peter J. Holzer | If I wanted to be "academically correct", |_|_) | Symin WSR | I'd be programming in Java. | | | hjp@wsr.ac.at | I don't, and I'm not. __/ | http://www.hjp.at/ | -- Jesse Erlbaum on dbi-users
Post Follow-up to this message
Show a Printable Version
Email This Page to Someone!
Receive updates to this thread
Powered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.