原创
版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。
BASE的计算方法为:
对于ASSM:76+(itc-1) * 24= 52 + itc * 24
对于MSSM:68+(itc-1) * 24= 44 + itc * 24
gyj@ZMDB> select * from v$type_size where component in ('KCB','KTB'); COMPONEN TYPE DESCRIPTION TYPE_SIZE -------- -------- -------------------------------- ---------- KCB KCBH BLOCK COMMON HEADER 20 KTB KTBIT TRANSACTION VARIABLE HEADER 24 KTB KTBBH TRANSACTION FIXED HEADER 48 KTB KTBBH_BS TRANSACTION BLOCK BITMAP SEGMENT 8
1、我们先对ASSM做测试
yj@ZMDB> select * from v$version; BANNER -------------------------------------------------------------------------------- Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production gyj@ZMDB> create tablespace assm datafile '/u01/app/oracle/oradata/zmdb/assm01.dbf' size 50M; Tablespace created. gyj@ZMDB> create table gyj_t5(id int,name varchar2(100)) tablespace assm; Table created. gyj@ZMDB> insert into gyj_t5 values(1,'AAAAA'); 1 row created. gyj@ZMDB> insert into gyj_t5 values(2,'BBBBB'); 1 row created. gyj@ZMDB> insert into gyj_t5 values(3,'CCCCC'); 1 row created. gyj@ZMDB> COMMIT; Commit complete. gyj@ZMDB> alter system flush buffer_cache; System altered. gyj@ZMDB> select dbms_rowid.rowid_relative_fno(rowid) file#,dbms_rowid.rowid_block_number(rowid) block#,id,name from gyj_t5; FILE# BLOCK# ID NAME ---------- ---------- ---------- ---------- 10 135 1 AAAAA 10 135 2 BBBBB 10 135 3 CCCCC BBED> set file 10 block 135 FILE# 10 BLOCK# 135 BBED> p kdbr[0] sb2 kdbr[0] @118 8076 BBED> p *kdbr[0] rowdata[24] ----------- ub1 rowdata[24] @8176 0x2c BBED> x /rnc rowdata[24] @8176 ----------- flag@8176: 0x2c (KDRHFL, KDRHFF, KDRHFH) lock@8177: 0x01 cols@8178: 2 col 0[2] @8179: 1 col 1[5] @8182: AAAAA BBED> p ktbbhict sb2 ktbbhict @36 2 8176-8076=76+(itc-1) * 24= 76+(2-1)* 24=100
2、我们对MSSM做测试
gyj@ZMDB> create tablespace mssm datafile '/u01/app/oracle/oradata/zmdb/mssm01.dbf' size 50M segment space management manual; Tablespace created. gyj@ZMDB> create table gyj_mssm(id int,name varchar2(100)) tablespace mssm; Table created. gyj@ZMDB> insert into gyj_mssm values(4,'DDDDD'); 1 row created. gyj@ZMDB> insert into gyj_mssm values(5,'EEEEE'); 1 row created. gyj@ZMDB> insert into gyj_mssm values(6,'FFFFF'); 1 row created. gyj@ZMDB> commit; Commit complete. gyj@ZMDB> col name for a20 gyj@ZMDB> select dbms_rowid.rowid_relative_fno(rowid) file#,dbms_rowid.rowid_block_number(rowid) block#,id,name from gyj_mssm; FILE# BLOCK# ID NAME ---------- ---------- ---------- -------------------- 11 129 4 DDDDD 11 129 5 EEEEE 11 129 6 FFFFF BBED> set file 11 block 129 FILE# 11 BLOCK# 129 BBED> p kdbr[0] sb2 kdbr[0] @110 8084 BBED> p *kdbr[0] rowdata[24] ----------- ub1 rowdata[24] @8176 0x2c BBED> x /rnc rowdata[24] @8176 ----------- flag@8176: 0x2c (KDRHFL, KDRHFF, KDRHFH) lock@8177: 0x01 cols@8178: 2 col 0[2] @8179: 4 col 1[5] @8182: DDDDD BBED> p ktbbhict sb2 ktbbhict @36 2 8176-8084=68+(itc-1) * 24=68+(2-1)*24=92
3、为什么ASSM要比MSSM多了8个字节
************MSSM BBED> set file 11 block 129 FILE# 11 BLOCK# 129 BBED> map /v File: /u01/app/oracle/oradata/zmdb/mssm01.dbf (11) Block: 129 Dba:0x02c00081 ------------------------------------------------------------ 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, 72 bytes @20 ub1 ktbbhtyp @20 union ktbbhsid, 4 bytes @24 struct ktbbhcsc, 8 bytes @28 sb2 ktbbhict @36 ub1 ktbbhflg @38 ub1 ktbbhfsl @39 ub4 ktbbhfnx @40 struct ktbbhitl[2], 48 bytes @44 struct kdbh, 14 bytes @92 ub1 kdbhflag @92 sb1 kdbhntab @93 sb2 kdbhnrow @94 sb2 kdbhfrre @96 sb2 kdbhfsbo @98 sb2 kdbhfseo @100 sb2 kdbhavsp @102 sb2 kdbhtosp @104 struct kdbt[1], 4 bytes @106 sb2 kdbtoffs @106 sb2 kdbtnrow @108 sb2 kdbr[3] @110 ub1 freespace[8036] @116 ub1 rowdata[36] @8152 ub4 tailchk @8188 *****************ASSM BBED> set file 10 block 135 FILE# 10 BLOCK# 135 File: /u01/app/oracle/oradata/zmdb/assm01.dbf (10) Block: 141 Dba:0x0280008d ------------------------------------------------------------ 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, 72 bytes @20 ub1 ktbbhtyp @20 union ktbbhsid, 4 bytes @24 struct ktbbhcsc, 8 bytes @28 sb2 ktbbhict @36 ub1 ktbbhflg @38 ub1 ktbbhfsl @39 ub4 ktbbhfnx @40 struct ktbbhitl[2], 48 bytes @44 struct kdbh, 14 bytes @100 ub1 kdbhflag @100 sb1 kdbhntab @101 sb2 kdbhnrow @102 sb2 kdbhfrre @104 sb2 kdbhfsbo @106 sb2 kdbhfseo @108 sb2 kdbhavsp @110 sb2 kdbhtosp @112 struct kdbt[1], 4 bytes @114 sb2 kdbtoffs @114 sb2 kdbtnrow @116 sb2 kdbr[3] @118 ub1 freespace[8028] @124 ub1 rowdata[36] @8152 ub4 tailchk @8188
对比
-----MSSM
struct ktbbhitl[2], 48 bytes @44
struct kdbh, 14 bytes @92
---ASSM
struct ktbbhitl[2], 48 bytes @44
struct kdbh, 14 bytes @100
@92---->@100 kdbh偏移量发生了变化,增加了8个byte。
有0 个人打赏
Kafka是大数据领域常用的消息队列,其高效的吞吐量和分布式容错等特性是其收到青睐的重要原因。kafka消息的位置用好Kafka,维护其消息偏移量对于避免消息的重复消费与遗漏消费,确保消息的Exact...博文来自: 走向程序的康庄大道
在IP分片中,有一个叫做偏移量的东西,之前一直没有搞懂这是什么意思,今天豁然开朗,谨以此记。在IP传输过程中,如果报文长度大于该路由或主机mtu的时候,IP就会分片,每个分片的长度都是8字节的整数倍。...博文来自: ilovepengqi的博客
例如下面两条语句:SELECT*FROMseckillLIMIT2OFFSET1;SELECT*FROMseckillLIMIT2,1;前者表示跳过一条数据,读取两条数据后者表示跳过两条数据,读取一条...博文来自: abc67509227的博客
8086为16位的CPU,而却有20位的地址总线,因此需要将CPU中的两个地址段地址和偏移地址合成一个20位的地址。8086读写内存时:CPU中的相关部件提供两个16位的地址,一个是段地址,一个是偏...博文来自: u012133341的博客
对于复杂的计算,单片机的速度显得偏慢。最好的办法是人工事先算出全部的结果,依次存放在ROM中,需要计算时,直接从ROM中查出结果即可。查表有两条指令:MOVCA,@A+PCMOVCA,@A...博文来自: 做而论道的博客
比如: 机器码SJMP rel 10000000 偏移量8bit新的目标地址:PC = 当前PC + 偏移量 [注意偏移量rel的计算]例:KK: SJMP K0设K...博文来自: GhostTigerMan
问题写一个宏计算出结构体成员的偏移量。 假设有如下一个结构体,要计算成员c的在结构体中的偏移量。typedef struct Type_t{ char a; // 0 int b; ...博文来自: Victor的专栏
偏移量汇编语言中的定义为:把存储单元的实际地址与其所在段的段地址之间的距离称为段内偏移,也称为“有效地址或偏移量”。亦:存储单元的实际地址与其所在段的段地址之间的距离。本质其实就是“实际地址与其所在段...博文来自: 高调做事,低调做人
./bin/zookeeper-shell.sh localhost:2181进入zookeeper管理set /consumers/组名/offsets/主题/分区移动的位置...博文来自: zhangweigangweiwu的专栏
//计算结构体偏移量#include<stdio.h>#include<stdlib.h>#include<string.h>//详解:对于offscfof()函数...博文来自: weixin_30896657的博客
一、hdfs介绍hdfs设计原则1.非常大的文件:这里的非常大是指几百MB,GB,TB.雅虎的hadoop集群已经可以存储PB级别的数据2.流式数据访问:基于一次写,多次读。3.商用硬件: hdfs的...博文来自: 大树叶 技术专栏
转载自http://www.csna.cn/network-analyst-887-1-2.html作者菜鸟飞人。用了一个半小时,好好的研究了这篇文章,感触很深。对ip分段以及tcp偏移量有些掌握,但...博文来自: weixin_34152820的博客
今天看看几个月前老师让写的通用链表,突然的想起了一个问题,就是关于结构体的偏移#include#include#define offset(TYPE,MEMBER) ( (long)&((TYPE...博文来自: zhangxxxww的专栏
http://blog.csdn.net/DONALDO_O/archive/2008/11/15/3306588.aspx这么复杂的东西,不用中文压根说不清楚。用英文写,写了也等写火星文。现在...博文来自: james@BJ的专栏
http://czmmiao.iteye.com/blog/1495332