如何定位SQL语句在共享池里用到了哪些chunks(2)

---根据上一步得出的heap 0 描述符,找到父游标heap 0,heap 0存放有我们熟悉的object name、dependency table等内容
SYS@tstdb1-SQL> select ksmchcom,ksmchptr,ksmchsiz,ksmchcls,ksmchpar from x$ksmsp where ksmchpar='070000019BB137F0';

KSMCHCOM        KSMCHPTR          KSMCHSIZ KSMCHCLS KSMCHPAR
---------------- ---------------- ---------- -------- ----------------
KGLH0^f6439b10  0700000195D40F60      4096 recr    070000019BB137F0    <---由此可见父游标heap 0存在于0700000195D40F60地址开始的chunk中,大小为4096 bytes

---为了能看清我们父游标handle与父游标heap 0在内存中的结构,我们使用更为详尽的level对sga进行dump,这个dump命令可没有那么快的完成,dump所耗的时间与你的shared pool大小成正比
alter session set tracefile_identifier='level2050dmp.txt';
alter system set events 'immediate trace name heapdump level 2050';

***从tstdb1_ora_15270042_level2050dmp.txt文件中
>>>>>>>>父游标heap 0所在的chunk信息
。。。。省略部分内容
  Chunk  700000195d40f60 sz=    4096    recreate  "KGLH0^f6439b10 "  latch=0  <---heap 0大小为4096 bytes仅包含一个chunk,由描述符ds=70000019bb137f0指向这个chunk
    ds  70000019bb137f0 sz=    4096 ct=        1
Dump of memory from 0x0700000195D40F60 to 0x0700000195D41F60
700000195D40F60 80B38F00 00001001 07000001 95D3FF60  [...............`]
700000195D40F70 00000000 00000000 00000000 00000000  [................]
700000195D40F80 00000000 00000000 00000000 0FFF0AE0  [................]
700000195D40F90 07000001 9BB137F0 00000000 00000000  [......7.........]
700000195D40FA0 40B38F00 00000051 00000000 00000000  [@......Q........]
700000195D40FB0 00000000 00000000 00000050 95D413F8  [...........P....]
700000195D40FC0 C0B38F00 00000001 00000000 00000000  [................]
700000195D40FD0 07000001 95D41BE0 07000001 9BB13868  [..............8h]
700000195D40FE0 00000001 00000000 07000001 95D40F90  [................]
700000195D40FF0 40B38F00 00000BE1 07000001 95D40FA0  [@...............]
700000195D41000 07000001 95D40FA0 00000950 00000000  [...........P....]
700000195D41010 07000001 B8670420 07000001 95D41848  [.....g. .......H]
700000195D41020 00000000 00000000 07000001 9BB137A0  [..............7.]
700000195D41030 00000000 00000000 00000000 00000000  [................]
        Repeat 7 times
700000195D410B0 82030003 00000000 10008100 00000000  [................]
700000195D410C0 00000000 00000020 00000000 00000000  [....... ........]
。。。。省略部分内容
        Repeat 6 times
700000195D41F40 10B38F00 00000021 07000001 95D41EA8  [.......!........]
700000195D41F50 00000001 09D3E808 00000000 00000000  [................]
  Chunk  700000195d41f60 sz=    4096    recreate  "KGLH0^5bcbf644 "  latch=0

>>>>>>>>父游标heap 0描述符所在的chunk信息
。。。。省略部分内容
  Chunk  70000019bb13788 sz=      240    freeable  "KGLDA          "        <---描述符ds=70000019bb137f0地址存在于以70000019bb13788为起始地址的chunk中
Dump of memory from 0x070000019BB13788 to 0x070000019BB13878
70000019BB13780                  00B38F00 000000F1          [........]
70000019BB13790 07000001 9BB13730 00000001 09B01958  [......70.......X]
70000019BB137A0 07000001 9BB137F0 07000001 95D410B0  [......7.........]
70000019BB137B0 00000000 01000300 00000000 00000000  [................]
70000019BB137C0 00000FE8 000009D8 07000001 95D41010  [................]
70000019BB137D0 07000001 95D40F90 00000000 00000000  [................]
70000019BB137E0 00000003 0C1F2D58 07000001 B54C6120  [......-X.....La ]
70000019BB137F0 07000000 00000198 00000FE8 00000000  [................]
70000019BB13800 07000001 9BB137A0 07000001 95D40F90  [......7.........]
70000019BB13810 07000001 95D40FF0 00000000 00000000  [................]
70000019BB13820 00000000 00000000 09020100 00000000  [................]
70000019BB13830 00000000 00000000 00000FD0 4B474C48  [............KGLH]
70000019BB13840 305E6636 34333962 31300026 7FFF0038  [0^f6439b10.&...8]
70000019BB13850 00307FFF 00000000 01030000 00000000  [.0..............]
70000019BB13860 00000000 00000000 07000001 95D40FD0  [................]
70000019BB13870 07000001 95D41BE0                    [........]
  Chunk  70000019bb13878 sz=      560    recreate  "KQR PO        "  latch=7000001b0d5f050
Dump of memory from 0x070000019BB13878 to 0x070000019BB13AA8

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/08fb1730e9b4f49b36f7ab5ea92d70fd.html