Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: tkprof questions
I do my tkprof's in a scipt - that I've cleverly called tkp..
REID=$1 USER=$2 PASS=$3
QT=10
else
QT=$4
fi
## All one line
tkprof $UDUMP/ora_$REID_$ORACLE_SID.trc $REID.tkprof
explain=$USER/$PASS sort=prsqry,prscu,exeqry,execu,fchqry,fchcu sys=no
print=$QT
This gets me the worst SQL from what I've traced, sorted nicely :)
On Fri, 25 Aug 2000 22:18:03 +0200, Kjetil Skotheim <kjetilskotheim_at_iname.com> wrote:
>
>Vik wrote:
>>
>> 1. If I run:
>>
>> TKPROF x.trc ora x.txt SORT = exeela PRINT = 10
>
>Why the "ora " ?
>
>> shouldnt that give me the 10 most expensive queries in terms
>> of time to execute?
>
>Yes, I should think so.
>
>> 2. How do I get tkprof to aggregate queries that are repeated with
>> a different parameter? like:
>> select id from foo where name = a
>> select id from foo where name = b
>
>Best guess from someone will limited experience with tkprof:
>
>The problem is that you're not using bind variables! Using bind
>variables will also make your queries faster because then oracle
>will already have parsed the query, and the "parametrisized" query
>will turn up only once i tkprof: Typically, use:
>select avg(age) from emp where dept=:1;
>(One query in tkprof)
>Then bind 'SALES' and 'STORE' to :1 insted of using:
>select avg(age) from emp where dept='SALES';
>select avg(age) from emp where dept='STORE';
>(...witch will become two queries in tkprof).
o0o..o0o..o0o..o0o..o0o..o0o..o0o..o0o..o0o..o0o.o0o Kirt Thomas DBA- -kspamfreethomas_at_gfsiinc.com Received on Sat Aug 26 2000 - 11:41:51 CDT