今天跟一朋友讨论kdbr[n]寻址问题,简单记录下:
计算公式:
FOR ASSM
real offset = kdbr[n] + 76 + (itls-1) *24
FOR MSSM
real offset= kdbr[n] + 68 + (itls-1) *24
这里是system表空间,所以采用MSSM的就算方式,结果为:
1990 + 68 + (1 - 1) * 24=2058
BBED> map /v File: /oradata/HCN/system01.dbf (1) Block: 6725 Dba:0x00401a45------------------------------------------------------------ KTB Data Block (Table/Cluster)
struct kcbh, 20 bytes @0 ub1 type_kcbh @0 ub1 frmt_kcbh @1 ub1 spare1_kcbh @2 ub1 spare2_kcbh @3 ub4 rdba_kcbh @4 ub4 bas_kcbh @8 ub2 wrp_kcbh @12 ub1 seq_kcbh @14 ub1 flg_kcbh @15 ub2 chkval_kcbh @16 ub2 spare3_kcbh @18
struct ktbbh, 48 bytes @20 ub1 ktbbhtyp @20 union ktbbhsid, 4 bytes @24 struct ktbbhcsc, 8 bytes @28 b2 ktbbhict @36 ub1 ktbbhflg @38 ub1 ktbbhfsl @39 ub4 ktbbhfnx @40 struct ktbbhitl[1], 24 bytes @44 BBED> p kdbr[78]sb2 kdbr[78] @242 1990
BBED> p *kdbr[78]rowdata[972]------------ub1 rowdata[972] @2058 0x2c
BBED kdbr[n]寻址 :
FOR ASSMreal offset = kdbr[n] + 76 + (itls-1) *24
FOR MSSMreal offset= kdbr[n] + 68 + (itls-1) *24
因为是system表空间,所以为1990 + 68 + (1 - 1) *24=2058
BBED> map /v
File: /oradata/HCN/system01.dbf (1)
Block: 6725 Dba:0x00401a45
------------------------------------------------------------
KTB Data Block (Table/Cluster)
struct kcbh, 20 bytes @0
ub1 type_kcbh @0
ub1 frmt_kcbh @1
ub1 spare1_kcbh @2
ub1 spare2_kcbh @3
ub4 rdba_kcbh @4
ub4 bas_kcbh @8
ub2 wrp_kcbh @12
ub1 seq_kcbh @14
ub1 flg_kcbh @15
ub2 chkval_kcbh @16
ub2 spare3_kcbh @18
struct ktbbh, 48 bytes @20
ub1 ktbbhtyp @20
union ktbbhsid, 4 bytes @24
struct ktbbhcsc, 8 bytes @28
b2 ktbbhict @36
ub1 ktbbhflg @38
ub1 ktbbhfsl @39
ub4 ktbbhfnx @40
struct ktbbhitl[1], 24 bytes @44
BBED> p kdbr[78]
sb2 kdbr[78] @242 1990
BBED> p *kdbr[78]
rowdata[972]
------------
ub1 rowdata[972] @2058 0x2c
计算公式:
FOR ASSM
real offset = kdbr[n] + 76 + (itls-1) *24
FOR MSSM
real offset= kdbr[n] + 68 + (itls-1) *24
这里是system表空间,所以采用MSSM的就算方式,结果为:
1990 + 68 + (1 - 1) * 24=2058
BBED> map /v File: /oradata/HCN/system01.dbf (1) Block: 6725 Dba:0x00401a45------------------------------------------------------------ KTB Data Block (Table/Cluster)
struct kcbh, 20 bytes @0 ub1 type_kcbh @0 ub1 frmt_kcbh @1 ub1 spare1_kcbh @2 ub1 spare2_kcbh @3 ub4 rdba_kcbh @4 ub4 bas_kcbh @8 ub2 wrp_kcbh @12 ub1 seq_kcbh @14 ub1 flg_kcbh @15 ub2 chkval_kcbh @16 ub2 spare3_kcbh @18
struct ktbbh, 48 bytes @20 ub1 ktbbhtyp @20 union ktbbhsid, 4 bytes @24 struct ktbbhcsc, 8 bytes @28 b2 ktbbhict @36 ub1 ktbbhflg @38 ub1 ktbbhfsl @39 ub4 ktbbhfnx @40 struct ktbbhitl[1], 24 bytes @44 BBED> p kdbr[78]sb2 kdbr[78] @242 1990
BBED> p *kdbr[78]rowdata[972]------------ub1 rowdata[972] @2058 0x2c
BBED kdbr[n]寻址 :
FOR ASSMreal offset = kdbr[n] + 76 + (itls-1) *24
FOR MSSMreal offset= kdbr[n] + 68 + (itls-1) *24
因为是system表空间,所以为1990 + 68 + (1 - 1) *24=2058
「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。




