- 最后登录
- 2023-8-16
- 在线时间
- 1686 小时
- 威望
- 2135
- 金钱
- 50532
- 注册时间
- 2011-10-12
- 阅读权限
- 200
- 帖子
- 5207
- 精华
- 39
- 积分
- 2135
- UID
- 2
|
2#
发表于 2013-9-13 20:42:17
FYI
SQL> create table free_me (t1 char(200)) tablespace users pctfree 99 pctused 1;
表已创建。
SQL>
SQL>
SQL> insert into free_me values('ASK MACLEAN');
已创建 1 行。
SQL> insert into free_me select * from free_me;
已创建 1 行。
SQL> /
已创建 2 行。
SQL> /
已创建 4 行。
SQL> /
已创建 8 行。
SQL> /
已创建 16 行。
SQL> /
已创建 32 行。
SQL> /
已创建 64 行。
SQL> /
已创建 128 行。
SQL> /
已创建 256 行。
SQL> commit;
提交完成。
SQL> alter system checkpoint;
系统已更改。
set serveroutput on;
declare
v_unformatted_blocks number;
v_unformatted_bytes number;
v_fs1_blocks number;
v_fs1_bytes number;
v_fs2_blocks number;
v_fs2_bytes number;
v_fs3_blocks number;
v_fs3_bytes number;
v_fs4_blocks number;
v_fs4_bytes number;
v_full_blocks number;
v_full_bytes number;
begin
dbms_space.space_usage ('SYS', 'FREE_ME', 'TABLE', v_unformatted_blocks,
v_unformatted_bytes, v_fs1_blocks, v_fs1_bytes, v_fs2_blocks, v_fs2_bytes,
v_fs3_blocks, v_fs3_bytes, v_fs4_blocks, v_fs4_bytes, v_full_blocks, v_full_bytes);
dbms_output.put_line('Unformatted Blocks = '||v_unformatted_blocks);
dbms_output.put_line('FS1 Blocks = '||v_fs1_blocks);
dbms_output.put_line('FS2 Blocks = '||v_fs2_blocks);
dbms_output.put_line('FS3 Blocks = '||v_fs3_blocks);
dbms_output.put_line('FS4 Blocks = '||v_fs4_blocks);
dbms_output.put_line('Full Blocks = '||v_full_blocks);
end;
/
Unformatted Blocks = 48
FS1 Blocks = 0
FS2 Blocks = 0
FS3 Blocks = 0
FS4 Blocks = 62
Full Blocks = 512
PL/SQL 过程已成功完成。
SQL> select header_file ,header_block from dba_segments where segment_name='FREE_ME';
HEADER_FILE HEADER_BLOCK
----------- ------------
6 413554
SQL> alter system dump datafile 6 block 413554;
系统已更改。
Segment Type: 1 nl2: 1 blksz: 8192 fbsz: 0
L2 Array start offset: 0x00001434
First Level 3 BMB: 0x00000000
L2 Hint for inserts: 0x01864f71
Last Level 1 BMB: 0x0185d481
Last Level II BMB: 0x01864f71
Last Level III BMB: 0x00000000
Map Header:: next 0x00000000 #extents: 20 obj#: 122802 flag: 0x10000000
Inc # 0
Extent Map
-----------------------------------------------------------------
0x01864f70 length: 8
0x01864f78 length: 8
0x01865800 length: 8
0x01865808 length: 8
0x01865810 length: 8
0x01865818 length: 8
0x01865820 length: 8
0x01865828 length: 8
0x01865830 length: 8
0x01865838 length: 8
0x01865840 length: 8
0x01865848 length: 8
0x01865850 length: 8
0x01869e20 length: 8
0x01869e28 length: 8
0x01869e30 length: 8
0x0185d300 length: 128
0x0185d380 length: 128
0x0185d400 length: 128
0x0185d480 length: 128
Auxillary Map
--------------------------------------------------------
Extent 0 : L1 dba: 0x01864f70 Data dba: 0x01864f73
Extent 1 : L1 dba: 0x01864f70 Data dba: 0x01864f78
Extent 2 : L1 dba: 0x01865800 Data dba: 0x01865801
Extent 3 : L1 dba: 0x01865800 Data dba: 0x01865808
Extent 4 : L1 dba: 0x01865810 Data dba: 0x01865811
Extent 5 : L1 dba: 0x01865810 Data dba: 0x01865818
Extent 6 : L1 dba: 0x01865820 Data dba: 0x01865821
Extent 7 : L1 dba: 0x01865820 Data dba: 0x01865828
Extent 8 : L1 dba: 0x01865830 Data dba: 0x01865831
Extent 9 : L1 dba: 0x01865830 Data dba: 0x01865838
Extent 10 : L1 dba: 0x01865840 Data dba: 0x01865841
Extent 11 : L1 dba: 0x01865840 Data dba: 0x01865848
Extent 12 : L1 dba: 0x01865850 Data dba: 0x01865851
Extent 13 : L1 dba: 0x01865850 Data dba: 0x01869e20
Extent 14 : L1 dba: 0x01869e28 Data dba: 0x01869e29
Extent 15 : L1 dba: 0x01869e28 Data dba: 0x01869e30
Extent 16 : L1 dba: 0x0185d300 Data dba: 0x0185d302
Extent 17 : L1 dba: 0x0185d380 Data dba: 0x0185d382
Extent 18 : L1 dba: 0x0185d400 Data dba: 0x0185d402
Extent 19 : L1 dba: 0x0185d480 Data dba: 0x0185d482
--------------------------------------------------------
Second Level Bitmap block DBAs
--------------------------------------------------------
DBA 1: 0x01864f71
End dump data blocks tsn: 4 file#: 6 minblk 413554 maxblk 413554
0x01864f70 110 0001100100111101110000
datafile 6 block 413552
SQL> alter system dump datafile 6 block 413552;
系统已更改。
--------------------------------------------------------
DBA Ranges :
--------------------------------------------------------
0x01864f70 Length: 8 Offset: 0
0x01864f78 Length: 8 Offset: 8
0:Metadata 1:Metadata 2:Metadata 3:FULL
4:FULL 5:FULL 6:FULL 7:FULL
8:FULL 9:FULL 10:FULL 11:FULL
12:FULL 13:FULL 14:FULL 15:FULL
5:FULL=> 413552+5=413557
Block header dump: 0x01864f75
Object id on Block? Y
seg/obj: 0x1dfb2 csc: 0x00.5cfb94 itc: 2 flg: E typ: 1 - DATA
brn: 0 bdba: 0x1864f70 ver: 0x01 opc: 0
inc: 0 exflg: 0
Itl Xid Uba Flag Lck Scn/Fsc
0x01 0x0007.011.00000bf9 0x01400284.02ce.2e ---- 1 fsc 0x0000.00000000
0x02 0x0000.000.00000000 0x00000000.0000.00 ---- 0 fsc 0x0000.00000000
bdba: 0x01864f75
data_block_dump,data header at 0x7d18264
===============
tsiz: 0x1f98
hsiz: 0x14
pbl: 0x07d18264
76543210
flag=--------
ntab=1
nrow=1
frre=-1
fsbo=0x14
fseo=0x1ecc
avsp=0x1eb8
tosp=0x1eb8
avsp=0x1eb8 ==>7864 虽然整个块还有 7864个可用字节,但仍被定义为FULL
Avsp: Available space in the block
这说明了FULL并不是指 没有可用空间了, 而是 使用的空间 》=( block size * (100-PCTFREE))了 |
|