TKPROF Trace Files Interpretation Scripts

 < Day Day Up > 



A Perl Wrapper Script

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 > 



Oracle High Performance Tuning for 9i and 10g
Oracle High Performance Tuning for 9i and 10g
ISBN: 1555583059
EAN: 2147483647
Year: 2003
Pages: 164

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net