- 最后登录
- 2023-8-16
- 在线时间
- 1686 小时
- 威望
- 2135
- 金钱
- 50532
- 注册时间
- 2011-10-12
- 阅读权限
- 200
- 帖子
- 5207
- 精华
- 39
- 积分
- 2135
- UID
- 2
|
3#
发表于 2012-5-16 22:00:21
ROW CACHE 也叫做 dictionary cache ,缓存数据字典基表如 OBJ$、COL$、IND$、SEQ$的信息以便解析SQL和library cache object。
包括 KQR S PO , KQR M PO,KQR L PO , 等
KQR => ROW CACHE
kqr.h 1323 KSDTRADV("ROW_CACHE", FADDR(kqrdac))
V$ROWCACHE is based on X$KQRST
KQROBC : data from obj$
KQROIC : data from oid$ (object ids)
SQL> select * from v$sgastat where NAME like '%KQR%';
POOL NAME BYTES
------------ -------------------------- ----------
shared pool KQR M SO 160368
shared pool KQR L SO 37888
shared pool KQR ENQ 53664
shared pool KQR X PO 5600
shared pool KQR M PO 399136
shared pool KQR L PO 125984
shared pool KQR S SO 768
7 rows selected.
SQL> select type,parameter from v$rowcache where parameter like '%seq%';
TYPE PARAMETER
----------- --------------------------------
PARENT dc_sequences
SQL> select pid from v$process where addr = ( select paddr from v$session where sid=(select distinct sid from v$mystat));
PID
----------
15
SQL>
SQL> alter system set "_trace_events"='10000-10999:255:15';
System altered.
SQL>
SQL> select check_seq_cache.nextval from dual;
NEXTVAL
----------
43
SQL>
SQL> oradebug setmypid;
Statement processed.
SQL>
SQL> oradebug dump row_cache 10;
oradebug dump errorstack 4;Statement processed.
SQL> SQL>
Statement processed.
NOCACHE情况下更新SEQUENCE的过程(, 首先 acquire SQ -> SEQUENCE ENQUEUE LOCK da17=> 55831 object_id => SEQUENCE check_seq_cache
之后acquire SEQ$表的TM SX MODE LOCK ,并banding事务TX,update SEQ$ 表, 之后 释放 TX TM SQ。
1F9D2145:00007636 15 159 10704 83 ksqgtl: acquire SQ-0000da17-00000000 mode=X flags=SHORT why="contention"
1F9D2151:00007637 15 159 10704 19 ksqgtl: SUCCESS
1F9D2310:00007638 15 159 10704 83 ksqgtl: acquire TM-00000044-00000000 mode=SX flags=GLOBAL|XACT why="contention"
1F9D231A:00007639 15 159 10704 19 ksqgtl: SUCCESS
1F9D238C:0000763A 15 159 10811 1 0x00000000004001F3 0x0000000000000000 0x0000000000237F9F 0x0000000000000002
1F9D2398:0000763B 15 159 10811 2 0x00000000004001F3 0x0000000000000000 0x000000000023D217 0x00007F96C4D6FE40
1F9D23B5:0000763C 15 159 10813 1 ktubnd: Bind usn 8 nax 1 nbx 0 lng 0 par 0
1F9D23CC:0000763D 15 159 10813 2 ktubnd: Txn Bound xid: 8.25.542
1F9D23D5:0000763E 15 159 10704 83 ksqgtl: acquire TX-00080019-0000021e mode=X flags=GLOBAL|XACT why="contention"
1F9D23E5:0000763F 15 159 10704 19 ksqgtl: SUCCESS
1F9D249F:00007640 15 159 10005 4 KSL POST SENT postee=6 loc='ksasnd' id1=0 id2=0 name= type=0
1F9D24CD:00007641 15 159 10021 11 0x000000000023D218 0x000000000023D217
1F9D24D9:00007642 15 159 10704 117 ksqrcl: release TX-00080019-0000021e mode=X
1F9D24E3:00007643 15 159 10813 3 ktudnx: dec cnt xid:8.25.542 nax:0 nbx:0
1F9D24F8:00007644 15 159 10704 117 ksqrcl: release TM-00000044-00000000 mode=SX
1F9D2509:00007645 15 159 10704 117 ksqrcl: release SQ-0000da17-00000000 mode=X
1F9D2544:00007649 15 159 10005 4 KSL POST SENT postee=6 loc='ksasnd' id1=0 id2=0 name= type=0
通过关键词 da17 可以在row_cache dump中找到 dc_sequences SEQUENCE check_seq_cache的信息
BUCKET 7:
row cache parent object: address=0x8ea0beb8 cid=13(dc_sequences)
hash=db18fa06 typ=9 transaction=(nil) flags=00000002
own=0x8ea0bf88[0x8ea0bf88,0x8ea0bf88] wat=0x8ea0bf98[0x8ea0bf98,0x8ea0bf98] mode=N
status=VALID/-/-/-/-/-/-/-/-
data=
0000da17 00020000 000f0002 00020002 000002c1 00000000 00000000 00000000
02c10000 00000000 00000000 00000000 00000000 64640ace 64646464 64646464
00646464 15c10000 00000000 00000000 00000000 00000000 00003ec1 00000000
00000000 00000000 2d2d0000 2d2d2d2d 2d2d2d2d 2d2d2d2d 2d2d2d2d 2d2d2d2d
2d2d2d2d 2d2d2d2d 00002d2d 00000000
BUCKET 7 total object count=10 |
|