[20220124]驗證oradebug dump heapdump 2050中chunk的第1位元組表示chunk size+1.txt

lfree發表於2022-01-24

[20220124]驗證oradebug dump heapdump 2050中chunk的第1位元組表示chunk size+1.txt

--//驗證oradebug dump heapdump 2050中chunk的第1位元組表示chunk size+1,順便複習awk的使用.

1.環境:
SCOTT@book> @ver1
PORT_STRING                    VERSION        BANNER
------------------------------ -------------- --------------------------------------------------------------------------------
x86_64/Linux 2.4.xx            11.2.0.4.0     Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production

2.堆轉儲:
SYS@book> oradebug setmypid
Statement processed.

SYS@book> oradebug dump heapdump 2050;
Statement processed.
--//注意很慢如果共享池記憶體佔用很大的情況,我自己的測試環境也不快.

SYS@book> @ ttt
tracefile_identifier = /u01/app/oracle/diag/rdbms/book/book/trace/book_ora_26777.trc

3.分析看看.

$ grep -A1 "^Dump of memory from" book_ora_26777.trc | awk '/^Dump of memory from/{print strtonum($7)-strtonum($5)} ; /]$/{print strtonum("0x"$2)-1}'| head
48
48
856
856
4424
4424
6432
6432
32552
32552

$ grep -A1 "^Dump of memory from" book_ora_26777.trc | awk '/^Dump of memory from/{print strtonum($7)-strtonum($5)} ; /]$/{print strtonum("0x"$2)-1}'| tail
3966176
3966176
3962232
3962232
3980400
3980400
3799184
3799184
80
80
--//視乎能對上.

$ grep -A1 "^Dump of memory from" book_ora_26777.trc | awk '/^Dump of memory from/{printf "%d ", strtonum($7)-strtonum($5)} ; /]$/{print strtonum("0x"$2)-1}' | \
 awk '{ if ($1 != $2 ) print $1 $2 " not equal"}'

--//OK,說明我前面測試推斷一致,chunk開始的地址記錄的記憶體就是ckunk size+1.

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

相關文章