| < Day Day Up > |
|
Tip | Please do not use this script without testing. |
$source = shift; #a trace path and file name open(trace,$source) || die "Cannot open file $source\n"; @lines = <trace; close (trace); $len = @lines; @p = split("\\.",$source); $output = $p[0].".out"; open(output,">$output"); $x = 0; $i = 0; while ($i < $len) { if (($lines[$i] =~ /^.*SELECT.*$/i) || ($lines[$i] =~ /^.*INSERT.*$/i) || ($lines[$i] =~ /^.*UPDATE.*$/i) || ($lines[$i] =~ /^.*DELETE.*$/i)) { $x = $i; } if ($lines[$i] =~ /^.*TABLE ACCESS FULL DUAL.*$/i) { $i++; next; } if (($lines[$i] =~ /^.*SORT MERGE.*$/i) || ($lines[$i] =~ /^.*TABLE ACCESS FULL.*$/i)) { $y = $i; while ($lines[$i] ne "\n") { $y = $i; $i++; } print output "-------------------------------- --------------------------------\n"; for ($j = $x; $j <= $y; $j++) { if ($lines[$j] ne "\n") { if ( ($lines[$j] =~ /^call.*count.*$/) || ($lines[$j] =~ /^Parse.*$/) || ($lines[$j] =~ /^Execute .*$/) || ($lines[$j] =~ /^Fetch.*$/) || ($lines[$j] =~ /^total.*$/) || ($lines[$j] =~ /^—-.*$/) || ($lines[$j] =~ /^Misses.*$/) || ($lines[$j] =~ /^Optimizer.*$/) || ($lines[$j] =~ /^Parsing.*$/) ){ next; } print output "$lines[$j]"; } } } $i++; } close(output);
| < Day Day Up > |
|