Subject: | Connecting locally causes system() return codes to always be -1 |
When connecting without specifying an SID in the connection string
causes subsequent system() function calls to always return -1. The
database connection is successful and the commands inside the system
calls execute successfully, but return value from the system() call is
always -1.
Script to reproduce the behavior:
#!/usr/bin/perl
use strict;
use DBI;
use DBD::Oracle; # only referenced to display version
print "DBI::VERSION: " . $DBI::VERSION . "\n";
print "DBD::Oracle::VERSION: " . $DBD::Oracle::VERSION . "\n";
my $rc;
$rc = system("/bin/true");
print "RC = $rc\n";
my $dbh = DBI->connect("dbi:Oracle:", "username", "password");
$dbh->disconnect;
$rc = system("/bin/true");
print "RC = $rc\n";
This produces the output:
DBI::VERSION: 1.616
DBD::Oracle::VERSION: 1.27
RC = 0
RC = -1
Details about my environment:
cat /etc/redhat-release:
Red Hat Enterprise Linux Server release 5.4 (Tikanga)
uname -a:
Linux hostname 2.6.18-164.9.1.el5 #1 SMP Wed Dec 9 03:27:37 EST
2009 x86_64 x86_64 x86_64 GNU/Linux
perl -v:
This is perl, v5.8.8 built for x86_64-linux-thread-multi
sqlplus:
SQL*Plus: Release 11.2.0.2.0 Production on Thu Mar 17 13:23:50 2011
...
This behavior doesn't happen when I specify the SID as part of the
connection string e.g., 'dbi:Oracle:mysid'.