iot 表主键存放所有数据,且按数据插入顺序排序

iot表测试:

 
在create table语句后面使用organization index,就指定数据表创建结构是IOT。但是在不指定主键Primary Key的情况下,是不允许建表的。
 create table t2 (id int primary key,a1 char(10),a2 char(10))organization index; 

SQL>  select object_name,object_id from user_objects;

OBJECT_NAME															  OBJECT_ID
-------------------------------------------------------------------------------------------------------------------------------- ----------
SYS_IOT_TOP_102684														     102685
T2																     102684


begin 
for i in 1 .. 2000 
loop 
insert into t2 values(i,i,'a'||i); 
end loop 
; 
commit; 
end;


SQL>  select value from v$diag_info where name='Default Trace File';

VALUE
--------------------------------------------------------------------------------
/u01/app/oracle/diag/rdbms/oadb/oadb/trace/oadb_ora_3932.trc

SQL>  alter session set events 'immediate trace name treedump level 102685';

会话已更改。

----- begin tree dump
branch: 0x10000ab 16777387 (0: nrow: 9, level: 1)
   leaf: 0x10000af 16777391 (-1: nrow: 245 rrow: 245)
   leaf: 0x10000ac 16777388 (0: nrow: 242 rrow: 242)
   leaf: 0x10000ad 16777389 (1: nrow: 242 rrow: 242)
   leaf: 0x10000ae 16777390 (2: nrow: 242 rrow: 242)
   leaf: 0x10000b7 16777399 (3: nrow: 242 rrow: 242)
   leaf: 0x10000b0 16777392 (4: nrow: 242 rrow: 242)
   leaf: 0x10000b1 16777393 (5: nrow: 242 rrow: 242)
   leaf: 0x10000b3 16777395 (6: nrow: 242 rrow: 242)
   leaf: 0x10000b4 16777396 (7: nrow: 61 rrow: 61)
----- end tree dump




SQL> select dbms_utility.data_block_address_file(16777391 ) fno,
       dbms_utility.data_block_address_block(16777391 ) bkno
  from dual ;  2    3  

       FNO	 BKNO
---------- ----------
	 4	  175


alter system dump datafile 4 block 175;


DECLARE
   n   VARCHAR2 (2000);
BEGIN
   DBMS_STATS.convert_raw_value ('61', n);
   DBMS_OUTPUT.put_line (n);
   DBMS_STATS.convert_raw_value ('37', n);
   DBMS_OUTPUT.put_line (n);
   DBMS_STATS.convert_raw_value ('32', n);
   DBMS_OUTPUT.put_line (n);
   DBMS_STATS.convert_raw_value ('38', n);
   DBMS_OUTPUT.put_line (n);
   DBMS_STATS.convert_raw_value ('20', n);
   DBMS_OUTPUT.put_line (n);
   DBMS_STATS.convert_raw_value ('20', n);
   DBMS_OUTPUT.put_line (n);
   DBMS_STATS.convert_raw_value ('20', n);
   DBMS_OUTPUT.put_line (n);
   DBMS_STATS.convert_raw_value ('20', n);
   DBMS_OUTPUT.put_line (n);
   DBMS_STATS.convert_raw_value ('20', n);
   DBMS_OUTPUT.put_line (n);
   DBMS_STATS.convert_raw_value ('20', n);
   DBMS_OUTPUT.put_line (n);
END;



