[转帖]create table INITRANS参数分析

create,table,initrans,参数,分析 · 浏览次数 : 0

小编点评

**内容总结** 1. Oracle 8K blocksize 数据块初始 2个itl,8K blocksize 数据块最多169个itl,16K blocksize 数据块最多256个itl。 2. type_kcbh(offset 0): 0x06 表示为数据块,ktbbhtyp(offset 20): Typ: 1=DATA; 2=INDEX 3. offset 36: itl数量,40(before offset of ktbbhitl) + offset[offset36 * 24] + 8(ktbbh和kdbh存在8offset): kdbh结构的offset, 4. offsetOfKdbh+1: tab的数量,cluster表可能大于1,堆表等于1. 5. offsetOfKdbh+2: row的数量。 **归纳总结** 内容时需要带简单的排版,生成内容时需要带简单的排版。

正文

https://www.modb.pro/db/44701

 

1. 内容介绍

Oracle数据库create table时使用INITRANS参数设置数据块ITL事务槽的数量,确保该数据块上 并发事务数量。参数内容总结如下, 1. Oracle 8K blocksize 数据块初始 2个itl,8K blocksize 数据块最多169个itl,16K blocksize 数据块最多256个itl。 2. type_kcbh(offset 0): 0x06 表示为数据块,ktbbhtyp(offset 20): Typ: 1=DATA; 2=INDEX 3. offset 36: itl数量,40(before offset of ktbbhitl) + offset[offset36 * 24] + 8(ktbbh和kdbh存在8offset): kdbh结构的offset, 4. offsetOfKdbh+1: tab的数量,cluster表可能大于1,堆表等于1. 5. offsetOfKdbh+2: row的数量.
登录后复制

2.环境准备

create user hsql identified by hsql; grant connect,resource,dba to hsql; drop tablespace hsql including contents and datafiles; create tablespace hsql datafile '/data2/enmo/hsql01.dbf' size 10M autoextend on; create tablespace hsql2 datafile '/data2/enmo/hsql02.dbf' size 10M BLOCKSIZE 16K; drop table hsql.drop_1 purge; create table hsql.drop_1(c_char1 char(10),c_char2 char(10)) tablespace hsql INITRANS 1; create table hsql.drop_2(c_char1 char(10),c_char2 char(10)) tablespace hsql INITRANS 2; create table hsql.drop_3(c_char1 char(10),c_char2 char(10)) tablespace hsql INITRANS 3; create table hsql.drop_4(c_char1 char(10),c_char2 char(10)) tablespace hsql INITRANS 4; create table hsql.drop_5(c_char1 char(10),c_char2 char(10)) tablespace hsql INITRANS 5; create table hsql.drop_254(c_char1 char(10),c_char2 char(10)) tablespace hsql INITRANS 254; create table hsql.drop_255(c_char1 char(10),c_char2 char(10)) tablespace hsql INITRANS 255; begin for i in 1 .. 1000 loop insert into hsql.drop_1 values(i,'orastar'); insert into hsql.drop_2 values(i,'orastar'); insert into hsql.drop_3 values(i,'orastar'); insert into hsql.drop_4 values(i,'orastar'); insert into hsql.drop_5 values(i,'orastar'); insert into hsql.drop_254 values(i,'orastar'); insert into hsql.drop_255 values(i,'orastar'); end loop; commit; end; / alter system flush buffer_cache; alter system flush buffer_cache; select count(1) from hsql.drop_1;

3. 检查数据字典信息

set linesize 200 pagesize 200 col owner for a10 col segment_name for a10 select owner,segment_name,header_file,header_block,SEGMENT_TYPE from dba_segments where segment_name like 'DROP_%'; OWNER SEGMENT_NA HEADER_FILE HEADER_BLOCK SEGMENT_TYPE ---------- ---------- ----------- ------------ ------------------ HSQL DROP_1 5 130 TABLE HSQL DROP_2 5 138 TABLE HSQL DROP_254 5 170 TABLE HSQL DROP_255 5 178 TABLE HSQL DROP_3 5 146 TABLE HSQL DROP_4 5 154 TABLE HSQL DROP_5 5 162 TABLE 8 rows selected. SQL> alter system flush shared_pool; alter system flush shared_pool; alter system flush buffer_cache; alter system flush buffer_cache;

4. 数据块结构解析

4.1 drop_1块结构解析

