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
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.
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
----------------- use common_lib_t11 -----------------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";
General detail :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; ------------------------------------
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.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Perl DBI not working with Oracle DBD in 11g r2 environment
by Tux (Canon) on Nov 22, 2011 at 20:15 UTC | |
by seekhelp (Initiate) on Nov 23, 2011 at 17:20 UTC | |
by Tux (Canon) on Nov 23, 2011 at 18:25 UTC | |
by seekhelp (Initiate) on Nov 23, 2011 at 22:15 UTC | |
by Tux (Canon) on Nov 24, 2011 at 07:48 UTC |
Back to
Seekers of Perl Wisdom