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

Hi -

I am using the DBI module (1.609) with DBD-Oracle (1.23) on a Solaris 10 system connecting to an Oracle 11gR1 database (11.1.0.7). All is fine with that. However, we just migrated a database in preparation for an application upgrade to 11gR2 (11.2.0.1).

When I attempt to run one of my Perl programs that worked yesterday when we were still on 11gR1 I now get this error message:

DBI connect('','xxxxxx/yyyyyy',...) failed: ERROR OCIEnvNlsCreate. Che +ck ORACLE_HOME (Linux) env var or PATH (Windows) and or NLS settings +, permissions, etc. at /dcos/mda1/lib/SQLQuery.pl line 47

I replaced the actual login id and password in the message with the xxxxxx and yyyyyy srings.

The SQLQuery.pl is a function library and the line in question (# 47) is this:

$dbh = DBI->connect('DBI:Oracle:', "$_oraUser/$_oraPasswd");

Now, I have checked all the obvious things like ORACLE_HOME, LD_LIBRARY_PATH, permissions in the $ORACLE_HOME/bin and $ORACLE_HOME/lib directories and they are all ok. So, before spending too much time beating my head against the wall attempting to make something work that just isn't going to work, do I have to recompile and install the DBI and DBD-Oracle modules with Oracle 11gR2?

I plan on recompiling, but I was hoping that my users would be able to upgrade their database first and then upgrade the application (which would include Perl modules) at a soon, but somewhat later date. The idea being to allow them to get some sleep.

Thanks in advance.

Replies are listed 'Best First'.
Re: Connection Problem using DBI w/ Oracle 11gR2
by xiaoyafeng (Deacon) on Aug 11, 2010 at 09:11 UTC

    I used DBD::Oracle for Oracle 11gR2 in ubuntu, it works well.

    I suggest you use DBD::Oracle module ported from 11gR2 to see if the error recur firstly:
    use lib "/opt/oracle/....perl/lib/...." # depends your oracle install +dir




    I am trying to improve my English skills, if you see a mistake please feel free to reply or /msg me a correction

      Hi VingInMedina, Did you resolve this issue? Can you please suggest as I am also stuck with exactly same issue.