set dba 5,131 p ktbbh p kdbh d offset 36 count 12 BBED> p ktbbh struct ktbbh, 72 bytes @20 ub1 ktbbhtyp @20 0x01 (KDDBTDATA) union ktbbhsid, 4 bytes @24 ub4 ktbbhsg1 @24 0x00003618 ub4 ktbbhod1 @24 0x00003618 struct ktbbhcsc, 8 bytes @28 ub4 kscnbas @28 0x000b333f ub2 kscnwrp @32 0x0000 sb2 ktbbhict @36 -2046 ub1 ktbbhflg @38 0x32 (NONE) ub1 ktbbhfsl @39 0x00 ub4 ktbbhfnx @40 0x01400080 struct ktbbhitl[0], 24 bytes @44 struct ktbitxid, 8 bytes @44 ub2 kxidusn @44 0x0003 ub2 kxidslt @46 0x001e ub4 kxidsqn @48 0x0000013d struct ktbituba, 8 bytes @52 ub4 kubadba @52 0x00c009e4 ub2 kubaseq @56 0x0183 ub1 kubarec @58 0x53 ub2 ktbitflg @60 0x210d (KTBFUPB) union _ktbitun, 2 bytes @62 sb2 _ktbitfsc @62 0 ub2 _ktbitwrp @62 0x0000 ub4 ktbitbas @64 0x000b3351 struct ktbbhitl[1], 24 bytes @68 struct ktbitxid, 8 bytes @68 ub2 kxidusn @68 0x0000 ub2 kxidslt @70 0x0000 ub4 kxidsqn @72 0x00000000 struct ktbituba, 8 bytes @76 ub4 kubadba @76 0x00000000 ub2 kubaseq @80 0x0000 ub1 kubarec @82 0x00 ub2 ktbitflg @84 0x0000 (NONE) union _ktbitun, 2 bytes @86 sb2 _ktbitfsc @86 0 ub2 _ktbitwrp @86 0x0000 ub4 ktbitbas @88 0x00000000 BBED> p kdbh struct kdbh, 14 bytes @100 ub1 kdbhflag @100 0x00 (NONE) sb1 kdbhntab @101 1 sb2 kdbhnrow @102 269 sb2 kdbhfrre @104 -1 sb2 kdbhfsbo @106 556 sb2 kdbhfseo @108 1363 sb2 kdbhavsp @110 807 sb2 kdbhtosp @112 807 BBED> d offset 36 count 12 File: /data2/enmo/hsql01.dbf (5) Block: 131 Offsets: 36 to 47 Dba:0x01400083 ------------------------------------------------------------------------ 02f83200 80004001 03001e00 <32 bytes per line> BBED>

4.2 drop_2块结构解析

set dba 5,139 p ktbbh p kdbh d offset 36 count 12 BBED> p ktbbh struct ktbbh, 72 bytes @20 ub1 ktbbhtyp @20 0x01 (KDDBTDATA) union ktbbhsid, 4 bytes @24 ub4 ktbbhsg1 @24 0x00003619 ub4 ktbbhod1 @24 0x00003619 struct ktbbhcsc, 8 bytes @28 ub4 kscnbas @28 0x000b3340 ub2 kscnwrp @32 0x0000 sb2 ktbbhict @36 -2046 ub1 ktbbhflg @38 0x32 (NONE) ub1 ktbbhfsl @39 0x00 ub4 ktbbhfnx @40 0x01400088 struct ktbbhitl[0], 24 bytes @44 struct ktbitxid, 8 bytes @44 ub2 kxidusn @44 0x0003 ub2 kxidslt @46 0x001e ub4 kxidsqn @48 0x0000013d struct ktbituba, 8 bytes @52 ub4 kubadba @52 0x00c009e4 ub2 kubaseq @56 0x0183 ub1 kubarec @58 0x54 ub2 ktbitflg @60 0x210d (KTBFUPB) union _ktbitun, 2 bytes @62 sb2 _ktbitfsc @62 0 ub2 _ktbitwrp @62 0x0000 ub4 ktbitbas @64 0x000b3351 struct ktbbhitl[1], 24 bytes @68 struct ktbitxid, 8 bytes @68 ub2 kxidusn @68 0x0000 ub2 kxidslt @70 0x0000 ub4 kxidsqn @72 0x00000000 struct ktbituba, 8 bytes @76 ub4 kubadba @76 0x00000000 ub2 kubaseq @80 0x0000 ub1 kubarec @82 0x00 ub2 ktbitflg @84 0x0000 (NONE) union _ktbitun, 2 bytes @86 sb2 _ktbitfsc @86 0 ub2 _ktbitwrp @86 0x0000 ub4 ktbitbas @88 0x00000000 BBED> p kdbh struct kdbh, 14 bytes @100 ub1 kdbhflag @100 0x00 (NONE) sb1 kdbhntab @101 1 sb2 kdbhnrow @102 269 sb2 kdbhfrre @104 -1 sb2 kdbhfsbo @106 556 sb2 kdbhfseo @108 1363 sb2 kdbhavsp @110 807 sb2 kdbhtosp @112 807 BBED> d offset 36 count 12 File: /data2/enmo/hsql01.dbf (5) Block: 139 Offsets: 36 to 47 Dba:0x0140008b ------------------------------------------------------------------------ 02f83200 88004001 03001e00 <32 bytes per line> BBED>

