Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Hi, I have a problem when using DBD::oracle when connecting as sysdba. All operating system commands which follow a successful connection return a non-zero status e.g.
use DBD::Oracle qw(:ora_session_modes); # Import ORA_SYSDBA constant $dbh = DBI->connect('dbi:Oracle',"","",{ PrintError => 0, AutoCommit => 1, ora_session_mode => ORA_SYSDBA }); if (! $dbh) {print "can't connect to instance as sysdba\n";exit;} my $res = system("cp /tmp/pfile.ora /tmp/pfile.new.ora"); if ($res) { print "Unable to copy file\n$!\n"; }
This gives
Unable to copy config file No child processes
As per comments in the DBD::Oracle documentation if I change the connection to include a database e.g.
$dbh = DBI->connect('dbi:Oracle:mySID',"","",{ PrintError => 0, AutoCommit => 1, ora_session_mode => ORA_SYSDBA }); if (! $dbh) {print "can't connect to instance as sysdba\n";exit;}
the connection doesn't work.
How do I connect as sysdba without using a username/password and not get a problem with subsequent Op sys commands that are run ?
Has anyone seen this before ?
I'm using DBD-Oracle-1.17 against a 10g R2 Oracle instance