ORACLE tkprof utility can read multiple SQL trace files

Don't we all command line workers get angry when a command can't read from stdin? I thought oracle's tkprof is one such command. I was wrong! This is very useful when there are many small SQL trace files or when one wants to tkprof zipped trace file as is, like below. I checked the generated file content briefly and as far as I can tell, aggregation was done correctly.

$ echo \*.trc | wc -w
     220
$ cat \*.trc | wc -l
 3391365
$ cat \*.trc | tkprof /dev/stdin all.tkprof
$ tail all.tkprof
     280  sessions in tracefile.
  3150861  user  SQL statements in trace file.
   79974  internal SQL statements in trace file.
   17923  SQL statements in trace file.
    4434  unique SQL statements in trace file.
 3391365  lines in trace file.


$ (gzcat orcl_ora_9120.trc.gz && gzcat orcl_ora_9845.trc.gz) | wc -l
 6829778
$ (gzcat orcl_ora_9120.trc.gz && gzcat orcl_ora_9845.trc.gz) | tkprof /dev/stdin /tmp/test.tkprof
$ tail /tmp/test.tkprof
       3  sessions in tracefile.
   50078  user  SQL statements in trace file.
      47  internal SQL statements in trace file.
   30583  SQL statements in trace file.
    8920  unique SQL statements in trace file.
 6829778  lines in trace file.
   15995  elapsed seconds in trace file.
Comments:

wish it worked for me, but it err's out

Posted by guest on October 20, 2012 at 01:21 AM JST #

I'm sorry that I didn't test extensively.
I didn't even test 11g. Hope I can check 11g behaviour soon.

Posted by owner on October 24, 2012 at 01:15 PM JST #

Post a Comment:
  • HTML Syntax: NOT allowed
About

The views expressed on this blog are my own and do not necessarily reflect the views of Oracle.

Search

Archives
« July 2015
SunMonTueWedThuFriSat
   
1
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
 
       
Today