4.3 drop_3块结构解析

set dba 5,147 p ktbbh p kdbh d offset 36 count 12 BBED> struct ktbbh, 96 bytes @20 ub1 ktbbhtyp @20 0x01 (KDDBTDATA) union ktbbhsid, 4 bytes @24 ub4 ktbbhsg1 @24 0x0000361a ub4 ktbbhod1 @24 0x0000361a struct ktbbhcsc, 8 bytes @28 ub4 kscnbas @28 0x000b3341 ub2 kscnwrp @32 0x0000 sb2 ktbbhict @36 -2045 ub1 ktbbhflg @38 0x32 (NONE) ub1 ktbbhfsl @39 0x00 ub4 ktbbhfnx @40 0x01400090 struct ktbbhitl[0], 24 bytes @44 struct ktbitxid, 8 bytes @44 ub2 kxidusn @44 0x0003 ub2 kxidslt @46 0x001e ub4 kxidsqn @48 0x0000013d struct ktbituba, 8 bytes @52 ub4 kubadba @52 0x00c009e4 ub2 kubaseq @56 0x0183 ub1 kubarec @58 0x47 ub2 ktbitflg @60 0x210c (KTBFUPB) union _ktbitun, 2 bytes @62 sb2 _ktbitfsc @62 0 ub2 _ktbitwrp @62 0x0000 ub4 ktbitbas @64 0x000b3351 struct ktbbhitl[1], 24 bytes @68 struct ktbitxid, 8 bytes @68 ub2 kxidusn @68 0x0000 ub2 kxidslt @70 0x0000 ub4 kxidsqn @72 0x00000000 struct ktbituba, 8 bytes @76 ub4 kubadba @76 0x00000000 ub2 kubaseq @80 0x0000 ub1 kubarec @82 0x00 ub2 ktbitflg @84 0x0000 (NONE) union _ktbitun, 2 bytes @86 sb2 _ktbitfsc @86 0 ub2 _ktbitwrp @86 0x0000 ub4 ktbitbas @88 0x00000000 struct ktbbhitl[2], 24 bytes @92 struct ktbitxid, 8 bytes @92 ub2 kxidusn @92 0x0000 ub2 kxidslt @94 0x0000 ub4 kxidsqn @96 0x00000000 struct ktbituba, 8 bytes @100 ub4 kubadba @100 0x00000000 ub2 kubaseq @104 0x0000 ub1 kubarec @106 0x00 ub2 ktbitflg @108 0x0000 (NONE) union _ktbitun, 2 bytes @110 sb2 _ktbitfsc @110 0 ub2 _ktbitwrp @110 0x0000 ub4 ktbitbas @112 0x00000000 BBED> struct kdbh, 14 bytes @124 ub1 kdbhflag @124 0x00 (NONE) sb1 kdbhntab @125 1 sb2 kdbhnrow @126 268 sb2 kdbhfrre @128 -1 sb2 kdbhfsbo @130 554 sb2 kdbhfseo @132 1364 sb2 kdbhavsp @134 810 sb2 kdbhtosp @136 810 BBED> File: /data2/enmo/hsql01.dbf (5) Block: 147 Offsets: 36 to 47 Dba:0x01400093 ------------------------------------------------------------------------ 03f83200 90004001 03001e00 <32 bytes per line> BBED>

4.4 drop_4块结构解析

