Perl Dbi Connect Failed Error Ocienvnlscreate
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta error ocienvnlscreate windows Discuss the workings and policies of this site About Us Learn more
Nls Settings
about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack dbd::oracle Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just like you, perl dbi oracle helping each other. Join them; it only takes a minute: Sign up Why does Perl's DBI complain about “failed: ERROR OCIEnvNlsCreate” when I try to connect to Oracle 11g? up vote 3 down vote favorite 1 I am getting the following error connecting to an Oracle 11g database using a simple Perl script: failed: ERROR OCIEnvNlsCreate. Check ORACLE_HOME (Linux) env var or PATH (Windows) and or NLS settings, permissions, etc. at The script is as follows: #!/usr/local/bin/perl use strict; use DBI; if ($#ARGV < 3) { print "Usage: perl testDbAccess.pl dataBaseUser dataBasePassword SID dataBasePort\n"; exit 0; } my ($user, $pwd, $sid, $port) = @ARGV; my $host = `hostname`; my $dbh; my $sth; my $dbname = "dbi:Oracle:HOST=$host;SID=$sid;PORT=$port"; openDbConnection(); closeDbConnection(); sub openDbConnection() { $dbh = DBI->connect ($dbname, $user ,$pwd , { RaiseError => 1}) || die "Database connection not made: $DBI::errstr"; } sub closeDbConnection() { #$sth->finish(); $dbh->disconnect(); } Anyone seen this problem before? perl oracle dbi share|improve this question edited May 28 '10 at 12:48 brian d foy 87.1k24150391 asked May 26 '10 at 15:23 John 23116 John, when you do get this fixed, please remember to come back here and "accept" your favourite answer. If you have to modify something for your environment, you can even post that solution and accept it, and then "up-vote" the answers that helped you get there. This will properly retire the
and Oracle 10.2 on Solaris x86 Message ID: 5C051C98-EB18-4F29-8FE9-DFC918D54E58@berkeley.edu Hello fine DBI users list, I'm having a bit of trouble getting DBD Oracle 1.23 working with Oracle Instant Client 10.2 (with SDK and SQLPlus) on SunOS machinename 5.10 Generic_138889-03 i86pc i386 i86pc I compile with a PREFIX set. Because I couldn't figure out how to properly get everything to link with the Oracle shlibs, I had http://stackoverflow.com/questions/2914320/why-does-perls-dbi-complain-about-failed-error-ocienvnlscreate-when-i-try-to to manually invoke ld with -R to generate an Oracle.so that properly linked without LD_xxx set. But in the end I'm left with a shared object that links and loads okay. Then- xxx# make test PERL_DL_NONLAZY=1 /usr/local/bin/perl "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t t/01base.t .............. # Test loading DBI, DBD::Oracle and http://www.nntp.perl.org/group/perl.dbi.users/2009/05/msg33971.html version t/01base.t .............. ok t/10general.t ........... DBI connect('','scott/tiger',...) failed: ERROR OCIEnvNlsCreate. Check ORACLE_HOME (Linux) env var or PATH (Windows) and or NLS settings, permissions, etc. at t/10general.t line 22 Bailout called. Further testing stopped: Unable to connect to Oracle (ERROR OCIEnvNlsCreate. Check ORACLE_HOME (Linux) env var or PATH (Windows) and or NLS settings, permissions, etc.) FAILED--Further testing stopped: Unable to connect to Oracle (ERROR OCIEnvNlsCreate. Check ORACLE_HOME (Linux) env var or PATH (Windows) and or NLS settings, permissions, etc.) *** Error code 29 make: Fatal error: Command failed for target `test_dynamic' ORACLE_HOME is set - xxx# echo $ORACLE_HOME /remote/netdb/instantclient_10_2 As requested in the README, xxx# perl -Mblib t/10general.t install_driver(Oracle) failed: DBI/DBD internal structure mismatch (dr: 84/88, db:84/88, st:108/116, fd:84/84), you probably need to rebuild the DBD driver (or possibly the DBI). Compilation failed in require at (eval 3) line 3. at /remote/netdb/DBD-Oracle-1.23/blib/lib/Oraperl.pm line 55 Compilation failed in require at t/10gener
Perl DBI connect oracleexample https://alexzeng.wordpress.com/2010/10/16/perl-dbi-connect-oracle-example/ October 16, 2010 7 Comments Perl DBI connect oracle example. Select statement #!/export/home/oracle/bin/jade -w use strict; use DBI qw(:sql_types); $ENV{'ORACLE_HOME'} = "/oracle_base/10204″; my $dbh = DBI->connect('dbi:Oracle:host=alexzeng.wordpress.com;sid=WENJIN;port=1521′,'alex','alex') || die "Database connection not made"; $dbh->{RowCacheSize} = 100; my $sql = qq{ select /*+ perl dbi use_nl(t1,t2) index(t1),index(t2)*/t1.b,t2.b from t1,t2 where t1.a between 10 and 200000 and t1.b=t2.a}; my $sth = $dbh->prepare( $sql ); $sth->execute(); my( $a,$b ); $sth->bind_columns( undef,\$a,\$b ); while( $sth->fetch() ) { print "$a,$b\n"; } $sth->finish(); $dbh->disconnect(); Insert statement #!/export/home/oracle/bin/jade -w use strict; use perl dbi connect DBI qw(:sql_types); $ENV{'ORACLE_HOME'} = "/export/home/oracle/products/10204″; my $dbh = DBI->connect('dbi:Oracle:host=alexzeng.wordpress.com;sid=WENJIN;port=1521′,'alex','alex') || die "Database connection not made"; my $insert_handle = $dbh->prepare_cached('INSERT INTO test_flist VALUES (?)'); my $single_raw='1′; my $one_k_raw; my $eight_k_raw; my $cnt; for ($cnt=0;$cnt<10;$cnt++){ $single_raw=$single_raw.$single_raw; } $one_k_raw=$single_raw; for ($cnt=0;$cnt<80;$cnt++){ $eight_k_raw=$eight_k_raw.$one_k_raw } print length($eight_k_raw)."\n"; $insert_handle->bind_param(1, $eight_k_raw, SQL_LONGVARBINARY); for ($cnt=0;$cnt<100;$cnt++){ $insert_handle->execute() or return 0; } print "complete\n"; Like this:Like Loading... Related Filed under Automation About Alex ZengI would be very happy if this blog can help you. I appreciate every honest comments. Please forgive me if I'm too busy to reply your comments in time. 7 Responses to Perl DBI connect oracleexample VK says: April 12, 2013 at 12:31 pm Hi, I am getting this error Can't locate DBI.pm in @INC (@INC contains: /usr/l