Taking HeapDumps:
Heapdumps可以在当前会话通过使用命令alter system set events或者通过oradebug events命令.Heapdumps将会被写成一个trace文件到进程dump的目录下面(udump),它所包含的信息跟相应的表X$相同.
事件的语法是IMMEDIATE TRACE NAME HEAPDUMP LEVEL n. LEVEL的值可以是如下:1,2,4,8,32.这些值分别对应DUMP出来的信息是PGA,SGA,UGA,CGA,LARGE POOL.
Subheap dump事件的语法是IMMEDIATE TRACE NAME HEAPDUMP_ADDR LEVEL n. n是一个十六位的subheap地址描述符.这些地址可以从KSM X$表中的字段KSMCHPAR得到,也可以从heapdump的文件中的字符串ds=得到
SQLALTER SESSION SET TRACEFILE_IDENTIFIER=TEST
SQLALTER SESSION SET EVENTS ‘IMMEDIATE TRACE NAME HEAPDUMP LEVEL 1’;
然后到$Oracle_HOME/ADMIN/UDUMP下找到一个文件名含有TEST的文件用记事本打开,DUMP出来的文件大概如下:
*** 2004-11-30 10:42:09.000
******************************************************
HEAP DUMP heap name="pga heap"desc=067D1FE8---红色可以看到我们DUMP的是哪个HEAP,这里DUMP的PGA.
extent sz=0x213c alt=84 het=32767 rec=0 flg=2 opc=2
parent=00000000 owner=00000000 nex=00000000 xsz=0x25b8
EXTENT 0 addr=07BEB9A4---EXTENT号以及它的地址
Chunk7beb9ac sz= 9648freeable"kcrr kcrrpdi ar"
Chunk7beb9ac---Chunk地址
sz= 9648---这个Chunk的SIZE,以bytes为单位.
freeable----这个Chunk的类型
"kcrr kcrrpdi ar"----这个Chunk的用处描述
EXTENT 1 addr=07BE9854
Chunk7be985c sz= 8500perm"perm "alo=7524
EXTENT 2 addr=07BE7474
Chunk7be747c sz= 9156freeable"Fixed Uga"
EXTENT 3 addr=07BE5324
Chunk7be532c sz= 3764perm"perm "alo=3764
Chunk7be61e0 sz= 2788freeable"Alloc environm "ds=07B6ADF4
ds=07B6ADF4-----这个是前面讲到的Subheapdump的level,subheap的地址描述
Chunk7be6cc4 sz=540freeable"kopolal dvoid"
Chunk7be6ee0 sz=288freeable"kopolal dvoid"
Chunk7be7000 sz=220freeable"kopolal dvoid"
Chunk7be70dc sz=900freeable"kopolal dvoid"
EXTENT 4 addr=07BE31D4
Chunk7be31dc sz= 8440perm"perm "alo=8440
Chunk7be52d4 sz= 60free" "
EXTENT 5 addr=07BE1084
Chunk7be108c sz= 7096perm"perm "alo=7096
Chunk7be2c44 sz= 1140perm"perm "alo=1140
Chunk7be30b8 sz= 28free" "
Chunk7be30d4 sz= 36freeable"koh-kghu call h"
Chunk7be30f8 sz=200freeable"PLS cca hp desc"
EXTENT 6 addr=07BB0034
Chunk7bb003c sz= 3052perm"perm "alo=3052
Chunk7bb0c28 sz=404perm"perm "alo=404
Chunk7bb0dbc sz= 56free" "
Chunk7bb0df4 sz= 92freeable"joXP heap"
Chunk7bb0e50 sz= 36freeable"external name"
Chunk7bb0e74 sz= 36freeable"kzsna:login nam"
Chunk7bb0e98 sz=17012freeable"ksm stack"
EXTENT 7 addr=07B68D34
Chunk7b68d3c sz= 2000perm"perm "alo=2000
Chunk7b6950c sz=152perm"perm "alo=152
Chunk7b695a4 sz=116free" "
Chunk7b69618 sz=540freeable"kopolal dvoid"
Chunk7b69834 sz= 92freeable"KSFQ heap descr"
Chunk7b69890 sz= 16freeable"KSFH indicator "
Chunk7b698a0 sz= 4144recreate"Alloc environm "latch=00000000
ds7b6adf4 sz= 6932 ct=2
7be61e0 sz= 2788
Chunk7b6a8d0 sz= 1424freeable"kpuinit env han"
Total heap size=81976----这个heap的SIZE,
应该是以kb为单位.
FREE LISTS:-----这个PGA Free Lists的一些信息
BUCket 0 size=44---Bucket号以及其对应的Free Chunks SIZE,这个SIZE以bytes为单位.
Chunk7bb0dbc sz= 56free" "
Chunk7be52d4 sz= 60free" "
Chunk7be30b8 sz= 28free" "
Bucket 1 size=76
Bucket 2 size=96
Chunk7b695a4 sz=116free" "