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

---根据上一步得出的heap 0 描述符,找到子游标heap 0所在chunk           
SYS@tstdb1-SQL> select ksmchcom,ksmchptr,ksmchsiz,ksmchcls,ksmchpar from x$ksmsp where ksmchpar='07000001B84F8530';

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

***在tstdb1_ora_15270042_level2050dmp.txt文件中可以找到包含700000195D3FF60这个地址的chunk
  Chunk  700000195d3ff60 sz=    4096    recreate  "KGLH0^f6439b10 "  latch=0
    ds  7000001b84f8530 sz=    4096 ct=        1
Dump of memory from 0x0700000195D3FF60 to 0x0700000195D40F60
700000195D3FF60 80B38F00 00001001 07000001 95D3EF60  [...............`]
700000195D3FF70 07000001 99E4EAC0 07000001 B89F3648  [..............6H]
700000195D3FF80 00000000 00000000 00000000 0FFF0200  [................]
700000195D3FF90 07000001 B84F8530 00000000 00000000  [.....O.0........]
700000195D3FFA0 40B38F00 00000051 00000000 00000000  [@......Q........]
700000195D3FFB0 00000000 00000000 00000050 00000000  [...........P....]
700000195D3FFC0 C0B38F00 00000001 00000000 00000000  [................]
700000195D3FFD0 07000001 95D40A10 07000001 B84F85A8  [.............O..]
700000195D3FFE0 00000001 00000000 07000001 95D3FF90  [................]
700000195D3FFF0 40B38F00 00000A11 07000001 95D3FFA0  [@...............]
700000195D40000 07000001 95D3FFA0 00000898 00000000  [................]
700000195D40010 07000001 B84F85E8 07000001 95D403D0  [.....O..........]
700000195D40020 00000000 00000000 07000001 B84F84E0  [.............O..]
。。。。省略部分内容

---以同样的方法得到子游标heap 6所在chunk
select kglhdadr,kglnaobj,kglobhd6 from x$kglob where kglhdadr='07000001B84F85E8';
KGLHDADR        KGLNAOBJ                                                                        KGLOBHD6
---------------- -------------------------------------------------------------------------------- ----------------
07000001B84F85E8 select * from scott.t1 where username='SYS'                                      0700000195D416E8      <---子游标heap 6的描述符(Descriptor)所在地址

select ksmchcom,ksmchptr,ksmchsiz,ksmchcls,ksmchpar from x$ksmsp where ksmchpar='0700000195D416E8';

KSMCHCOM        KSMCHPTR          KSMCHSIZ KSMCHCLS KSMCHPAR
---------------- ---------------- ---------- -------- ----------------
SQLA^f6439b10    0700000199EA5AB0      4096 recr    0700000195D416E8      <---heap 6含有2个大小都是4096 bytes的chunk
SQLA^f6439b10    0700000199E9FAB0      4096 freeabl  0700000195D416E8

***在tstdb1_ora_15270042_level2050dmp.txt文件中可以找到包含0700000195D416E8 chunk的段落
  Chunk  700000199ea5ab0 sz=    4096    recreate  "SQLA^f6439b10  "  latch=0
    ds  700000195d416e8 sz=    8192 ct=        2
        700000199e9fab0 sz=    4096
Dump of memory from 0x0700000199EA5AB0 to 0x0700000199EA6AB0
700000199EA5AB0 80B38F00 00001001 07000001 99EA4AB0  [..............J.]
700000199EA5AC0 07000001 95D3DF70 07000001 B8796E90  [.......p.....yn.]
700000199EA5AD0 00000000 00000000 00000000 0FFF0279  [...............y]
700000199EA5AE0 07000001 95D416E8 00000000 00000000  [................]
700000199EA5AF0 40B38F00 00000051 00000000 00000000  [@......Q........]
700000199EA5B00 00000000 00000000 00000050 000000D8  [...........P....]
700000199EA5B10 C0B38F00 00000001 00000000 00000000  [................]
700000199EA5B20 07000001 95D41760 07000001 95D41760  [.......`.......`]
700000199EA5B30 00000001 00000000 07000001 99EA5AE0  [..............Z.]
700000199EA5B40 00B38F00 00000069 07000001 99EA5AF0  [.......i......Z.]
700000199EA5B50 00000001 0B018734 01000000 00000000  [.......4........]

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

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