Oracle記憶體結構(四)----如何獲得Oracle各記憶體段的內部資訊(轉)

zhouwf0726發表於2019-03-13

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=得到

SQL>ALTER SESSION SET TRACEFILE_IDENTIFIER=TEST

SQL>ALTER 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號以及它的地址

Chunk 7beb9ac sz= 9648 freeable "kcrr kcrrpdi ar"

Chunk 7beb9ac---Chunk地址

sz= 9648---這個Chunk的SIZE,以bytes為單位.

freeable----這個Chunk的型別

"kcrr kcrrpdi ar"----這個Chunk的用處描述

EXTENT 1 addr=07BE9854

Chunk 7be985c sz= 8500 perm "perm " alo=7524

EXTENT 2 addr=07BE7474

Chunk 7be747c sz= 9156 freeable "Fixed Uga "

EXTENT 3 addr=07BE5324

Chunk 7be532c sz= 3764 perm "perm " alo=3764

Chunk 7be61e0 sz= 2788 freeable "Alloc environm " ds=07B6ADF4

ds=07B6ADF4-----這個是前面講到的Subheapdump的level,subheap的地址描述

Chunk 7be6cc4 sz= 540 freeable "kopolal dvoid "

Chunk 7be6ee0 sz= 288 freeable "kopolal dvoid "

Chunk 7be7000 sz= 220 freeable "kopolal dvoid "

Chunk 7be70dc sz= 900 freeable "kopolal dvoid "

EXTENT 4 addr=07BE31D4

Chunk 7be31dc sz= 8440 perm "perm " alo=8440

Chunk 7be52d4 sz= 60 free " "

EXTENT 5 addr=07BE1084

Chunk 7be108c sz= 7096 perm "perm " alo=7096

Chunk 7be2c44 sz= 1140 perm "perm " alo=1140

Chunk 7be30b8 sz= 28 free " "

Chunk 7be30d4 sz= 36 freeable "koh-kghu call h"

Chunk 7be30f8 sz= 200 freeable "PLS cca hp desc"

EXTENT 6 addr=07BB0034

Chunk 7bb003c sz= 3052 perm "perm " alo=3052

Chunk 7bb0c28 sz= 404 perm "perm " alo=404

Chunk 7bb0dbc sz= 56 free " "

Chunk 7bb0df4 sz= 92 freeable "joxp heap "

Chunk 7bb0e50 sz= 36 freeable "external name "

Chunk 7bb0e74 sz= 36 freeable "kzsna:login nam"

Chunk 7bb0e98 sz= 17012 freeable "ksm stack "

EXTENT 7 addr=07B68D34

Chunk 7b68d3c sz= 2000 perm "perm " alo=2000

Chunk 7b6950c sz= 152 perm "perm " alo=152

Chunk 7b695a4 sz= 116 free " "

Chunk 7b69618 sz= 540 freeable "kopolal dvoid "

Chunk 7b69834 sz= 92 freeable "KSFQ heap descr"

Chunk 7b69890 sz= 16 freeable "KSFH indicator "

Chunk 7b698a0 sz= 4144 recreate "Alloc environm " latch=00000000

ds 7b6adf4 sz= 6932 ct= 2

7be61e0 sz= 2788

Chunk 7b6a8d0 sz= 1424 freeable "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為單位.

Chunk 7bb0dbc sz= 56 free " "

Chunk 7be52d4 sz= 60 free " "

Chunk 7be30b8 sz= 28 free " "

Bucket 1 size=76

Bucket 2 size=96

Chunk 7b695a4 sz= 116 free " "

Bucket 3 size=140

Bucket 4 size=236

Bucket 5 size=268

Bucket 6 size=524

Bucket 7 size=1036

Bucket 8 size=2060

Bucket 9 size=4108

Bucket 10 size=8204

Bucket 11 size=16396

Bucket 12 size=32780

Bucket 13 size=65548

Bucket 14 size=131084

