COUNT(*)
----------
0
SQL> select count(*) from fet$ where file# = 5;
COUNT(*)
----------
0
4、可以看到,ORACLE没有在这两个表中保存任何信息,现在我们dump该数据文件的第三个块
SQL> alter system dump datafile 5 block 3;
System altered.
查看DUMP文件,有如下信息
Start dump data blocks tsn: 5 file#: 5 minblk 3 maxblk 3
buffer tsn: 5 rdba: 0x01400003 (5/3)
scn: 0x0000.202f7a6f seq: 0x01 flg: 0x00 tail: 0x7a6f1e01
frmt: 0x02 chkval: 0x0000 type: 0x1e=KTFB Bitmapped File Space Bitmap
File Space Bitmap Block:
BitMap Control:
RelFno: 5, BeginBlock: 9, Flag: 0, First: 16, Free: 63472
FFFF000000000000 0000000000000000 0000000000000000 0000000000000000
0000000000000000 0000000000000000 0000000000000000 0000000000000000
.....
注意其中的FFFF00,,这是16进制的表现方法,我们转换为二进制,有
1111,1111,1111,1111,0000,0000
发现这里有16个1,每一个1就是一个位(bit),代表64K,也就代表了该表空间有已经分配了的16个extent,如果我们将该表扩展,将又有什么结果呢?
SQL> alter table demotab allocate extent;
Table altered.
SQL> alter table demotab allocate extent;
Table altered.
SQL> alter table demotab allocate extent;
Table altered.
这样之后,我们应该有19个extent了,再dump第三个块
Start dump data blocks tsn: 5 file#: 5 minblk 3 maxblk 3
buffer tsn: 5 rdba: 0x01400003 (5/3)
scn: 0x0000.202f7c64 seq: 0x01 flg: 0x00 tail: 0x7c641e01
frmt: 0x02 chkval: 0x0000 type: 0x1e=KTFB Bitmapped File Space Bitmap
File Space Bitmap Block:
BitMap Control:
RelFno: 5, BeginBlock: 9, Flag: 0, First: 19, Free: 63469
FFFF07 0000000000 0000000000000000 0000000000000000 0000000000000000
除了以前的FFFF,现在多了07,怎么解释呢?
07转换为二进制为0000,0111,但是还是不够解释以上的情况,这里我们没有考虑到字节交换的情况,因为以上FF交换后还是FF,但是如果是07,我们就必须考虑字节交换(因为计算机是一个字节一个字节的写,一个字节占两位当然是先写后面了,如从01到0F到FF为止。如果我们明白了,那么FFFF07转换为二进制为 1111,1111,1111,1111,0000,0111。
每个字节交换得
1111,1111,1111,1111,1110,0000
可以发现,这里有19个1,也就是19个位(bit),代表了现在的19个extent。
5、同样我们dump该数据文件第9个块,则有
Start dump data blocks tsn: 5 file#: 5 minblk 9 maxblk 9
buffer tsn: 5 rdba: 0x01400003 (5/3)
scn: 0x0000.202f7c64 seq: 0x01 flg: 0x00 tail: 0x7c641e01
frmt: 0x02 chkval: 0x0000 type: 0x1e=KTFB Bitmapped File Space Bitmap
Extent Control Header
-----------------------------------------------------------------
Extent Header:: spare1: 0 space2: 0 #extents: 16 #blocks: 127
last map 0x00000000 #maps: 0 offset: 4128
Highwater:: 0x01c0000a ext#: 0 blk#: 0 ext size: 7
#blocks in seg. hdr’s freelists: 0
#blocks below: 0
mapblk 0x00000000 offset: 0
Disk Lock:: Locked by scn: 0x0006.012.00000017
Map Header:: next 0x00000000 #extents: 16 obj#: 3090 flag: 0x40000000
Extent Map
-----------------------------------------------------------------
0x01c0000a length: 7
0x01c00011 length: 8
0x01c00019 length: 8
0x01c00021 length: 8
0x01c00029 length: 8
0x01c00031 length: 8
0x01c00039 length: 8
0x01c00041 length: 8
0x01c00049 length: 8
0x01c00051 length: 8
0x01c00059 length: 8
0x01c00061 length: 8
0x01c00069 length: 8
0x01c00071 length: 8
0x01c00079 length: 8
0x01c00081 length: 8