设为首页
收藏本站
开启辅助访问
切换到窄版
登录
立即注册
中问网首页
我的收藏
站长博客
搜索
搜索
本版
帖子
用户
第一问答网
»
论坛
›
中问网
›
问答
›
怎么看tkprof后的trace文件?
返回列表
发新帖
怎么看tkprof后的trace文件?
[复制链接]
11
|
7
|
2007-9-26 18:42:10
|
显示全部楼层
|
阅读模式
我使用了alter session set events '10046 trace name context forever,level 12';来trace session。
我对tkprof后的trace文件只能看懂很少的一部分,
如query 对应 consistent gets
Parsing下的为执行计划。
但这里还有很多的内容的,我就不太清楚。
比如:
1、如何看出是软分析还是硬分析;
2、如何看出是否绑定;是不是看是否有执行计划?
3、以下是不是的Parse2、Execute 2、Fetch4是不是说明该sql有一次硬分析,1次软分析,执行了2次?
还是因为Misses in library cache during parse: 2说明2次都是硬分析呢?
call count cpuelapsed diskquerycurrentrows
------- -------------- ---------- ---------- ---------- --------------------
Parse20.00 0.00
0
0
0 0
Execute20.01 0.00
0
0
0 0
Fetch40.06 0.05
0 2156
0 4
------- -------------- ---------- ---------- ---------- --------------------
total80.07 0.05
0 2156
0 4
Misses in library cache during parse: 2
4、最后的部分的各个项的含义应该都是汇总信息吧:
OVERALL TOTALS FOR ALL NON-RECURSIVE STATEMENTS
call count cpuelapsed diskquerycurrentrows
------- -------------- ---------- ---------- ---------- --------------------
Parse 8750 11.1813.82
0120
0 0
Execute 87511.81 2.34
0
0
0 0
Fetch16273103.85 122.51 86453527064
08926
------- -------------- ---------- ---------- ---------- --------------------
total33774116.84 138.69 86453527184
08926
Misses in library cache during parse: 3701
OVERALL TOTALS FOR ALL RECURSIVE STATEMENTS
call count cpuelapsed diskquerycurrentrows
------- -------------- ---------- ---------- ---------- --------------------
Parse 300.03 0.09
1 39
0 0
Execute 560.00 0.00
0
0
0 0
Fetch1770.01 0.00
0221
0 133
------- -------------- ---------- ---------- ---------- --------------------
total2630.04 0.10
1260
0 133
Misses in library cache during parse: 13
8751userSQL statements in session.
30internal SQL statements in session.
8781SQL statements in session.
********************************************************************************
Trace file: e:\work_doc\sdp\unicode_ora_2627.trc
Trace file compatibility: 9.00.01
Sort options: default
1session in tracefile.
8751userSQL statements in trace file.
30internal SQL statements in trace file.
8781SQL statements in trace file.
3232unique SQL statements in trace file.
128622lines in trace file.
其中Misses in library cache during parse: 3701 是不是说明硬分析有这么多?
8781SQL statements in trace file.
3232unique SQL statements in trace file.
这是不是说明8781- 3232=5549的sql是与其他sql相同的?
最后部分也应该能看出绑定等信息吧。
请教大家了。
回复
使用道具
举报
千问
|
2007-9-26 18:42:10
|
显示全部楼层
我也想知道
回复
使用道具
举报
千问
|
2007-9-26 18:42:10
|
显示全部楼层
这个,看看tom的oracle高效率设计吧。要说清楚还是要花不少篇幅的。
回复
使用道具
举报
千问
|
2007-9-26 18:42:10
|
显示全部楼层
最初由 monkeyai 发布
[B]这个,看看tom的oracle高效率设计吧。要说清楚还是要花不少篇幅的。 [/B]
我现在没法看到这本书,能先帮我点点吗?
回复
使用道具
举报
千问
|
2007-9-26 18:42:10
|
显示全部楼层
最初由 cjf107 发布
[B]我使用了alter session set events '10046 trace name context forever,level 12';来trace session。
我对tkprof后的trace文件只能看懂很少的一部分,
如query 对应 consistent gets
Parsing下的为执行计划。
但这里还有很多的内容的,我就不太清楚。
比如:
1、如何看出是软分析还是硬分析;
2、如何看出是否绑定;是不是看是否有执行计划?
3、以下是不是的Parse2、Execute 2、Fetch4是不是说明该sql有一次硬分析,1次软分析,执行了2次?
还是因为Misses in library cache during parse: 2说明2次都是硬分析呢?
parse 1次,而execute大于1次,就表示使用了绑定。
现在这种情况是没有使用绑定变量,导致执行2次需要解析2次。
[/COLOR]
call count cpuelapsed diskquerycurrentrows
------- -------------- ---------- ---------- ---------- --------------------
Parse20.00 0.00
0
0
0 0
Execute20.01 0.00
0
0
0 0
Fetch40.06 0.05
0 2156
0 4
------- -------------- ---------- ---------- ---------- --------------------
total80.07 0.05
0 2156
0 4
Misses in library cache during parse: 2
4、最后的部分的各个项的含义应该都是汇总信息吧:
OVERALL TOTALS FOR ALL NON-RECURSIVE STATEMENTS
call count cpuelapsed diskquerycurrentrows
------- -------------- ---------- ---------- ---------- --------------------
Parse 8750 11.1813.82
0120
0 0
Execute 87511.81 2.34
0
0
0 0
Fetch16273103.85 122.51 86453527064
08926
------- -------------- ---------- ---------- ---------- --------------------
total33774116.84 138.69 86453527184
08926
Misses in library cache during parse: 3701
OVERALL TOTALS FOR ALL RECURSIVE STATEMENTS
call count cpuelapsed diskquerycurrentrows
------- -------------- ---------- ---------- ---------- --------------------
Parse 300.03 0.09
1 39
0 0
Execute 560.00 0.00
0
0
0 0
Fetch1770.01 0.00
0221
0 133
------- -------------- ---------- ---------- ---------- --------------------
total2630.04 0.10
1260
0 133
Misses in library cache during parse: 13
8751userSQL statements in session.
30internal SQL statements in session.
8781SQL statements in session.
********************************************************************************
Trace file: e:\work_doc\sdp\unicode_ora_2627.trc
Trace file compatibility: 9.00.01
Sort options: default
1session in tracefile.
8751userSQL statements in trace file.
30internal SQL statements in trace file.
8781SQL statements in trace file.
3232unique SQL statements in trace file.
128622lines in trace file.
其中Misses in library cache during parse: 3701 是不是说明硬分析有这么多?
8781SQL statements in trace file.
3232unique SQL statements in trace file.
这是不是说明8781- 3232=5549的sql是与其他sql相同的?
最后部分也应该能看出绑定等信息吧。
这里应该是说有3232 条sql语句是独一无二的,但不能说明就一定没有使用绑定变量,说不定绑定了,也只执行一次。
[/COLOR]
请教大家了。 [/B]
回复
使用道具
举报
千问
|
2007-9-26 18:42:10
|
显示全部楼层
最初由 hanson 发布
parse 1次,而execute大于1次,就表示使用了绑定。
现在这种情况是没有使用绑定变量,导致执行2次需要解析2次。
[B] [/B]
我觉得用了绑定也可能出现parse=execute,都大于1次,这时的parse为软解析:
如我先alter session set events '10046 trace name context forever,level 12';
再用exec :var :=不同的值,手工运行同一个sql16次,在trace文件中只出现一次这个sql,其中如下:
call count cpuelapsed diskquerycurrentrows
------- -------------- ---------- ---------- ---------- --------------------
Parse 160.01 0.01
0
2
0 0
Execute 160.00 0.00
0
0
0 0
Fetch 180.01 0.38472 1058
0
10
------- -------------- ---------- ---------- ---------- --------------------
total 500.03 0.40472 1060
0
10
Misses in library cache during parse: 1
Optimizer goal: CHOOSE
Parsing user id:
这样应该是进行了bind的,而在Misses in library cache during parse: 1
也应该说明了这个问题。
回复
使用道具
举报
千问
|
2007-9-26 18:42:10
|
显示全部楼层
最初由 cjf107 发布
[B]我使用了alter session set events '10046 trace name context forever,level 12';来trace session。
我对tkprof后的trace文件只能看懂很少的一部分,
如query 对应 consistent gets
Parsing下的为执行计划。
但这里还有很多的内容的,我就不太清楚。
比如:
1、如何看出是软分析还是硬分析;
2、如何看出是否绑定;是不是看是否有执行计划?
3、以下是不是的Parse2、Execute 2、Fetch4是不是说明该sql有一次硬分析,1次软分析,执行了2次?
还是因为Misses in library cache during parse: 2说明2次都是硬分析呢?
call count cpuelapsed diskquerycurrentrows
------- -------------- ---------- ---------- ---------- --------------------
Parse20.00 0.00
0
0
0 0
Execute20.01 0.00
0
0
0 0
Fetch40.06 0.05
0 2156
0 4
------- -------------- ---------- ---------- ---------- --------------------
total80.07 0.05
0 2156
0 4
Misses in library cache during parse: 2
4、最后的部分的各个项的含义应该都是汇总信息吧:
OVERALL TOTALS FOR ALL NON-RECURSIVE STATEMENTS
call count cpuelapsed diskquerycurrentrows
------- -------------- ---------- ---------- ---------- --------------------
Parse 8750 11.1813.82
0120
0 0
Execute 87511.81 2.34
0
0
0 0
Fetch16273103.85 122.51 86453527064
08926
------- -------------- ---------- ---------- ---------- --------------------
total33774116.84 138.69 86453527184
08926
Misses in library cache during parse: 3701
OVERALL TOTALS FOR ALL RECURSIVE STATEMENTS
call count cpuelapsed diskquerycurrentrows
------- -------------- ---------- ---------- ---------- --------------------
Parse 300.03 0.09
1 39
0 0
Execute 560.00 0.00
0
0
0 0
Fetch1770.01 0.00
0221
0 133
------- -------------- ---------- ---------- ---------- --------------------
total2630.04 0.10
1260
0 133
Misses in library cache during parse: 13
8751userSQL statements in session.
30internal SQL statements in session.
8781SQL statements in session.
********************************************************************************
Trace file: e:\work_doc\sdp\unicode_ora_2627.trc
Trace file compatibility: 9.00.01
Sort options: default
1session in tracefile.
8751userSQL statements in trace file.
30internal SQL statements in trace file.
8781SQL statements in trace file.
3232unique SQL statements in trace file.
128622lines in trace file.
其中Misses in library cache during parse: 3701 是不是说明硬分析有这么多?
8781SQL statements in trace file.
3232unique SQL statements in trace file.
这是不是说明8781- 3232=5549的sql是与其他sql相同的?
最后部分也应该能看出绑定等信息吧。
请教大家了。 [/B]
Misses in library cache during parse: 2,这说明有2次硬分析;
parse和execute的值大小接近,说明未使用绑定变量;
最后一部分是汇总信息,Misses in library cache during parse: 3701 说明有3701次硬分析。
更详细的解释请点击这个链接http://dbaoracle.itpub.net/post/901/127799。
或者下载下面这个文档。
回复
使用道具
举报
千问
|
2007-9-26 18:42:10
|
显示全部楼层
最初由 cjf107 发布
[B]
我觉得用了绑定也可能出现parse=execute,都大于1次,这时的parse为软解析:
如我先alter session set events '10046 trace name context forever,level 12';
再用exec :var :=不同的值,手工运行同一个sql16次,在trace文件中只出现一次这个sql,其中如下:
call count cpuelapsed diskquerycurrentrows
------- -------------- ---------- ---------- ---------- --------------------
Parse 160.01 0.01
0
2
0 0
Execute 160.00 0.00
0
0
0 0
Fetch 180.01 0.38472 1058
0
10
------- -------------- ---------- ---------- ---------- --------------------
total 500.03 0.40472 1060
0
10
Misses in library cache during parse: 1
Optimizer goal: CHOOSE
Parsing user id:
这样应该是进行了bind的,而在Misses in library cache during parse: 1
也应该说明了这个问题。 [/B]
此时可以得知这16个sql的运行只在v$sqlarea中产生1行记录。
我该如何使软分析消失呢?
回复
使用道具
举报
返回列表
发新帖
高级模式
B
Color
Image
Link
Quote
Code
Smilies
您需要登录后才可以回帖
登录
|
立即注册
本版积分规则
发表回复
回帖后跳转到最后一页
千问
主题
0
回帖
4882万
积分
论坛元老
论坛元老, 积分 48824836, 距离下一级还需 -38824837 积分
论坛元老, 积分 48824836, 距离下一级还需 -38824837 积分
积分
48824836
加好友
发消息
回复楼主
返回列表
问答
热门排行
1
男性严重弱精能治愈吗?
2
男性一侧乳头为什么会突然疼痛
3
男性腋下疼痛会不会有乳腺
4
男性遗精频繁可以吃什么药
5
男性原发不孕症什么意思
6
男性再障性贫血治愈后能生孩子吗
7
男性阴囊潮湿发臭是什么病
8
男性右侧乳腺发育要紧吗
9
男性在治疗性功能障碍时能备孕吗
10
男性怎么检查有没有乳腺癌
11
男性阴囊潮湿用什么药物清洗
12
男性有血尿应该注意什么
13
男性怎么判断自己是不是乳腺增生
14
男性左侧乳腺发育是乳腺癌吗
15
男婴鞘膜积液症状
16
男右侧输精管炎症的症状
17
男子精子畸形率100就一定代表不育吗?
18
男性中度贫血怎么调理
19
南瓜子对治愈脂肪瘤有效果吗
20
囊腺性肿瘤有什么症状
21
脑癌的生存期一般是多久
22
脑癌的晚期吐血还有多长时间
23
男婴睾丸鞘膜积液不手术能治吗?
24
男子左侧精索静脉轻度曲张怎么治疗
25
男左胸乳房隐隐作痛是什么原因引起的
26
脑癌的肿瘤标志物是什么
27
脑癌晚期会出现哪些症状?
28
脑癌晚期会怎么样
29
脑癌通过什么会传染
30
脑癌发病率是多少
31
脑癌晚期能做手术吗
32
脑部恶性淋巴瘤能治好吗
33
脑部白血病头全部痛吗
34
脑部恶性淋巴瘤晚期的症状
35
脑部ct有阴影是脑瘤吗
36
脑部恶性肿瘤手术后复发什么症状
37
脑部放疗后遗症多久出现
38
脑部ct能检查出垂体瘤吗
39
脑部胶质瘤二级是良性的吗
40
脑部胶质瘤手术切除后多久会复发快吗
41
脑部良性肿瘤手术后需要放疗吗?
42
脑部小肿瘤可以做微创吗
43
脑部放疗后有什么后遗症
44
脑部胶质瘤在神经上可以治疗吗
45
脑部淋巴瘤一般长多久才发病
46
脑部肿瘤不手术的情况下用什么方法治疗
47
脑部有一块白色是不是肿瘤?
48
脑部肿瘤吃什么中药有治疗效果
49
脑部胶质瘤4级严重吗
50
脑部蛛网膜囊肿是什么病
51
脑部肿瘤有靶向药吗
52
脑出血后遗症肌肉痉挛吃什么药
53
脑出血术后脑积水怎么治疗好
54
脑出血脑挫裂伤几天能好
55
脑蛋白水解物片长期吃的危害
56
脑动脉瘤不手术成活率有多少
57
脑出血颅骨修复手术后怎么康复
58
脑部做放疗会有什么伤害
59
脑动脉瘤会引起视力模糊吗
60
脑垂体ct检查没问题还需要核磁共振吗
61
脑动脉瘤做过介入手术还有可能再有吗做过
62
脑动脉瘤破裂能保守治疗治愈吗?
63
脑动脉瘤下支架前还能吃阿司匹林肠溶片吗
64
脑动脉瘤为什么要放支架
65
脑干大面积损伤后能治好吗
66
脑梗车祸引起的,怎么办?
67
脑动脉瘤渗血需要手术吗
68
脑梗导致右边瘫痪可以恢复吗
69
脑干损伤ct能看出来吗
70
脑供血不足,贫血会导致耳鸣吗
71
脑积水脑瘤有什么症状
72
脑积水后遗症康复治疗
73
脑积水使用甘露醇后多久复查头颅Ct
74
脑积水分流手术后多久恢复期
75
脑脊液样密度影一定是囊肿吗
76
脑脊液检查淋巴细胞增高
77
脑脊液细胞学检查正常值
78
脑寄生虫病潜伏期多久
79
脑供血不足导致的眩晕症状
80
脑脊液是什么颜色的液体
81
脑胶质瘤病人吃饭困难怎么办
82
脑胶质瘤后期为什么不大便呢
83
脑积水是指脑室内有多少脑脊液
84
脑胶质瘤ct能查出来吗
85
脑胶质瘤ct可以检查出来吗
86
脑胶质瘤术后又在别的区域长了怎么办
87
脑胶质瘤手术后化疗用靶向治疗可以吗
88
脑胶质瘤晚期不睡觉怎么办
89
脑胶质瘤不做手术可以吗
90
脑胶质瘤用替莫唑胺有效果吗
91
脑胶质瘤手术后需要放疗和化疗吗?
92
脑胶质瘤临终症状有哪些
93
脑壳神经痛想吐怎么回事
94
脑胶质瘤可以吃中药吗
95
脑结核早期症状和晚期症状
96
脑瘤病人经常晕倒怎么办
97
脑瘤不做手术做放疗最后会怎么样
98
脑瘤病人打嗝是什么原因
99
脑瘤发展到什么情况会脑疝
100
脑瘤吃什么中药可以保守治疗