oracle event heapdump_sga dump_shared pool_pga_uga

wisdomone1發表於2013-03-28

/*******dump pga******也即level 1匯出pga的資訊*****/
SQL> alter session set events 'immediate trace name heapdump level 1';
 
Session altered

/****pga trace如下***********/
******************************************************
/****pga是採用記憶體堆方面管理,由多個heap組成*********/
HEAP DUMP heap name="pga heap"  desc=00000000177ABD20
 extent sz=0x20c0 alt=216 het=32767 rec=0 flg=2 pc=2
 parent=0000000000000000 wner=0000000000000000 nex=0000000000000000 xsz=0xfff0 heap=0000000000000000
 fl2=0x60, nex=0000000000000000
 
/**********多個區extent組成************/
EXTENT 0 addr=000000001FA90010
  Chunk        01fa90020 sz=    61280    free      "               "
  Chunk        01fa9ef80 sz=     4224    freeable  "diag pga       "  ds=000000001DA20708
EXTENT 1 addr=000000001FA80010
/*******每個區由多個chunk組成************/
  Chunk        01fa80020 sz=     9736    perm      "perm           "  alo=9736
  Chunk        01fa82628 sz=     2504    freeable  "diag pga       "  ds=000000001DA20708
  Chunk        01fa82ff0 sz=     6112    freeable  "diag pga       "  ds=000000001DA20708
  Chunk        01fa8f980 sz=      592    freeable  "kopolal void   "
  Chunk        01fa8fbd0 sz=     1072    freeable  "kopolal void   "
EXTENT 2 addr=000000001DA366F8
/**********每個chunk有地址,大小,狀態,所對應的latch**************/
  Chunk        01da36708 sz=     3952    perm      "perm           "  alo=3952
  Chunk        01da37678 sz=       48    free      "               "
  Chunk        01da376a8 sz=     4104    recreate  "dbgdInitEventG "  latch=0000000000000000
     ds        01efd8d60 sz=     4104 ct=        1
  Chunk        01da386b0 sz=      264    freeable  "dbgdInitEventGr"
EXTENT 3 addr=000000001DA32438
  Chunk        01da32448 sz=    17024    freeable  "kgh stack      "
  Chunk        01da23458 sz=     8256    freeable  "diag pga       "  ds=000000001DA20708
---中間略----------
/***********上述extent的總計*********即heap由多個區組成,而每個區又是由多個chunk組成**********/
Total heap size    =   380680

/************自由列表**************/
FREE LISTS:
/********自由列表也是由多個bucket桶組成***********/
 Bucket 0 size=56
 /********每個桶由多個chunk組成*************/
  Chunk        01da37678 sz=       48    free      "               "
  Chunk        01da67b20 sz=        0    kghdsx
 Bucket 1 size=88
 Bucket 2 size=152
 Bucket 17 size=2097176
 /**********自由列表的總計***************/
Total free space   =    61328
/******未pin住可重建狀態的chunks即lru first******也即pin chunks不能重用*******/
UNPINNED RECREATABLE CHUNKS (lru first):

/********永久性的chunks分配情況******這個永久性的chunks源來上述的free list和heap中的chunk**********/
PERMANENT CHUNKS:
  Chunk        01fa80020 sz=     9736    perm      "perm           "  alo=9736
  Chunk        01efd8d00 sz=       72    perm      "perm           "  alo=72
---中間略
  Chunk        01da67b50 sz=       80    perm      "perm           "  alo=80
  Chunk        01da67b00 sz=       80    perm      "perm           "  alo=80
/******永久性chunk總計*************/ 
Permanent space    =   133248
******************************************************
******************************************************
HEAP DUMP heap name="top call heap"  desc=00000000177B1520
 extent sz=0x20c0 alt=232 het=32767 rec=0 flg=2 pc=3
 parent=0000000000000000 wner=0000000000000000 nex=0000000000000000 xsz=0xfff8 heap=0000000000000000
 fl2=0x20, nex=0000000000000000
 