Bucket 15 size=262156

Bucket 16 size=524300

Bucket 17 size=2097164

Total free space = 260---以kb為單位.

UNPINNED RECREATABLE CHUNKS (lru first):

PERMANENT CHUNKS:

Chunk 7be985c sz= 8500 perm "perm " alo=7524

Chunk 7be532c sz= 3764 perm "perm " alo=3764

Chunk 7b6950c sz= 152 perm "perm " alo=152

Chunk 7bb0c28 sz= 404 perm "perm " alo=404

Chunk 7be31dc sz= 8440 perm "perm " alo=8440

Chunk 7be2c44 sz= 1140 perm "perm " alo=1140

Chunk 7bb003c sz= 3052 perm "perm " alo=3052

Chunk 7be108c sz= 7096 perm "perm " alo=7096

Chunk 7b68d3c sz= 2000 perm "perm " alo=2000

Permanent space = 34548---以kb為單位.

******************************************************

******************************************************

HEAP DUMP heap name="top call heap" desc=067D46D8

heap name="top call heap"----這個PGA中的CGA資訊

extent sz=0x213c alt=92 het=32767 rec=0 flg=2 opc=3

parent=00000000 owner=00000000 nex=00000000 xsz=0xfffc

EXTENT 0 addr=07BF0004

Chunk 7bf000c sz= 32828 perm "perm " alo=136

Chunk 7bf8048 sz= 30552 free " "

Chunk 7bff7a0 sz= 1072 recreate "callheap " latch=00000000

ds 67d3d00 sz= 1072 ct= 1

Chunk 7bffbd0 sz= 1072 recreate "callheap " latch=00000000

ds 67d3d68 sz= 1072 ct= 1

Total heap size = 65524

FREE LISTS:

Bucket 0 size=44

Bucket 1 size=76

Bucket 2 size=96

Bucket 3 size=140

Bucket 4 size=236

Bucket 5 size=268

Bucket 6 size=524

Bucket 7 size=1036

Bucket 8 size=2060

Bucket 9 size=4108

Bucket 10 size=8204

Bucket 11 size=16396

Chunk 7bf8048 sz= 30552 free " "

Bucket 12 size=32780

Bucket 13 size=65548

Bucket 14 size=131084

Bucket 15 size=262156

Bucket 16 size=524300

Bucket 17 size=2097164

Total free space = 30552

UNPINNED RECREATABLE CHUNKS (lru first):

PERMANENT CHUNKS:

Chunk 7bf000c sz= 32828 perm "perm " alo=136

Permanent space = 32828

******************************************************

******************************************************

HEAP DUMP heap name="top uga heap" desc=067D47F8

heap name="top uga heap"---這個PGA中的UGA資訊

extent sz=0xffdc alt=92 het=32767 rec=0 flg=2 opc=3

parent=00000000 owner=00000000 nex=00000000 xsz=0x1fffc

EXTENT 0 addr=07C00004

Chunk 7c0000c sz= 48 free " "

Chunk 7c0003c sz= 65476 recreate "session heap " latch=00000000

ds 7be7490 sz= 65476 ct= 1

Total heap size = 65524

FREE LISTS:

Bucket 0 size=44

Chunk 7c0000c sz= 48 free " "

Bucket 1 size=76

Bucket 2 size=96

Bucket 3 size=140

Bucket 4 size=236

Bucket 5 size=268

Bucket 6 size=524

Bucket 7 size=1036

Bucket 8 size=2060

Bucket 9 size=4108

Bucket 10 size=8204

Bucket 11 size=16396

Bucket 12 size=32780

Bucket 13 size=65548

Bucket 14 size=131084

Bucket 15 size=262156

Bucket 16 size=524300

Bucket 17 size=2097164

Total free space = 48

UNPINNED RECREATABLE CHUNKS (lru first):

PERMANENT CHUNKS:

Permanent space = 0

******************************************************


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

相關文章