Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer

Version of DBD::Oracle needed to connect to 9i ?

by secret (Beadle)
on May 12, 2006 at 14:21 UTC ( #548999=perlquestion: print w/replies, xml ) Need Help??

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

Hello DBI Monks ;)

I try to connect to an Oracle 920 base with the classic :

my $dbh = DBI->connect($dsn, $user, $pass, { RaiseError => 1, AutoCom +mit => 1 }) or die 'Connexion a la base impossible: ' . DBI->errstr;
I get the following error :
DBI connect('XX','xx',...) failed: ERROR OCIEnvInit at li +ne 36
I'm using perl 5.8.0 on solaris 5.8 .
I have  $DBD::Oracle::VERSION = '1.15' and $DBI::VERSION = "1.42";

Various searches lead me to believe that this is due to the version of DBD::Oracle not being compiled with the proper oracle home directory set.

I do not know where this Perl, DBI and DBD::Oracle come from, but most likely from a standard Solaris package. Has anyone encountred this before, i.e. is there some Solaris doc or changelog that point to this problem ?

Is there an easier way than to re-install the DBD::Oracle ?

Can I assume that installing the latest DBD::Oracle and DBI will allow me to connect to the 9i client ?

Thanks for your help ,
secret .

Replies are listed 'Best First'.
Re: Version of DBD::Oracle needed to connect to 9i ?
by xorl (Deacon) on May 12, 2006 at 14:52 UTC
    I've found if you set ORACLE_HOME in a BEGIN block solves a lot of problems (not just yours).
    BEGIN { $ENV{"ORACLE_HOME"} = "/home/oracle/OraHome_1"; } # rest of your code goes here
    Your versions of DBD::Oracle and DBI should work fine with 9i or 10g. At least I haven't had any serious problems with them.
      Tried it but i still get the same error :|

Re: Version of DBD::Oracle needed to connect to 9i ?
by dragonchild (Archbishop) on May 12, 2006 at 15:28 UTC
    I've installed DBD::Oracle on Solaris several times before. You will need to reinstall DBD::Oracle with the appropriate files. You will want to look at DBD::Oracle and Oracle 9i standard client install for more information on how to do a minimal install of Oracle in order to get DBD::Oracle to compile successfully.

    My criteria for good software:
    1. Does it work?
    2. Can someone else come in, make a change, and be reasonably certain no bugs were introduced?
Re: Version of DBD::Oracle needed to connect to 9i ?
by marto (Archbishop) on May 12, 2006 at 14:54 UTC
    hi secret,

    Firstly check that your ORACLE_HOME environment variable has the correct path. DBD::Oracle uses this to locate the Oracle binaries. Have you recently upgraded from an older version or Oracle?

    IMHO it would also be an idea to update both the DBI and DBD::Oracle versions. The Tutorials section has A Guide to Installing Modules by tachyon which I suggest you read if you are not familiar with installing modules.

    Hope this helps.

      Finally DBD::Oracle has been recompiled in another directory which is called via use lib before use DBI.

      Worth a note is that LD_LIBRARY_PATH needs to include the lib32 directory of Oracle 9i .
      This is set via the shell since it does not seem to work when setting it in %ENV, even from within a BEGIN block.

      Thanks for all the advice !

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://548999]
Approved by marto
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (4)
As of 2020-02-25 06:44 GMT
Find Nodes?
    Voting Booth?
    What numbers are you going to focus on primarily in 2020?

    Results (108 votes). Check out past polls.