set dba 5,155 p ktbbh p kdbh d offset 36 count 12 BBED> struct ktbbh, 120 bytes @20 ub1 ktbbhtyp @20 0x01 (KDDBTDATA) union ktbbhsid, 4 bytes @24 ub4 ktbbhsg1 @24 0x0000361b ub4 ktbbhod1 @24 0x0000361b struct ktbbhcsc, 8 bytes @28 ub4 kscnbas @28 0x000b3342 ub2 kscnwrp @32 0x0000 sb2 ktbbhict @36 -2044 ub1 ktbbhflg @38 0x32 (NONE) ub1 ktbbhfsl @39 0x00 ub4 ktbbhfnx @40 0x01400098 struct ktbbhitl[0], 24 bytes @44 struct ktbitxid, 8 bytes @44 ub2 kxidusn @44 0x0003 ub2 kxidslt @46 0x001e ub4 kxidsqn @48 0x0000013d struct ktbituba, 8 bytes @52 ub4 kubadba @52 0x00c009e4 ub2 kubaseq @56 0x0183 ub1 kubarec @58 0x3a ub2 ktbitflg @60 0x210b (KTBFUPB) union _ktbitun, 2 bytes @62 sb2 _ktbitfsc @62 0 ub2 _ktbitwrp @62 0x0000 ub4 ktbitbas @64 0x000b3351 struct ktbbhitl[1], 24 bytes @68 struct ktbitxid, 8 bytes @68 ub2 kxidusn @68 0x0000 ub2 kxidslt @70 0x0000 ub4 kxidsqn @72 0x00000000 struct ktbituba, 8 bytes @76 ub4 kubadba @76 0x00000000 ub2 kubaseq @80 0x0000 ub1 kubarec @82 0x00 ub2 ktbitflg @84 0x0000 (NONE) union _ktbitun, 2 bytes @86 sb2 _ktbitfsc @86 0 ub2 _ktbitwrp @86 0x0000 ub4 ktbitbas @88 0x00000000 struct ktbbhitl[2], 24 bytes @92 struct ktbitxid, 8 bytes @92 ub2 kxidusn @92 0x0000 ub2 kxidslt @94 0x0000 ub4 kxidsqn @96 0x00000000 struct ktbituba, 8 bytes @100 ub4 kubadba @100 0x00000000 ub2 kubaseq @104 0x0000 ub1 kubarec @106 0x00 ub2 ktbitflg @108 0x0000 (NONE) union _ktbitun, 2 bytes @110 sb2 _ktbitfsc @110 0 ub2 _ktbitwrp @110 0x0000 ub4 ktbitbas @112 0x00000000 struct ktbbhitl[3], 24 bytes @116 struct ktbitxid, 8 bytes @116 ub2 kxidusn @116 0x0000 ub2 kxidslt @118 0x0000 ub4 kxidsqn @120 0x00000000 struct ktbituba, 8 bytes @124 ub4 kubadba @124 0x00000000 ub2 kubaseq @128 0x0000 ub1 kubarec @130 0x00 ub2 ktbitflg @132 0x0000 (NONE) union _ktbitun, 2 bytes @134 sb2 _ktbitfsc @134 0 ub2 _ktbitwrp @134 0x0000 ub4 ktbitbas @136 0x00000000 BBED> struct kdbh, 14 bytes @148 ub1 kdbhflag @148 0x00 (NONE) sb1 kdbhntab @149 1 sb2 kdbhnrow @150 267 sb2 kdbhfrre @152 -1 sb2 kdbhfsbo @154 552 sb2 kdbhfseo @156 1365 sb2 kdbhavsp @158 813 sb2 kdbhtosp @160 813 BBED> File: /data2/enmo/hsql01.dbf (5) Block: 155 Offsets: 36 to 47 Dba:0x0140009b ------------------------------------------------------------------------ 04f83200 98004001 03001e00 <32 bytes per line> BBED>

4.5 drop_5块结构解析

