作者:david_zhang@sh 【转载时请以超链接形式标明文章】
链接:http://www.cnblogs.com/david-zhang-index/archive/2012/08/16/2642261.html
tkprof工具对跟踪文件进行格式化,提高可读性
Tkprof tracefile outputfile [explain= ] [table= ] [print= ] [insert= ] [sys= ] [sort= ]
1 [oracle@DCMSBDM trace]$ tkprof kobra_ora_31851.trc rich.prf 2 3 TKPROF: Release 11.2.0.1.0 - Development on Thu Aug 16 14:23:45 2012 4 5 Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved. 6 7 [oracle@DCMSBDM trace]$ more rich.prf 8 9 TKPROF: Release 11.2.0.1.0 - Development on Thu Aug 16 14:23:45 2012 10 11 Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved. 12 13 Trace file: kobra_ora_31851.trc 14 Sort options: default 15 16 ******************************************************************************** 17 count = number of times OCI procedure was executed 18 cpu = cpu time in seconds executing 19 elapsed = elapsed time in seconds executing 20 disk = number of physical reads of buffers from disk 21 query = number of buffers gotten for consistent read 22 current = number of buffers gotten in current mode (usually for update) 23 rows = number of rows processed by the fetch or execute call 24 ******************************************************************************** 25 26 SQL ID: 1a2g3z4rj1uq2 27 Plan Hash: 0 28 alter session set sql_trace true 29 30 31 call count cpu elapsed disk query current rows 32 ------- ------ -------- ---------- ---------- ---------- ---------- ---------- 33 Parse 0 0.00 0.00 0 0 0 0 34 Execute 1 0.00 0.00 0 0 0 0 35 Fetch 0 0.00 0.00 0 0 0 0 36 ------- ------ -------- ---------- ---------- ---------- ---------- ---------- 37 total 1 0.00 0.00 0 0 0 0 38 39 Misses in library cache during parse: 0 40 Misses in library cache during execute: 1 41 Optimizer mode: ALL_ROWS 42 Parsing user id: SYS 43 ******************************************************************************** 44 45 SQL ID: 0av1k7bxptgmb 46 Plan Hash: 535535045 47 select count(*) 48 from 49 fis.cdc_fp 50 51 52 call count cpu elapsed disk query current rows 53 ------- ------ -------- ---------- ---------- ---------- ---------- ---------- 54 Parse 1 0.00 0.00 0 0 0 0 55 Execute 1 0.00 0.00 0 0 0 0 56 Fetch 2 0.61 0.62 0 15042 0 1 57 ------- ------ -------- ---------- ---------- ---------- ---------- ---------- 58 total 4 0.61 0.62 0 15042 0 1 59 60 Misses in library cache during parse: 0 61 Optimizer mode: ALL_ROWS 62 Parsing user id: SYS 63 64 Rows Row Source Operation 65 ------- --------------------------------------------------- 66 1 SORT AGGREGATE (cr=15042 pr=0 pw=0 time=0 us) 67 2888020 INDEX FAST FULL SCAN CDC_FP_IDX1 (cr=15042 pr=0 pw=0 time=3240653 us cost=3965 size=0 card=2875579)(object id 209882) 68 69 ******************************************************************************** 70 71 SQL ID: 696kcb8k33r2u 72 Plan Hash: 0 73 alter session set sql_trace false 74 75 76 call count cpu elapsed disk query current rows 77 ------- ------ -------- ---------- ---------- ---------- ---------- ---------- 78 Parse 1 0.00 0.00 0 0 0 0 79 Execute 1 0.00 0.00 0 0 0 0 80 Fetch 0 0.00 0.00 0 0 0 0 81 ------- ------ -------- ---------- ---------- ---------- ---------- ---------- 82 total 2 0.00 0.00 0 0 0 0 83 84 Misses in library cache during parse: 1 85 Optimizer mode: ALL_ROWS 86 Parsing user id: SYS 87 88 89 90 ******************************************************************************** 91 92 OVERALL TOTALS FOR ALL NON-RECURSIVE STATEMENTS 93 94 call count cpu elapsed disk query current rows 95 ------- ------ -------- ---------- ---------- ---------- ---------- ---------- 96 Parse 2 0.00 0.00 0 0 0 0 97 Execute 3 0.00 0.00 0 0 0 0 98 Fetch 2 0.61 0.62 0 15042 0 1 99 ------- ------ -------- ---------- ---------- ---------- ---------- ---------- 100 total 7 0.61 0.62 0 15042 0 1 101 102 Misses in library cache during parse: 1 103 Misses in library cache during execute: 1 104 105 106 OVERALL TOTALS FOR ALL RECURSIVE STATEMENTS 107 108 call count cpu elapsed disk query current rows 109 ------- ------ -------- ---------- ---------- ---------- ---------- ---------- 110 Parse 0 0.00 0.00 0 0 0 0 111 Execute 0 0.00 0.00 0 0 0 0 112 Fetch 0 0.00 0.00 0 0 0 0 113 ------- ------ -------- ---------- ---------- ---------- ---------- ---------- 114 total 0 0.00 0.00 0 0 0 0 115 116 Misses in library cache during parse: 0 117 118 3 user SQL statements in session. 119 0 internal SQL statements in session. 120 3 SQL statements in session. 121 ******************************************************************************** 122 Trace file: kobra_ora_31851.trc 123 Trace file compatibility: 11.1.0.7 124 Sort options: default 125 126 1 session in tracefile. 127 3 user SQL statements in trace file. 128 0 internal SQL statements in trace file. 129 3 SQL statements in trace file. 130 3 unique SQL statements in trace file. 131 49 lines in trace file. 132 50 elapsed seconds in trace file.