DBI & DBD::Oracle

From: John Moon (john.moon_at_myflorida.com)
Date: 06/29/04


To: "'dbi-users@perl.org'" <dbi-users@perl.org>
Date: Tue, 29 Jun 2004 15:14:05 -0400


I originally sent this to the CGI list so please excuse me if you are on
both.

This is perl, version 5.004_01
# $Id: DBI.pm,v 11.3 2001/08/24 23:33:40 timbo Exp $
$DBI::VERSION = "1.20";
# $Id: Oracle.pm,v 1.92 2001/08/31 16:23:59 timbo Exp $
$DBD::Oracle::VERSION = '1.12';

I have "many" databases on "many" different platforms (Sun boxes). One of
the boxes has a tnsnames files that contains all of the various instances. I
connect from this box to all of the instances except three...

I have tried various ways to connect but can not connect to three from my
Perl script - I can connect with SqlPlus from the command line to the three
databases.

I get this error message when trying to connect:
DBI->connect() failed: ORA-03106: fatal two-task communication protocol
error (DBD: login failed) at /.../ThisConnect.pm line 8

Below is the connection sub. Any help or suggestions will be greatly
appreciated.

Thanks in advance...

sub MyConnect{
     use strict;
     my($instance) = @_; # alias name
     my $driver = 'dbi:Oracle:';
     my $user = 'xxx';
     my $passwd = 'xxx';
 # DBI->trace(5) if $instance =~ /efis/i;
     my $dbh = DBI->connect($driver, "$user\@$instance", $passwd);
 # or die "Could not connect to instance <$instance>: " .
DBI->errstr;
     return $dbh;
 }
1;

I've included the threads I have to the original post to show what I've
tried...

------

OK... I "WAS" thinking it was a "TWO_TASK" error but now see the
difference... But I don't understand why I can connect & select from SqlPlus
but not even Connect with DBI? The referenced doc seems to imply that I
should NOT be able to connect at all(?). My Sqlplus connect looks like:
>sqlplus database@alias
which is the same(?) connection I'm using with DBI(?).

Thanks again for the information and the help...

jwm

-----Original Message-----
From: Gene Dascher [mailto:gedascher@multiservice.com]
Sent: Tuesday, June 29, 2004 12:48 PM
To: Moon, John
Subject: RE: [CGI] DBI & DBD::Oracle

Try looking at this page to see if it can give you any direction:

http://www.fors.com/velpuri2/ERRORS/TWO-TASK%20COMMON%20ERRORS

Gene

> -----Original Message-----
> From: Moon, John [mailto:john.moon@myflorida.com]
> Sent: Tuesday, June 29, 2004 11:37
> To: 'Gene Dascher'
> Subject: RE: [CGI] DBI & DBD::Oracle
>
>
> Same error with the below and "alias name"...
>
> Thanks,
>
> jwm
>
> -----Original Message-----
> From: Gene Dascher [mailto:gedascher@multiservice.com]
> Sent: Tuesday, June 29, 2004 12:25 PM
> To: Moon, John
> Subject: RE: [CGI] DBI & DBD::Oracle
>
> Try connecting like this:
>
> DBI->connect($driver . $instance, $username, $password);
>
> Gene
>
> > -----Original Message-----
> > From: owner-cgi-list@jann.com [mailto:owner-cgi-list@jann.com]On Behalf
> > Of Moon, John
> > Sent: Tuesday, June 29, 2004 11:11
> > To: cgi-list@jann.com
> > Subject: [CGI] DBI & DBD::Oracle
> >
> >



Relevant Pages

  • Re: Can anyone program perl and fix a script?
    ... you would find lots of perl code to look at for examples of a perl commands. ... that is a huge list of ports and services. ... grep torrent /etc/services and see what you can see. ... Sounds like you need a filter rule in iptables to throttle torrent connection. ...
    (alt.os.linux)
  • Re: DBD::Sybase context allocation routine failed
    ... attempting a DB connection using a brand new installation of perl ... perl -MDBI -e 'print DBI- ... but when i attempt to run this stub script: ... The context allocation routine failed. ...
    (perl.dbi.users)
  • Re: SQLPlus with Perl
    ... I've been assigned a project involving SQLplus calls to an Oracle ... database within Perl code. ... now need to perform a select statement to check values in the database. ...
    (comp.lang.perl.misc)
  • RE: DBI & DBD::Oracle
    ... My guess is you do not have the correct Oracle environment set up. ... But I don't understand why I can connect & select from SqlPlus ... but not even Connect with DBI? ... which is the sameconnection I'm using with DBI. ...
    (perl.dbi.users)
  • Re: DBD::Sybase context allocation routine failed
    ... attempting a DB connection using a brand new installation of perl ... perl -MDBI -e 'print DBI- ... but when i attempt to run this stub script: ... The context allocation routine failed. ...
    (perl.dbi.users)