olwin wrote:
Sorry for my poor English.
After connect in SYSDBA to an Oracle 10.2.0.2 Database, all system
command return '-1' (No child processes).
Problem detect on a Solaris 10 x86 server :
Details :
perl -MDBI -e 'DBI->installed_versions'
Perl : 5.008006 (i86pc-solaris-thread-multi)
OS : solaris (2.10)
DBI : 1.42
DBD::Sponge : 11.10
DBD::Proxy : 0.2004
DBD::Oracle : 1.15
DBD::File : 0.30
DBD::ExampleP : 11.12
DBD::DBM : 0.01
It's a production server, I can't upgrade DBD::Oracle for the moment.
It's the first application on the server to use perl,others only use
shell/sqlplus
This code will show the problem :
use DBD::Oracle qw(:ora_session_modes);
my $dsn = "dbi:Oracle:"; # no dbname here
print "TWO_TASK not defined\n" if (not defined($ENV{TWO_TASK}));
print "ORACLE_SID : $ENV{ORACLE_SID} \n";
my $dbh = DBI->connect($dsn, "", "", { ora_session_mode =>
ORA_SYSDBA });
$dbh->{RaiseError} = 1;
my $sth = $dbh->prepare( "select sysdate from dual" );
$sth->execute();
my $date=$sth->fetchrow();
print "Date : $date \n";
$sth->finish();
$dbh->disconnect();
my $ret=system("date");
print "retour : $ret";
Result on my machine :
TWO_TASK not defined
ORACLE_SID : KJD00
Date : 30-JUL-08
mercredi, 30 juillet 2008, 14:32:22 MEST
retour : -1
Get you the same result as me?
At first glance it seemed to me that this has nothing to do with
DBD::Oracle or DBI and did not belong on this list. However, you are
using the system command and given it returns -1 it failed. If you use
the system command like above, it forks, issues your command and does a
wait for the child to exit (this may depend on SIGCHILD signal). The
oracle client libraries fiddle with SIGCHILD handling - presumably
because it wants to know a SIGCHILD signals. You probably want to return
SIGCHILD behaviour back to the default but you should realise this may
impact on the oracle client libraries. The following link might help
explain some of this but I cannot recollect a definite solution for
system in perl and Oracle:
http://www.easysoft.com/support/kb/kb00967.html
This link looks promising:
http://coding.derkeiler.com/Archive/Perl/perl.dbi.users/2008-06/msg00042.html
which mentions
BEQUEATH_DETACH = yes
Martin