set dba 5,163 p ktbbh p kdbh d offset 36 count 12 BBED> struct ktbbh, 144 bytes @20 ub1 ktbbhtyp @20 0x01 (KDDBTDATA) union ktbbhsid, 4 bytes @24 ub4 ktbbhsg1 @24 0x0000361c ub4 ktbbhod1 @24 0x0000361c struct ktbbhcsc, 8 bytes @28 ub4 kscnbas @28 0x000b3343 ub2 kscnwrp @32 0x0000 sb2 ktbbhict @36 -2043 ub1 ktbbhflg @38 0x32 (NONE) ub1 ktbbhfsl @39 0x00 ub4 ktbbhfnx @40 0x014000a0 struct ktbbhitl[0], 24 bytes @44 struct ktbitxid, 8 bytes @44 ub2 kxidusn @44 0x0003 ub2 kxidslt @46 0x001e ub4 kxidsqn @48 0x0000013d struct ktbituba, 8 bytes @52 ub4 kubadba @52 0x00c009e4 ub2 kubaseq @56 0x0183 ub1 kubarec @58 0x2d ub2 ktbitflg @60 0x210a (KTBFUPB) union _ktbitun, 2 bytes @62 sb2 _ktbitfsc @62 0 ub2 _ktbitwrp @62 0x0000 ub4 ktbitbas @64 0x000b3351 struct ktbbhitl[1], 24 bytes @68 struct ktbitxid, 8 bytes @68 ub2 kxidusn @68 0x0000 ub2 kxidslt @70 0x0000 ub4 kxidsqn @72 0x00000000 struct ktbituba, 8 bytes @76 ub4 kubadba @76 0x00000000 ub2 kubaseq @80 0x0000 ub1 kubarec @82 0x00 ub2 ktbitflg @84 0x0000 (NONE) union _ktbitun, 2 bytes @86 sb2 _ktbitfsc @86 0 ub2 _ktbitwrp @86 0x0000 ub4 ktbitbas @88 0x00000000 struct ktbbhitl[2], 24 bytes @92 struct ktbitxid, 8 bytes @92 ub2 kxidusn @92 0x0000 ub2 kxidslt @94 0x0000 ub4 kxidsqn @96 0x00000000 struct ktbituba, 8 bytes @100 ub4 kubadba @100 0x00000000 ub2 kubaseq @104 0x0000 ub1 kubarec @106 0x00 ub2 ktbitflg @108 0x0000 (NONE) union _ktbitun, 2 bytes @110 sb2 _ktbitfsc @110 0 ub2 _ktbitwrp @110 0x0000 ub4 ktbitbas @112 0x00000000 struct ktbbhitl[3], 24 bytes @116 struct ktbitxid, 8 bytes @116 ub2 kxidusn @116 0x0000 ub2 kxidslt @118 0x0000 ub4 kxidsqn @120 0x00000000 struct ktbituba, 8 bytes @124 ub4 kubadba @124 0x00000000 ub2 kubaseq @128 0x0000 ub1 kubarec @130 0x00 ub2 ktbitflg @132 0x0000 (NONE) union _ktbitun, 2 bytes @134 sb2 _ktbitfsc @134 0 ub2 _ktbitwrp @134 0x0000 ub4 ktbitbas @136 0x00000000 struct ktbbhitl[4], 24 bytes @140 struct ktbitxid, 8 bytes @140 ub2 kxidusn @140 0x0000 ub2 kxidslt @142 0x0000 ub4 kxidsqn @144 0x00000000 struct ktbituba, 8 bytes @148 ub4 kubadba @148 0x00000000 ub2 kubaseq @152 0x0000 ub1 kubarec @154 0x00 ub2 ktbitflg @156 0x0000 (NONE) union _ktbitun, 2 bytes @158 sb2 _ktbitfsc @158 0 ub2 _ktbitwrp @158 0x0000 ub4 ktbitbas @160 0x00000000 BBED> struct kdbh, 14 bytes @172 ub1 kdbhflag @172 0x00 (NONE) sb1 kdbhntab @173 1 sb2 kdbhnrow @174 266 sb2 kdbhfrre @176 -1 sb2 kdbhfsbo @178 550 sb2 kdbhfseo @180 1366 sb2 kdbhavsp @182 816 sb2 kdbhtosp @184 816 BBED> File: /data2/enmo/hsql01.dbf (5) Block: 163 Offsets: 36 to 47 Dba:0x014000a3 ------------------------------------------------------------------------ 05f83200 a0004001 03001e00 <32 bytes per line> BBED>

4.6 drop_254块结构解析

