- 最后登录
- 2023-8-16
- 在线时间
- 1686 小时
- 威望
- 2135
- 金钱
- 50532
- 注册时间
- 2011-10-12
- 阅读权限
- 200
- 帖子
- 5207
- 精华
- 39
- 积分
- 2135
- UID
- 2
|
4#
发表于 2012-2-17 23:25:34
ODM Testing
- SQL> select * from v$version;
- BANNER
- ----------------------------------------------------------------
- Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bi
- PL/SQL Release 10.2.0.1.0 - Production
- CORE 10.2.0.1.0 Production
- TNS for Linux: Version 10.2.0.1.0 - Production
- NLSRTL Version 10.2.0.1.0 - Production
- SQL> create tablespace small datafile '/s01/small.dbf' size 10M;
- Tablespace created.
- SQL> create table tb1 (t1 int) storage (initial 128k) tablespace small;
- Table created.
- SQL> alter system checkpoint;
- System altered.
- SQL> alter system dump datafile '/s01/small.dbf' block 3;
- System altered.
- SQL> oradebug setmypid;
- Statement processed.
- SQL> oradebug tracefile_name;
- /s01/admin/G10R21/udump/g10r21_ora_3692.trc
- File Space Bitmap Block:
- BitMap Control:
- RelFno: 29, BeginBlock: 9, Flag: 0, First: 2, Free: 63486
- 0300000000000000 0000000000000000 0000000000000000 0000000000000000
- 0000000000000000 0000000000000000 0000000000000000 0000000000000000
- 0000000000000000 0000000000000000 0000000000000000 0000000000000000
- 0000000000000000 0000000000000000 0000000000000000 0000000000000000
- 0000000000000000 0000000000000000 0000000000000000 0000000000000000
- 0000000000000000 0000000000000000 0000000000000000 0000000000000000
- 0000000000000000 0000000000000000 0000000000000000 0000000000000000
- 0000000000000000 0000000000000000 0000000000000000 0000000000000000
复制代码
030=> 0000 0011 0000 bit => 128K
Local Extent Management 下最小一个Extent = 8 个 oracle block
当 db_block_size=8k 时 即一个bit 代表64k
一个位图bit 代表64k , 在 8k标准块情况下是正确的。
RelFno: 29, BeginBlock: 9, Flag: 0, First: 2, Free: 63486
这里还可以看懂 Data Beginblock:9
即一个数据文件的 第1-2个块是 datafile header 是被保留的, 3-8 个块是KTFB Bitmapped File Space Bitmap, 从第九个块开始 是数据。即在此数据文件上文件头 datafile header 保留了8个块(耐心看完)。
ODM Test2:
- SQL> create tablespace large datafile '/s01/large.dbf' size 32767M;
- Tablespace created.
- SQL> create tablespace large datafile '/s01/large.dbf' size 32767M;
- Tablespace created.
- SQL> alter system dump datafile '/s01/large.dbf' block 3;
- System altered.
- Start dump data block from file /s01/large.dbf minblk 3 maxblk 3
- V10 STYLE FILE HEADER:
- Compatibility Vsn = 169869568=0xa200100
- Db ID=2807279631=0xa753b00f, Db Name='G10R21'
- Activation ID=0=0x0
- Control Seq=31695=0x7bcf, File size=4194176=0x3fff80
- File Number=30, Blksiz=8192, File Type=3 DATA
- Dump all the blocks in range:
- buffer tsn: 13 rdba: 0x07800003 (30/3)
- scn: 0x0000.00d3479d seq: 0x01 flg: 0x04 tail: 0x479d1e01
- frmt: 0x02 chkval: 0x4741 type: 0x1e=KTFB Bitmapped File Space Bitmap
- Hex dump of block: st=0, typ_found=1
- Dump of memory from 0x0000000006F8A200 to 0x0000000006F8C200
- 006F8A200 0000A21E 07800003 00D3479D 04010000 [.........G......]
- 006F8A210 00004741 0000001E 00000011 00000000 [AG..............]
- 006F8A220 00000000 0000F800 00000000 00000000 [................]
- 006F8A230 00000000 00000000 00000000 00000000 [................]
- Repeat 507 times
- 006F8C1F0 00000000 00000000 00000000 479D1E01 [...............G]
- File Space Bitmap Block:
- BitMap Control:
- RelFno: 30, BeginBlock: 17, Flag: 0, First: 0, Free: 63488
- 0000000000000000 0000000000000000 0000000000000000 0000000000000000
- 0000000000000000 0000000000000000 0000000000000000 0000000000000000
- 0000000000000000 0000000000000000 0000000000000000 0000000000000000
- 0000000000000000 0000000000000000 0000000000000000 0000000000000000
- 0000000000000000 0000000000000000 0000000000000000 0000000000000000
- 0000000000000000 0000000000000000 0000000000000000 0000000000000000
- alter system dump datafile '/s01/large.dbf' block 16;
- Start dump data block from file /s01/large.dbf minblk 16 maxblk 16
- V10 STYLE FILE HEADER:
- Compatibility Vsn = 169869568=0xa200100
- Db ID=2807279631=0xa753b00f, Db Name='G10R21'
- Activation ID=0=0x0
- Control Seq=31695=0x7bcf, File size=4194176=0x3fff80
- File Number=30, Blksiz=8192, File Type=3 DATA
- Dump all the blocks in range:
- buffer tsn: 13 rdba: 0x07800010 (30/16)
- scn: 0x0000.00d347b7 seq: 0x01 flg: 0x04 tail: 0x47b71e01
- frmt: 0x02 chkval: 0x8736 type: 0x1e=KTFB Bitmapped File Space Bitmap
- Hex dump of block: st=0, typ_found=1
- Dump of memory from 0x0000000006F8A200 to 0x0000000006F8C200
- 006F8A200 0000A21E 07800010 00D347B7 04010000 [.........G......]
- 006F8A210 00008736 0000001E 0064C011 00000000 [6.........d.....]
- 006F8A220 00000000 0000F800 00000000 00000000 [................]
- 006F8A230 00000000 00000000 00000000 00000000 [................]
- Repeat 507 times
- 006F8C1F0 00000000 00000000 00000000 47B71E01 [...............G]
- File Space Bitmap Block:
- BitMap Control:
- RelFno: 30, BeginBlock: 6602769, Flag: 0, First: 0, Free: 63488
- 0000000000000000 0000000000000000 0000000000000000 0000000000000000
- 0000000000000000 0000000000000000 0000000000000000 0000000000000000
- 0000000000000000 0000000000000000 0000000000000000 0000000000000000
- 0000000000000000 0000000000000000 0000000000000000 0000000000000000
复制代码
RelFno: 30, BeginBlock: 17, Flag: 0, First: 0, Free: 63488
BeginBlock: 17=》KTFB Bitmapped File Space Bitmap 的范围从 3-8 扩展到了 3-16 = 14 个块
14 * 64KB * 63488= 54.25 超过了 8k block size的small datafile的最大大小32g
也就是说 File space Bitmap的区域会随着数据文件增长的需求 而扩展:
10g small datafile 下 (11g 范围更大)
最少且默认为 6个 File Space Bitmap 块 = 8k block size时 23.25g
最多为 14个File Space Bitmap 块 = 8k block size 时 54.25g
但是因为单个small datafile 数据文件的 block总数上限为4194303 个( 4194303 * 8k = 32g) 所以实际达不到54.25g,会有部分File Space Bitmap 被浪费。 |
|