Oracle's TKPROF

本文介绍了如何使用Oracle的TKPROF工具进行SQL跟踪和性能分析。包括如何启用SQL跟踪、设置定时统计信息、查找SQL跟踪文件及使用TKPROF解析跟踪文件的方法。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

TKPROF stands for transient kernel profiler[@more@]

Oracle's TKPROF

TKPROF stands for transient kernel profiler.

Enabling SQL TRACE

To be able to use TKPROF, you must first enable sql trace. This can be done for either the instance or the session. If you want to change it for the entire instance, set sql_trace=true into the init.ora file and restart the instance. However, usually, you'll want to turn on sql trace for a particular session only. This can be done like so:
=true;
or, from another session with a
sys.(session's id,serial number, true)

Timed Statistics

You can have Oracle include timing information into the sql trace files as well. Either set the timed_statistics parameter to true or issue an
=true;
or
=true;

Finding the SQL trace file

The trace files will be written into the directory pointed to by the parameter user_dump_dest. You can query for the value with select value from v$parameter where name = 'user_dump_dest'.

See find the trace file to see where the tk prof file goes.

Format of the trace file

See this link.

Maximum size of the trace file

The init parameter max_dump_file_size allows to set the maximum size of the trace files. Valid values for this parameter are: unlimited, a number followed by a K or a M or a number. If the value is a number only, it indicates how many OS Blocks the file can grow to. K or M set the file's maximum size in kilo or mega bytes.

Using tkprof

Thanks

Thanks to Julia Lovick who reported an error on this page.

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/330796/viewspace-867637/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/330796/viewspace-867637/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值