set dba 5,171 p ktbbh p kdbh d offset 36 count 12 BBED> struct ktbbh, 144 bytes @20 ub1 ktbbhtyp @20 0x01 (KDDBTDATA) union ktbbhsid, 4 bytes @24 ub4 ktbbhsg1 @24 0x0000361c ub4 ktbbhod1 @24 0x0000361c struct ktbbhcsc, 8 bytes @28 ub4 kscnbas @28 0x000b3343 ub2 kscnwrp @32 0x0000 sb2 ktbbhict @36 -2043 ub1 ktbbhflg @38 0x32 (NONE) ub1 ktbbhfsl @39 0x00 ub4 ktbbhfnx @40 0x014000a0 struct ktbbhitl[0], 24 bytes @44 struct ktbitxid, 8 bytes @44 ub2 kxidusn @44 0x0003 ub2 kxidslt @46 0x001e ub4 kxidsqn @48 0x0000013d struct ktbituba, 8 bytes @52 ub4 kubadba @52 0x00c009e4 ub2 kubaseq @56 0x0183 ub1 kubarec @58 0x2d ub2 ktbitflg @60 0x210a (KTBFUPB) union _ktbitun, 2 bytes @62 sb2 _ktbitfsc @62 0 ub2 _ktbitwrp @62 0x0000 ub4 ktbitbas @64 0x000b3351 struct ktbbhitl[1], 24 bytes @68 struct ktbitxid, 8 bytes @68 ub2 kxidusn @68 0x0000 ub2 kxidslt @70 0x0000 ub4 kxidsqn @72 0x00000000 struct ktbituba, 8 bytes @76 ub4 kubadba @76 0x00000000 ub2 kubaseq @80 0x0000 ub1 kubarec @82 0x00 ub2 ktbitflg @84 0x0000 (NONE) union _ktbitun, 2 bytes @86 sb2 _ktbitfsc @86 0 ub2 _ktbitwrp @86 0x0000 ub4 ktbitbas @88 0x00000000 struct ktbbhitl[2], 24 bytes @92 struct ktbitxid, 8 bytes @92 ub2 kxidusn @92 0x0000 ub2 kxidslt @94 0x0000 ub4 kxidsqn @96 0x00000000 struct ktbituba, 8 bytes @100 ub4 kubadba @100 0x00000000 ub2 kubaseq @104 0x0000 ub1 kubarec @106 0x00 ub2 ktbitflg @108 0x0000 (NONE) union _ktbitun, 2 bytes @110 sb2 _ktbitfsc @110 0 ub2 _ktbitwrp @110 0x0000 ub4 ktbitbas @112 0x00000000 struct ktbbhitl[3], 24 bytes @116 struct ktbitxid, 8 bytes @116 ub2 kxidusn @116 0x0000 ub2 kxidslt @118 0x0000 ub4 kxidsqn @120 0x00000000 struct ktbituba, 8 bytes @124 ub4 kubadba @124 0x00000000 ub2 kubaseq @128 0x0000 ub1 kubarec @130 0x00 ub2 ktbitflg @132 0x0000 (NONE) union _ktbitun, 2 bytes @134 sb2 _ktbitfsc @134 0 ub2 _ktbitwrp @134 0x0000 ub4 ktbitbas @136 0x00000000 struct ktbbhitl[167], 24 bytes @4052 struct ktbitxid, 8 bytes @4052 ub2 kxidusn @4052 0x0000 ub2 kxidslt @4054 0x0000 ub4 kxidsqn @4056 0x00000000 struct ktbituba, 8 bytes @4060 ub4 kubadba @4060 0x00000000 ub2 kubaseq @4064 0x0000 ub1 kubarec @4066 0x00 ub2 ktbitflg @4068 0x0000 (NONE) union _ktbitun, 2 bytes @4070 sb2 _ktbitfsc @4070 0 ub2 _ktbitwrp @4070 0x0000 ub4 ktbitbas @4072 0x00000000 struct ktbbhitl[168], 24 bytes @4076 struct ktbitxid, 8 bytes @4076 ub2 kxidusn @4076 0x0000 ub2 kxidslt @4078 0x0000 ub4 kxidsqn @4080 0x00000000 struct ktbituba, 8 bytes @4084 ub4 kubadba @4084 0x00000000 ub2 kubaseq @4088 0x0000 ub1 kubarec @4090 0x00 ub2 ktbitflg @4092 0x0000 (NONE) union _ktbitun, 2 bytes @4094 sb2 _ktbitfsc @4094 0 ub2 _ktbitwrp @4094 0x0000 ub4 ktbitbas @4096 0x00000000 BBED> struct kdbh, 14 bytes @4108 ub1 kdbhflag @4108 0x00 (NONE) sb1 kdbhntab @4109 1 sb2 kdbhnrow @4110 135 sb2 kdbhfrre @4112 -1 sb2 kdbhfsbo @4114 288 sb2 kdbhfseo @4116 705 sb2 kdbhavsp @4118 417 sb2 kdbhtosp @4120 417 BBED> File: /data2/enmo/hsql01.dbf (5) Block: 171 Offsets: 36 to 47 Dba:0x014000ab ------------------------------------------------------------------------ a9f83200 a8004001 03001e00 <32 bytes per line> BBED>

4.7 drop_255块结构解析

