http://www.perlmonks.org?node_id=939521

seekhelp has asked for the wisdom of the Perl Monks concerning the following question:

version :
oracle database: 11g r2
Perl DBI version 1.21
ORACLE DBD version 1.06

ERROR :DBI->connect() failed: (UNKNOWN OCI STATUS 1804) OCIInitialize. Check ORACLE_HOME and NLS settings etc. at /u00/app/xxx/site/perl-5.6.1/lib/site_perl/5.6.1/refdb.pm

CODE : Set Oracle date format BEGIN { $ENV{NLS_LANG}="AMERICAN_AMERICA.WE8MSWIN1252"; } use common_lib_t11; #${&dbh}->do("alter session set NLS_DATE_FORMAT='DD-MON-YYYY HH24:MI:S +S'"); print 'Got date: ' . ${&dbh}->selectrow_array("SELECT SYSDATE FROM DUA +L") . "\n"; print 'Got global_name: ' . ${&dbh}->selectrow_array('select * from gl +obal_name') . "\n";
----------------- use common_lib_t11 -----------------
package main; BEGIN { my @passwd = getpwnam "xxxxr"; $HOME_DIR = $passwd[7]; $ENV{"PATH"} = $HOME_DIR."/bin:".$ENV{"PATH"}; foreach my $dir ("/opt/bin","/usr/local/bin") { if (-d $dir) {$ENV{"PATH"}.=":$dir"} } $ENV{"ORACLE_SID"} = "xxxxx"; } # Oracle login $DB_USERID = "xxxx"; $DB_PASSWD = "xxxx"; $DB_SID = "xxxxx"; # file paths $BASE_DIR = "$HOME_DIR/XX"; # misc if ($ENV{"LD_LIBRARY_PATH"}) { $ENV{"LD_LIBRARY_PATH"} .= ":$CHOME_DIR/lib:/usr/local/lib:/usr/li +b:/usr/ucblib:/usr/openwin/lib:/usr/dt/lib"; } else { $ENV{"LD_LIBRARY_PATH"} = "$HOME_DIR/lib:/usr/local/lib:/usr/lib:/ +usr/ucblib:/usr/openwin/lib:/usr/dt/lib";} package common_lib_t11; use Carp; use MIME::Entity; ($VERSION = '$RCSfile: common_lib.pm,v $$Revision: 1.22 $$Date: 2006/0 +3/01 17:01:48 $ ') =~ s/RCSfile|Revision|Date|\$|: //g; ------------------------------------
General detail :
This process is working fine with 9i but the moment we try to run it against 11g r2 is give error. This box has two homes with 9i and other 11g. I am thinking that could be an issue.

Below already tried :

Try to sent the Time zone varirable. ORA_TZFILE
Check the compatibility of versions.
Try to set oracle_home and LD_Library, oracle_sid in the scripts also.