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.

In reply to Perl DBI not working with Oracle DBD in 11g r2 environment by seekhelp

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.