[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博客 ” ,链接:https://blog.itpub.net/267265/viewspace-2853764/ ,如需转载,请注明出处,否则将追究法律责任。