When connecting to multiple instances, if the second connection fails,
the first connection is damaged. Any additional activities to the first
connection will result in the following error:
OCIHandleAlloc(OCI_HTYPE_STMT) failed
at /usr/lib/perl5/site_perl/5.8.5/i386-linux-thread-multi/DBD/Oracle.pm
line 276.
First connection:
my $dbh =
DBI->connect( "dbi:Oracle:host=$Server;sid=$SID;port=$Port",
$User,$Passwd,
{ PrintError => 0, RaiseError => 1 } );
Second connection:
eval {
# local $SIG{ALRM} = sub {die "Connection Timeout\n";};
my $h = set_sig_handler( 'ALRM' ,sub { die "Instance Connection
Timeout" ; } );
alarm( $connectionTimeout );
$rdbh =
DBI->connect
( "dbi:Oracle:host=$rhost;sid=$rSID;port=$rport", $rUser,$Password,
{ PrintError => 0, RaiseError => 0 } );
alarm( 0 );
};
This is perl, v5.8.5 built for i386-linux-thread-multi
rhel5 linux.
Problem occurs when second connection is remote. If the second
connection succeeds, then problem does not occur.