astroboy has asked for the wisdom of the Perl Monks concerning the following question:
and the perl script:select sysdate from dual; exit
which dies with:#!/usr/local/bin/perl use DBI; my $dbh = DBI->connect('DBI:Oracle:', 'scott', 'tiger', {RaiseError => + 1}) || die DBI::errstr; my @cmd = ( 'sqlplus', '-s', 'SCOTT/tiger', '@test.sql' ); my $output = qx{@cmd}; my $retcode = $?; if ($? == -1) { die "Error: $?: $!"; } print $output;
Error: -1: No child processes at ./test.pl line 17.
However if I comment line 4, it works! Now it works for me on an older system. The differences are:
older system: Perl 5.10.0, DBI 1.609,DBD::Oracle.1.23, Centos 5.4, Oracle 11g release 1
new system: Perl 5.10.1, DBI 1.609, DBD::Oracle.1.23, Centos 5.4, Oracle 11g release 2
To try and eliminate Perl, I used the vendor version (5.8) on the new system. The only thing I can guess is that the version of Oracle makes a difference. But before I go to all of the trouble of reinstalling Oracle, I'm wondering if anyone can offer a reason for my problem, and a solution.
Note: the actual code in my app uses IPC::Cmd to handle the external command call (and deal with stderr and stdout, etc). I simply use qx{} the test case above to illustrate the unerlying problem. In the real code, the SQL script runs without error, but the return status is always -1
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Host command fails if there is a database connection
by mje (Curate) on Nov 20, 2009 at 09:12 UTC | |
by astroboy (Chaplain) on Nov 22, 2009 at 20:23 UTC | |
Re: Host command fails if there is a database connection
by roboticus (Chancellor) on Nov 20, 2009 at 12:54 UTC |