/**********區號0的chunk分配資訊**********/
EXTENT 0 addr=000000001FA70008
  Chunk        01fa70018 sz=       80    perm      "perm           "  alo=80
  Chunk        01fa70068 sz=    32752    perm      "perm           "  alo=560
  Chunk        01fa78058 sz=    31648    free      "               "
  Chunk        01fa7fbf8 sz=     1032    recreate  "callheap       "  latch=0000000000000000
     ds        0177b0620 sz=     1032 ct=        1
Total heap size    =    65512
FREE LISTS:
 Bucket 0 size=56
  Chunk        01fa70038 sz=        0    kghdsx
 Bucket 1 size=88
 Bucket 2 size=152
 Bucket 17 size=2097176
Total free space   =    31648
UNPINNED RECREATABLE CHUNKS (lru first):
PERMANENT CHUNKS:
  Chunk        01fa70068 sz=    32752    perm      "perm           "  alo=560
  Chunk        01fa70018 sz=       80    perm      "perm           "  alo=80
Permanent space    =    32832
******************************************************
******************************************************
HEAP DUMP heap name="top uga heap"  desc=00000000177B1740
 extent sz=0xffc0 alt=232 het=32767 rec=0 flg=2 pc=0
 parent=0000000000000000 wner=0000000000000000 nex=0000000000000000 xsz=0x0 heap=0000000000000000
 fl2=0x20, nex=0000000000000000
 

/************開啟level 2 heapdump******************/
SQL> alter session set events 'immediate trace name heapdump level 2';
 
Session altered


 
/********主要看下level 2包括什麼內容************/
KGH Latch Directory Information
ldir state: 2  last allocated slot: 104 --記錄上次分配的slot位置
/*******共計104個slot**********/
Slot [  1] Latch: 00000000082173D0  Index: 1  Flags:  3  State: 2  next:  0000000000000000
Slot [  2] Latch: 000000000821A760  Index: 1  Flags:  3  State: 2  next:  0000000000000000
Slot [  3] Latch: 000007FF3E339A18  Index: 1  Flags:  3  State: 2  next:  0000000000000000
Slot [  4] Latch: 000007FF3E339AF8  Index: 1  Flags:  3  State: 2  next:  000000000FE6BF30
Slot [  5] Latch: 000000000821AB20  Index: 1  Flags:  3  State: 2  next:  0000000000000000
--中間略
Slot [104] Latch: 00000000082507A0  Index: 1  Flags:  3  State: 2  next:  000000000FE6C818
******************************************************
/*****sga開始dump**********/
HEAP DUMP heap name="sga heap"  desc=000000000820E730
 extent sz=0x9800 alt=248 het=32767 rec=9 flg=-126 pc=0
 parent=0000000000000000 wner=0000000000000000 nex=0000000000000000 xsz=0x0 heap=0000000000000000
 fl2=0x60, nex=0000000000000000
 ds for latch 1: 0xfdb8a30 0xfdba288 0xfdbbae0 0xfdbd338
 reserved granule count 48 (granule size 4194304)--與下面的RESERVED EXTENTS呼應
/*********保留的區個數*****共計48個******/
RESERVED EXTENTS
  0x28c00000 0x2d800000 0x2d400000 0x2d000000
  0x2cc00000 0x2c800000 0x2c400000 0x2c000000
---中間略
  0x35c00000 0x35800000 0x35400000 0x35000000
Counted elements on list: 48 --前後呼應
******************************************************
HEAP DUMP heap name="sga heap(1,0)"  desc=000000000FDB8A30
/******rec我理解即有幾個sub heap個數*********/
 extent sz=0xfe0 alt=248 het=32767 rec=9 flg=-126 pc=0
 parent=0000000000000000 wner=0000000000000000 nex=0000000000000000 xsz=0x400000 heap=0000000000000000
 fl2=0x20, nex=0000000000000000
 latch set 1 of 1
 durations enabled for this heap
 reserved granules for root 48 (granule size 4194304)
