You can happily connect to an 8i instance with a 9i-compiled DBD::Oracle,
and vice versa.

But your libraries must match those that DBD::Oracle was compiled against.
If it was 8i, your ORACLE_HOME and LD_LIBRARY_PATH have to point to the 8i
home.

> When making a connection to an 8i instance, all works well.   
>  When making a connection against 9i, the error occurs.  I 
> was wondering if there may be a difference in libs, and this 
> seems to point to that.  

Are you changing your environment between the two connects?

There's no need to set your ORACLE_HOME or LD_LIBRARY_PATH to the 9i home to
connect to the 9i database, and in fact doing this will be what breaks
DBD::Oracle.

You'll need a tnsnames.ora entry to /see/ the database, but you can make
this shared between homes using the TNS_ADMIN environment variable, or
simply copying entries into network/admin/tnsnames.ora in both homes, or
symlinking them together.

Other alternatives:

(1) Have two copies of DBD::Oracle, one against 8i and one against 9i, and
adjust your PERL5LIB environment variable to point to the appropriate one.

(2) Adjust your environment using %ENV within your Perl script, before you
connect, to force ORACLE_HOME and LD_LIBRARY_PATH back to the 8i home.


If you're NOT changing your environment, i.e. it's all still set to the 8i
home yet it fails when connecting to the 9i database, you may have hit
something else.

Oracle actually distribute a version of DBD::Oracle (v1.12) in Oracle 10g;
don't know whether they support it, though.

-- 
Andy Hassall <[EMAIL PROTECTED]> / Space: disk usage analysis tool
<http://www.andyh.co.uk> / <http://www.andyhsoftware.co.uk/space> 

> -----Original Message-----
> From: Reidy, Ron [mailto:[EMAIL PROTECTED] 
> Sent: 13 April 2004 21:08
> To: Andy Hassall; [EMAIL PROTECTED]
> Subject: RE: DBI connect('','/',...) failed: ERROR OCIEnvInit
> 
> Andy,
> 
> Thanks for the reply.
> 
> DBD::Oracle was originally compiled against 8i only.
> 
> When making a connection to an 8i instance, all works well.   
>  When making a connection against 9i, the error occurs.  I 
> was wondering if there may be a difference in libs, and this 
> seems to point to that.  
> 
> Do I need to compile specifically against the 9i libraries to 
> make this work?  If this is necessary, will the 
> DBD::Oracle.xs be downward compatible to 8i?  If not, how do 
> I create an 8i and 9i DBD::Oracle and will I need to 
> explicitly 'use' it in my scripts depending on which instance 
> I am running against (hope not - it could be a lot of code to 
> write just to load a module)?
> 
> I have opened a TAR w/Oracle support because the error seems 
> to be thrown from OCI, but I am quite sure the will say 
> something to the effect of "... and we don't support perl."
> 
> -----------------
> Ron Reidy
> Senior DBA
> Array BioPharma, Inc.
> 303.386.1480
> 
> 
> -----Original Message-----
> From: Andy Hassall [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, April 13, 2004 2:03 PM
> To: Reidy, Ron; [EMAIL PROTECTED]
> Subject: RE: DBI connect('','/',...) failed: ERROR OCIEnvInit
> 
> 
> > I am getting the above error when attempting to connect to 
> > anOracle 9.2 instance (9.2.0.4.0).  This instance was 
> > recently upgraded from Oracle 8.1.7.4.0
> 
> The first thing to check is that perhaps you're trying to run 
> a DBD::Oracle
> compiled against 8i with a 9i set of libraries - or vice versa? Check
> $ORACLE_HOME and $LD_LIBRARY_PATH, and make sure they match 
> with what you
> compiled against.
> 
> -- 
> Andy Hassall <[EMAIL PROTECTED]> / Space: disk usage analysis tool
> <http://www.andyh.co.uk> / <http://www.andyhsoftware.co.uk/space> 
> 
> 
> This electronic message transmission is a PRIVATE 
> communication which contains
> information which may be confidential or privileged. The 
> information is intended 
> to be for the use of the individual or entity named above. If 
> you are not the 
> intended recipient, please be aware that any disclosure, 
> copying, distribution 
> or use of the contents of this information is prohibited. 
> Please notify the
> sender  of the delivery error by replying to this message, or 
> notify us by
> telephone (877-633-2436, ext. 0), and then delete it from 
> your system.

Reply via email to