col 0; len 3; (3):  c2 08 1d
tl: 36 fb: --H-FL-- lb: 0x0  cc: 3
col  0: [10]  37 32 38 20 20 20 20 20 20 20  --728
col  1: [10]  37 32 38 20 20 20 20 20 20 20  --728
col  2: [10]  61 37 32 38 20 20 20 20 20 20  ---a728
row#1[474] flag: K---S-, lock: 2, len=42
col 0; len 3; (3):  c2 08 1e
tl: 36 fb: --H-FL-- lb: 0x0  cc: 3
col  0: [10]  37 32 39 20 20 20 20 20 20 20   --729
col  1: [10]  37 32 39 20 20 20 20 20 20 20   --729
col  2: [10]  61 37 32 39 20 20 20 20 20 20   --a729
row#2[516] flag: K---S-, lock: 2, len=42
col 0; len 3; (3):  c2 08 1f
tl: 36 fb: --H-FL-- lb: 0x0  cc: 3
col  0: [10]  37 33 30 20 20 20 20 20 20 20   --730
col  1: [10]  37 33 30 20 20 20 20 20 20 20   --730
col  2: [10]  61 37 33 30 20 20 20 20 20 20   --a730
row#3[558] flag: K---S-, lock: 2, len=42
col 0; len 3; (3):  c2 08 20
tl: 36 fb: --H-FL-- lb: 0x0  cc: 3
col  0: [10]  37 33 31 20 20 20 20 20 20 20    --731
col  1: [10]  37 33 31 20 20 20 20 20 20 20    --731
col  2: [10]  61 37 33 31 20 20 20 20 20 20    --a731
row#4[600] flag: K---S-, lock: 2, len=42
col 0; len 3; (3):  c2 08 21
tl: 36 fb: --H-FL-- lb: 0x0  cc: 3
col  0: [10]  37 33 32 20 20 20 20 20 20 20     --732
col  1: [10]  37 33 32 20 20 20 20 20 20 20      --732
col  2: [10]  61 37 33 32 20 20 20 20 20 20   --a732
row#5[642] flag: K---S-, lock: 2, len=42
col 0; len 3; (3):  c2 08 22
tl: 36 fb: --H-FL-- lb: 0x0  cc: 3
col  0: [10]  37 33 33 20 20 20 20 20 20 20    --733
col  1: [10]  37 33 33 20 20 20 20 20 20 20    --733
col  2: [10]  61 37 33 33 20 20 20 20 20 20     --a733
row#6[684] flag: K---S-, lock: 2, len=42
col 0; len 3; (3):  c2 08 23
tl: 36 fb: --H-FL-- lb: 0x0  cc: 3
col  0: [10]  37 33 34 20 20 20 20 20 20 20
col  1: [10]  37 33 34 20 20 20 20 20 20 20
col  2: [10]  61 37 33 34 20 20 20 20 20 20
row#7[726] flag: K---S-, lock: 2, len=42
col 0; len 3; (3):  c2 08 24
tl: 36 fb: --H-FL-- lb: 0x0  cc: 3
col  0: [10]  37 33 35 20 20 20 20 20 20 20
col  1: [10]  37 33 35 20 20 20 20 20 20 20
col  2: [10]  61 37 33 35 20 20 20 20 20 20
row#8[768] flag: K---S-, lock: 2, len=42
col 0; len 3; (3):  c2 08 25
tl: 36 fb: --H-FL-- lb: 0x0  cc: 3
col  0: [10]  37 33 36 20 20 20 20 20 20 20
col  1: [10]  37 33 36 20 20 20 20 20 20 20
col  2: [10]  61 37 33 36 20 20 20 20 20 20
row#9[810] flag: K---S-, lock: 2, len=42
col 0; len 3; (3):  c2 08 26
tl: 36 fb: --H-FL-- lb: 0x0  cc: 3
col  0: [10]  37 33 37 20 20 20 20 20 20 20
col  1: [10]  37 33 37 20 20 20 20 20 20 20
col  2: [10]  61 37 33 37 20 20 20 20 20 20
row#10[852] flag: K---S-, lock: 2, len=42
col 0; len 3; (3):  c2 08 27
tl: 36 fb: --H-FL-- lb: 0x0  cc: 3
col  0: [10]  37 33 38 20 20 20 20 20 20 20
col  1: [10]  37 33 38 20 20 20 20 20 20 20
col  2: [10]  61 37 33 38 20 20 20 20 20 20
row#11[894] flag: K---S-, lock: 2, len=42
col 0; len 3; (3):  c2 08 28
tl: 36 fb: --H-FL-- lb: 0x0  cc: 3
col  0: [10]  37 33 39 20 20 20 20 20 20 20
col  1: [10]  37 33 39 20 20 20 20 20 20 20
col  2: [10]  61 37 33 39 20 20 20 20 20 20
row#12[936] flag: K---S-, lock: 2, len=42
col 0; len 3; (3):  c2 08 29
tl: 36 fb: --H-FL-- lb: 0x0  cc: 3
col  0: [10]  37 34 30 20 20 20 20 20 20 20
col  1: [10]  37 34 30 20 20 20 20 20 20 20
col  2: [10]  61 37 34 30 20 20 20 20 20 20
row#13[978] flag: K---S-, lock: 2, len=42
col 0; len 3; (3):  c2 08 2a
tl: 36 fb: --H-FL-- lb: 0x0  cc: 3
col  0: [10]  37 34 31 20 20 20 20 20 20 20
col  1: [10]  37 34 31 20 20 20 20 20 20 20
col  2: [10]  61 37 34 31 20 20 20 20 20 20
row#14[1020] flag: K---S-, lock: 2, len=42
col 0; len 3; (3):  c2 08 2b
tl: 36 fb: --H-FL-- lb: 0x0  cc: 3
col  0: [10]  37 34 32 20 20 20 20 20 20 20
col  1: [10]  37 34 32 20 20 20 20 20 20 20
col  2: [10]  61 37 34 32 20 20 20 20 20 20
row#15[1062] flag: K---S-, lock: 2, len=42
col 0; len 3; (3):  c2 08 2c
tl: 36 fb: --H-FL-- lb: 0x0  cc: 3
col  0: [10]  37 34 33 20 20 20 20 20 20 20
col  1: [10]  37 34 33 20 20 20 20 20 20 20
col  2: [10]  61 37 34 33 20 20 20 20 20 20
row#16[1104] flag: K---S-, lock: 2, len=42
col 0; len 3; (3):  c2 08 2d
tl: 36 fb: --H-FL-- lb: 0x0  cc: 3
col  0: [10]  37 34 34 20 20 20 20 20 20 20
col  1: [10]  37 34 34 20 20 20 20 20 20 20
col  2: [10]  61 37 34 34 20 20 20 20 20 20
row#17[1146] flag: K---S-, lock: 2, len=42
col 0; len 3; (3):  c2 08 2e
tl: 36 fb: --H-FL-- lb: 0x0  cc: 3
col  0: [10]  37 34 35 20 20 20 20 20 20 20
col  1: [10]  37 34 35 20 20 20 20 20 20 20
col  2: [10]  61 37 34 35 20 20 20 20 20 20
row#18[1188] flag: K---S-, lock: 2, len=42
col 0; len 3; (3):  c2 08 2f
tl: 36 fb: --H-FL-- lb: 0x0  cc: 3
col  0: [10]  37 34 36 20 20 20 20 20 20 20
col  1: [10]  37 34 36 20 20 20 20 20 20 20
col  2: [10]  61 37 34 36 20 20 20 20 20 20
row#19[1230] flag: K---S-, lock: 2, len=42
col 0; len 3; (3):  c2 08 30
tl: 36 fb: --H-FL-- lb: 0x0  cc: 3
col  0: [10]  37 34 37 20 20 20 20 20 20 20
col  1: [10]  37 34 37 20 20 20 20 20 20 20
col  2: [10]  61 37 34 37 20 20 20 20 20 20
row#20[1272] flag: K---S-, lock: 2, len=42
col 0; len 3; (3):  c2 08 31
tl: 36 fb: --H-FL-- lb: 0x0  cc: 3
col  0: [10]  37 34 38 20 20 20 20 20 20 20
col  1: [10]  37 34 38 20 20 20 20 20 20 20
col  2: [10]  61 37 34 38 20 20 20 20 20 20
row#21[1314] flag: K---S-, lock: 2, len=42
col 0; len 3; (3):  c2 08 32
tl: 36 fb: --H-FL-- lb: 0x0  cc: 3
col  0: [10]  37 34 39 20 20 20 20 20 20 20  --749
col  1: [10]  37 34 39 20 20 20 20 20 20 20  --749
col  2: [10]  61 37 34 39 20 20 20 20 20 20  --a749

原文地址:https://www.cnblogs.com/zhaoyangjian724/p/6199725.html