/*****區分配********/
EXTENT 0 addr=000007FF29400000
  Chunk      7ff29400058 sz=       48  R-freeable  "reserved stoppe"
  Chunk      7ff29400088 sz=   212808  R-free      "               "
  Chunk      7ff29433fd0 sz=       48  R-freeable  "reserved stoppe"
  Chunk      7ff29434000 sz=  3981312    perm      "perm           "  alo=185728
  ---中間略
EXTENT 21 addr=000007FF3EC00000
  Chunk      7ff3ec00058 sz=       80    perm      "perm           "  alo=80
  Chunk      7ff3ec000a8 sz=       48  R-freeable  "reserved stoppe"
  Chunk      7ff3ec000d8 sz=   212728  R-free      "               "
  Chunk      7ff3ec33fd0 sz=       48  R-freeable  "reserved stoppe"
  Chunk      7ff3ec34000 sz=  3978016    perm      "perm           "  alo=3978016
  Chunk      7ff3efff320 sz=     3296    perm      "perm           "  alo=3272
Total heap size    = 92272752
/********自由列表*************/
FREE LISTS:
 Bucket 0 size=32
  Chunk      7ff3ec00078 sz=        0    kghdsx
 Bucket 1 size=40
---中間略
 Bucket 254 size=65560
Total free space   =    18272

/********上述的自由列表的增強,即保留的自由列表,結構和free list一樣******/
RESERVED FREE LISTS:
 Reserved bucket 0 size=32
  Chunk      7ff39bff288 sz=     3400  R-free      "               "
 Reserved bucket 1 size=4400
 --中間略
  Chunk      7ff3a2000a8 sz=  2096936  R-free      "               "
  /********保留自由列表總計*********/
Total reserved free space   =  8031576 

/*******未pin可重構的chunk 即lru first列表的詳細資訊*************/
UNPINNED RECREATABLE CHUNKS (lru first):
  Chunk      7ff3eb95550 sz=       56    recreate  "fixed allocatio"  latch=0000000008228660
 --中間略
     ds      7ff393fc3b0 sz=     4096 ct=        1
  Chunk      7ff38fff000 sz=     4096    recreate  "SQLA^aa0beccb  "  latch=0000000000000000
     ds      7ff393f67d0 sz=    12288 ct=        3
             7ff38f58d20 sz=     4096
             7ff38fef000 sz=     4096
Total heap size    = 41942160
/******自由列表************/
FREE LISTS:
 Bucket 0 size=32
  Chunk      7ff38c00078 sz=        0    kghdsx
 Bucket 1 size=40
 --中間略
 Bucket 254 size=65560
  Chunk      7ff29034000 sz=  2739952    free      "               "
Total free space   =  2766232

/*****保留自由列表*******/
RESERVED FREE LISTS:
 Reserved bucket 0 size=32
 ---中間略
  Chunk      7ff38c000d8 sz=   212728  R-free      "               "
 Reserved bucket 14 size=1990644
Total reserved free space   =  2128000
UNPINNED RECREATABLE CHUNKS (lru first):
SEPARATOR
Unpinned space     =        0  rcr=0 trn=0
PERMANENT CHUNKS:
  Chunk      7ff38c00058 sz=       80    perm      "perm           "  alo=80
Permanent space    =       80
******************************************************

 


/****level 3 trace如下*******新增了uga trace********/
******************************************************
HEAP DUMP heap name="top uga heap"  desc=0000000017A67520
 extent sz=0xffc0 alt=232 het=32767 rec=0 flg=2 pc=0
 parent=0000000000000000 wner=0000000000000000 nex=0000000000000000 xsz=0x0 heap=0000000000000000
 fl2=0x20, nex=0000000000000000
 
小結:1,alter session set events 'immediate trace name heapdump level 3';
        dump sga內部結構:即shared pool,pga,uga的組成,free list,reversed free list,latch,extent,chunk
      2,level 3>level 2>level 1

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/9240380/viewspace-757358/,如需轉載,請註明出處,否則將追究法律責任。

相關文章