当前位置导航:炫浪网>>网络学院>>编程开发>>Oracle教程

不同的方式,hwm为什么有差别?

SQL> desc x;
Name Type   Nullable Default Comments
---- ------ -------- ------- --------
A    NUMBER Y

SQL> select count(*) from x;

   COUNT(*)
----------
      88000

SQL> create table x1(a number) storage(initial 32K next 32K pctincrease 50);

Table created

SQL> insert into x1
   2  select * from x;

88000 rows inserted

SQL> commit;

Commit complete

SQL>  exec show_space('x1');
--------------------------
Object name:SYS.X1
Total Blocks = 160
Total Bytes = 1310720
Unused Blocks = 23
Unused Bytes = 188416
Last_used_extent_file_id = 1
Last_used_extent_block_id = 31185
Last_used_block = 25
Highwater Mark = (160 - 23 - 1) = 136

PL/SQL procedure successfully completed

SQL> create table x2(a number) storage(initial 32K next 32K pctincrease 0);

Table created

SQL> insert into x2
   2  select * from x;

88000 rows inserted

SQL> commit;

Commit complete

SQL>  exec show_space('x2');
--------------------------
Object name:SYS.X2
Total Blocks = 136
Total Bytes = 1114112
Unused Blocks = 0
Unused Bytes = 0
Last_used_extent_file_id = 1
Last_used_extent_block_id = 31297
Last_used_block = 8
Highwater Mark = (136 - 0 - 1) = 135

PL/SQL procedure successfully completed

SQL> create table x3(a number) storage(initial 1024K next 1024K pctincrease 0);

Table created

SQL> insert into x3
   2  select * from x;

88000 rows inserted

SQL> commit;

Commit complete

SQL>  exec show_space('x3');
--------------------------
Object name:SYS.X3
Total Blocks = 256
Total Bytes = 2097152
Unused Blocks = 118
Unused Bytes = 966656
Last_used_extent_file_id = 1
Last_used_extent_block_id = 31433
Last_used_block = 10
Highwater Mark = (256 - 118 - 1) = 137

PL/SQL procedure successfully completed

SQL> create table x4(a number) storage(initial 2048K next 2048K pctincrease 0);

Table created

SQL> insert into x4
   2  select * from x;

88000 rows inserted

SQL> commit;

Commit complete

SQL>  exec show_space('x4');
--------------------------
Object name:SYS.X4
Total Blocks = 256
Total Bytes = 2097152
Unused Blocks = 120
Unused Bytes = 983040
Last_used_extent_file_id = 1
Last_used_extent_block_id = 31561
Last_used_block = 136
Highwater Mark = (256 - 120 - 1) = 135

PL/SQL procedure successfully completed

SQL> create table x5(a number) storage(initial 1024K next 1024K pctincrease 50);

Table created

SQL> insert into x5
   2  select * from x;

88000 rows inserted

SQL> commit;

Commit complete

SQL>  exec show_space('x5');
--------------------------
Object name:SYS.X5
Total Blocks = 256
Total Bytes = 2097152
Unused Blocks = 118
Unused Bytes = 966656
Last_used_extent_file_id = 1
Last_used_extent_block_id = 31945
Last_used_block = 10
Highwater Mark = (256 - 118 - 1) = 137

PL/SQL procedure successfully completed

SQL> select t.segment_name,t.blocks,t.extents,t.pct_increase
   2             from user_segments t where segment_name in ('X1','X2','X3','X4','X5');

SEGMENT_NAME                                                                         BLOCKS    EXTENTS PCT_INCREASE
-------------------------------------------------------------------------------- ---------- ---------- ------------
X1                                                                                      160          8           50
X2                                                                                      136         17            0
X3                                                                                      256          2            0
X4                                                                                      256          1            0
X5                                                                                      256          2           50

SQL>

相关内容
赞助商链接