set dba 5,179 p ktbbh p kdbh d offset 36 count 12 BBED> struct ktbbh, 144 bytes @20 ub1 ktbbhtyp @20 0x01 (KDDBTDATA) union ktbbhsid, 4 bytes @24 ub4 ktbbhsg1 @24 0x0000361c ub4 ktbbhod1 @24 0x0000361c struct ktbbhcsc, 8 bytes @28 ub4 kscnbas @28 0x000b3343 ub2 kscnwrp @32 0x0000 sb2 ktbbhict @36 -2043 ub1 ktbbhflg @38 0x32 (NONE) ub1 ktbbhfsl @39 0x00 ub4 ktbbhfnx @40 0x014000a0 struct ktbbhitl[0], 24 bytes @44 struct ktbitxid, 8 bytes @44 ub2 kxidusn @44 0x0003 ub2 kxidslt @46 0x001e ub4 kxidsqn @48 0x0000013d struct ktbituba, 8 bytes @52 ub4 kubadba @52 0x00c009e4 ub2 kubaseq @56 0x0183 ub1 kubarec @58 0x2d ub2 ktbitflg @60 0x210a (KTBFUPB) union _ktbitun, 2 bytes @62 sb2 _ktbitfsc @62 0 ub2 _ktbitwrp @62 0x0000 ub4 ktbitbas @64 0x000b3351 struct ktbbhitl[1], 24 bytes @68 struct ktbitxid, 8 bytes @68 ub2 kxidusn @68 0x0000 ub2 kxidslt @70 0x0000 ub4 kxidsqn @72 0x00000000 struct ktbituba, 8 bytes @76 ub4 kubadba @76 0x00000000 ub2 kubaseq @80 0x0000 ub1 kubarec @82 0x00 ub2 ktbitflg @84 0x0000 (NONE) union _ktbitun, 2 bytes @86 sb2 _ktbitfsc @86 0 ub2 _ktbitwrp @86 0x0000 ub4 ktbitbas @88 0x00000000 struct ktbbhitl[2], 24 bytes @92 struct ktbitxid, 8 bytes @92 ub2 kxidusn @92 0x0000 ub2 kxidslt @94 0x0000 ub4 kxidsqn @96 0x00000000 struct ktbituba, 8 bytes @100 ub4 kubadba @100 0x00000000 ub2 kubaseq @104 0x0000 ub1 kubarec @106 0x00 ub2 ktbitflg @108 0x0000 (NONE) union _ktbitun, 2 bytes @110 sb2 _ktbitfsc @110 0 ub2 _ktbitwrp @110 0x0000 ub4 ktbitbas @112 0x00000000 struct ktbbhitl[3], 24 bytes @116 struct ktbitxid, 8 bytes @116 ub2 kxidusn @116 0x0000 ub2 kxidslt @118 0x0000 ub4 kxidsqn @120 0x00000000 struct ktbituba, 8 bytes @124 ub4 kubadba @124 0x00000000 ub2 kubaseq @128 0x0000 ub1 kubarec @130 0x00 ub2 ktbitflg @132 0x0000 (NONE) union _ktbitun, 2 bytes @134 sb2 _ktbitfsc @134 0 ub2 _ktbitwrp @134 0x0000 ub4 ktbitbas @136 0x00000000 struct ktbbhitl[167], 24 bytes @4052 struct ktbitxid, 8 bytes @4052 ub2 kxidusn @4052 0x0000 ub2 kxidslt @4054 0x0000 ub4 kxidsqn @4056 0x00000000 struct ktbituba, 8 bytes @4060 ub4 kubadba @4060 0x00000000 ub2 kubaseq @4064 0x0000 ub1 kubarec @4066 0x00 ub2 ktbitflg @4068 0x0000 (NONE) union _ktbitun, 2 bytes @4070 sb2 _ktbitfsc @4070 0 ub2 _ktbitwrp @4070 0x0000 ub4 ktbitbas @4072 0x00000000 struct ktbbhitl[168], 24 bytes @4076 struct ktbitxid, 8 bytes @4076 ub2 kxidusn @4076 0x0000 ub2 kxidslt @4078 0x0000 ub4 kxidsqn @4080 0x00000000 struct ktbituba, 8 bytes @4084 ub4 kubadba @4084 0x00000000 ub2 kubaseq @4088 0x0000 ub1 kubarec @4090 0x00 ub2 ktbitflg @4092 0x0000 (NONE) union _ktbitun, 2 bytes @4094 sb2 _ktbitfsc @4094 0 ub2 _ktbitwrp @4094 0x0000 ub4 ktbitbas @4096 0x00000000 BBED> struct kdbh, 14 bytes @4108 ub1 kdbhflag @4108 0x00 (NONE) sb1 kdbhntab @4109 1 sb2 kdbhnrow @4110 135 sb2 kdbhfrre @4112 -1 sb2 kdbhfsbo @4114 288 sb2 kdbhfseo @4116 705 sb2 kdbhavsp @4118 417 sb2 kdbhtosp @4120 417 BBED> File: /data2/enmo/hsql01.dbf (5) Block: 179 Offsets: 36 to 47 Dba:0x014000b3 ------------------------------------------------------------------------ a9f83200 b0004001 03001e00 <32 bytes per line> BBED> --8192 40 + 4056=4096

4.8 16K blocksize

