Perl script using DBI module with Oracle 8 stops processing Perl script using DBI module with Oracle 8 stops processing unix unix

Perl script using DBI module with Oracle 8 stops processing


Not that I think it relevant but that code is pretty inefficient. You are parsing your SQL for every row inserted. Why not do:

my $sth = $dbh->prepare('BEGIN InsertStoredProc(?,?,?); END;');while (<INFILE>) {  chomp;  next if (/^#.*$/ || /^$/);  my @columns = split /\t/;  #my ($var1, $var2, $var3) = @columns;  eval {       $sth->execute(@columns);    #my $oProce = qq{    #  BEGIN    #    InsertStoredProc(    #    field1 => $var1,    #    field2 => $var2,    #    field3 => $var3    #    );    #  END;    #};    #$dbh->do( $oProce );  };  if ( $@ ) {    $exitstatus=1;    warn "LINE: @columns\n";    warn "Execution of stored procedure failed: $DBI::errstr\n";    warn "################################################################################\n";  }}

The other suggestion of turning off AutoCommit will also speed up your code as you will only be committing every N rows instead of every row. Why using AutoCommit should cause a hang makes no sense to me.

As for the point where it appears to hangs if you can reproduce it at will try running it with DBI_TRACE=15=x.log and set ora_verbose => 6 in the connect. What is at the end of the log file when it hangs.


Did you tried without AutoCommit? Maybe you creates to many transaction and Oracle stops processing more requests.

Try commit in every 100 row and when there is no more data.

You could use strace -p your_program_pid to see what's going on, where your scripts stalls.

I hope this will helps you.