linuxsir首页 LinuxSir.Org | Linux、BSD、Solaris、Unix | 开源传万世,因有我参与欢迎您!
网站首页 | 设为首页 | 加入收藏
您所在的位置:主页 > Linux数据库 >

Oracle 11g R2性能优化 tkprof

时间:2019-02-16  来源:未知  作者:admin666
-- 开启跟踪期间所有递归SQL语句执行信息统计汇总 OVERALL TOTALS FOR ALL RECURSIVE STATEMENTS call count cpu elapsed disk query current rows ------- ------ -------- ---------- ---------- ---------- ---------- ---------- Parse 0 0.00 0.00 0 0 0 0 Execute 23 0.00 0.00 0 0 0 0 Fetch 37 0.00 0.00 2 82 0 28 ------- ------ -------- ---------- ---------- ---------- ---------- ---------- total 60 0.00 0.00 2 82 0 28 Misses in library cache during parse: 0 Elapsed times include waiting on following events: Event waited on Times Max. Wait Total Waited ---------------------------------------- Waited ---------- ------------ db file sequential read 2 0.00 0.00 -- 所有分析的SQL语句汇总统计 3 user SQL statements in session. 13 internal SQL statements in session. 16 SQL statements in session. 1 statement EXPLAINed in this session. ******************************************************************************** Trace file: /data/app/oracle/diag/rdbms/dbabd/dbabd/trace/dbabd_ora_18629_SCOTT.trc Trace file compatibility: 11.1.0.7 Sort options: fchela 1 session in tracefile. 3 user SQL statements in trace file. 13 internal SQL statements in trace file. 16 SQL statements in trace file. 16 unique SQL statements in trace file. 1 SQL statements EXPLAINed using schema: SCOTT.prof$plan_table Default table was used. Table was created. Table was dropped. 411 lines in trace file. 196 elapsed seconds in trace file.

以上梳理了关于tkprof工具的简单用法,经过它格式化之后的trace文件更具有可读性,真实地统计了SQL语句在执行过程当中资源的消耗。但是它提供的是汇总后的统计信息,如果需要了解SQL语句执行时每个步骤的资源消耗情况可以通过阅读原始的trace文件,这里不再进行深入讨论了。SQL性能优化博大精深,涉及的知识面广泛,也经常涉及Oracle底层运行机制和操作系统底层实现,需要自己学习与提高的地方还有很多。

https://docs.oracle.com/cd/E11882_01/server.112/e41573/sqltrace.htm
TKProf Interpretation (9i and above) (文档 ID 760786.1)

更多Oracle相关信息见Oracle 专题页面 https://www.linuxidc.com/topicnews.aspx?tid=12

Linux公社的RSS地址:https://www.linuxidc.com/rssFeed.aspx

友情链接