Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re^2: Perl DBI not working with Oracle DBD in 11g r2 environment

by seekhelp (Initiate)
on Nov 23, 2011 at 17:20 UTC ( #939700=note: print w/ replies, xml ) Need Help??


in reply to Re: Perl DBI not working with Oracle DBD in 11g r2 environment
in thread Perl DBI not working with Oracle DBD in 11g r2 environment

Thank you very much for you response !!
I will try to get PERL DBI upgraded.
I think there is some libraries from 9i that are getting used my 11g.

------------------------------- Even below code is failing:
</code>
#!/u00/app/xxx/bin/perl
my $ORACLE_HOME = "/u00/app/oracle/product/11.2.0.2";
my $ORACLE_SID="xxxxT11";
$ENV{ORACLE_HOME}=$ORACLE_HOME;
$ENV{ORACLE_SID}=$ORACLE_SID;
$ENV{PATH}="$ORACLE_HOME/bin";
$ENV{LD_LIBRARY_PATH}="$ORACLE_HOME/lib";
use strict;
use DBI;
my $dbh = DBI->connect( 'dbi:Oracle:orcl', 'scott', 'tiger', ) || die "Database connection not made: $DBI::errstr";
$dbh->disconnect;
</code>
----------------------- Error : failed: (UNKNOWN OCI STATUS 1804) OCIInitialize. Check ORACLE_HOME and NLS settings etc. at newtest line 10
-------------------------

its not even checking my Credentials..( scott is not login user ) failing to connect.
----------------------- Please let me know if I am missing something here !!


Thanks all !!



Comment on Re^2: Perl DBI not working with Oracle DBD in 11g r2 environment
Re^3: Perl DBI not working with Oracle DBD in 11g r2 environment
by Tux (Monsignor) on Nov 23, 2011 at 18:25 UTC

    Just FYI, it is way more important to update DBD::Oracle than it is to update DBI. The latter has no knowledge of oracle connections at all. Current DBD::Oracle requires DBI version 1.51 (since 27-01-2011, DBD::Oracle-1.28). Before that, it had no prerequired version for DBI. You just had to keep your hopes up.


    Enjoy, Have FUN! H.Merijn
      Let me even get the DBD upgraded.
      I read this below in link
      http://search.cpan.org/~pythian/DBD-Oracle-1.34/Oracle.pm
      It say :

      “ORACLE_HOME can be left unset if you aren't using any of Oracle's executable, but it is not recommended and error messages may not display. It should be set to the ORACLE_HOME directory of the version of Oracle that DBD::Oracle was compiled with.”

      Does it mean DBD oracle need to be upgraded if we have a new version of oracle.
      for example : DBD was compile when the version was 9i and oracle home poin to 9.2 directory.
      Now DBD is not compilled just we changes the oracle_home to 11.2.
      Thanks all !!

        DBD::Oracle technically just needs the Oracle client, so even if you have a full version of oracle installed, it will just use the client part. In order to find all the required files, you will have to tell the build procedure where to find all of that. That information usually gets passed by means of the $ORACLE_HOME environment variable.

        You'll need to set that to a valid installation path. That may either be a full-fledged installation or to an installation of the Oracle Instant Client. Both will work. And as the client can speak to a different version of the server (the database itself does not need to run on the same machine), you are not bound to using the exact same version of the database: you can talk to a Oracle 9 database with an Oracle Instant Client version 11. FWIW You can have several versions of both installed on the same machine without any of them prohibiting any of the others to function. That is a great way to test your updates.

        When you have compiled and tested and installed DBD::Oracle, it then has builtin information about the libraries it uses, but it does not have enough information builtin to find all the message files (damn locales) or other diagnostical information. That is why you also need to set $ORACLE_HOME at runtime.

        I hope I interpreted your question correctly.


        Enjoy, Have FUN! H.Merijn

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://939700]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (6)
As of 2014-09-18 23:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (126 votes), past polls