Block header dump: 0x01400043 Object id on Block? Y seg/obj: 0x35b2 csc: 0x00.330ea itc: 255 flg: E typ: 1 - DATA brn: 0 bdba: 0x1400040 ver: 0x01 opc: 0 inc: 0 exflg: 0 Itl Xid Uba Flag Lck Scn/Fsc 0x01 0x0006.031.0000005a 0x00c02c98.0020.45 --U- 339 fsc 0x0000.000330ee 0x02 0x0000.000.00000000 0x00000000.0000.00 ---- 0 fsc 0x0000.00000000 0x03 0x0000.000.00000000 0x00000000.0000.00 ---- 0 fsc 0x0000.00000000 0x04 0x0000.000.00000000 0x00000000.0000.00 ---- 0 fsc 0x0000.00000000 0x05 0x0000.000.00000000 0x00000000.0000.00 ---- 0 fsc 0x0000.00000000 ... 0xfc 0x0000.000.00000000 0x00000000.0000.00 ---- 0 fsc 0x0000.00000000 0xfd 0x0000.000.00000000 0x00000000.0000.00 ---- 0 fsc 0x0000.00000000 0xfe 0x0000.000.00000000 0x00000000.0000.00 ---- 0 fsc 0x0000.00000000 0xff 0x0000.000.00000000 0x00000000.0000.00 ---- 0 fsc 0x0000.00000000

5. 内容总结

1. Oracle 8K blocksize 数据块初始 2个itl,8K blocksize 数据块最多169个itl,16K blocksize 数据块最多256个itl。 2. type_kcbh(offset 0): 0x06 表示为数据块,ktbbhtyp(offset 20): Typ: 1=DATA; 2=INDEX 3. offset 36: itl数量,40(before offset of ktbbhitl) + offset[offset36 * 24] + 8(ktbbh和kdbh存在8offset): kdbh结构的offset, 4. offsetOfKdbh+1: tab的数量,cluster表可能大于1,堆表等于1. 5. offsetOfKdbh+2: row的数量.

与[转帖]create table INITRANS参数分析相似的内容:

[转帖]create table INITRANS参数分析

https://www.modb.pro/db/44701 1. 内容介绍 Oracle数据库create table时使用INITRANS参数设置数据块ITL事务槽的数量,确保该数据块上 并发事务数量。参数内容总结如下, 1. Oracle 8K blocksize 数据块初始 2个itl,8K

[转帖]Sql Server 创建临时表

https://cdn.modb.pro/db/513973 创建临时表 方法一: create table #临时表名(字段1 约束条件,字段2 约束条件,.....) create table ##临时表名(字段1 约束条件,字段2 约束条件,.....) 方法二: select * into

[转帖]关系模型到 Key-Value 模型的映射

https://cn.pingcap.com/blog/tidb-internal-2 在这我们将关系模型简单理解为 Table 和 SQL 语句,那么问题变为如何在 KV 结构上保存 Table 以及如何在 KV 结构上运行 SQL 语句。 假设我们有这样一个表的定义: CREATE TABLE

[转帖]Mysql向表中循环插入数据

如何查看MySQL的当前存储引擎 看你的mysql现在已提供什么存储引擎: mysql> show engines; 看你的mysql当前默认的存储引擎: mysql> show variables like '%storage_engine%'; 创建表 create table per2 (id

[转帖]postgresql 表和索引的膨胀简析

postgresql 表和索引的膨胀是非常常见的,一方面是因为 autovacuum 清理标记为 dead tuple 的速度跟不上,另一方面也可能是由于长事物,未决事物,复制槽引起的。 #初始化数据 zabbix=# create table tmp_t0(c0 varchar(100),c1 v

[转帖]人大金仓数据库分区表

分区表 声明式创建分区 按列创建分区(PARTITION BY LIST) 将学员表student按所在城市使用partition by list创建分区 创建分区表(基表) 创建格式 create table 表名(字段名 数据类型)PARTITION BY LIST(要分区的字段名) 创建子分区

[转帖]金仓数据库KingbaseES分区表 -- 声明式创建分区表

https://www.modb.pro/db/638045 1. 创建分区表同时创建分区 1.1 准备环境 # 创建分区表同时创建分区 create table tb1(id bigint,stat date,no bigint,pdate date,info varchar2(50)) part

[转帖]MySQL快速备份表

https://www.cnblogs.com/JaxYoun/p/14264593.html 1、复制表结构及数据到新表 CREATE TABLE 新表 SELECT * FROM 旧表 这种方法会将oldtable中所有的内容都拷贝过来,当然我们可以用delete from newtable;来

[转帖]kingbase(人大金仓)的一些常用表操作语句

包括 1)创建表 2)删除表 3)加字段 4)字段换名 5)字段改类型 6)字段添加注释 7)修改字段为自增类型 8)增加主键 9)查看模式下的表 一、创建和删除表 DROP TABLE IF EXISTS "DZ_RAIN" CASCADE; CREATE TABLE "DZ_RAIN" ( "I

[转帖]elasticsearch-create-enrollment-tokenedit

https://www.elastic.co/guide/en/elasticsearch/reference/current/create-enrollment-token.html The elasticsearch-create-enrollment-token command creates