設計一個例子,演示數據塊整理(合併)的效果

SQL> create table t as select object_id,object_name from dba_objects;

Table created.

 

SQL> insert into  t select object_id,object_name from dba_objects;

72552 rowscreated.

 

SQL> insert into  t select object_id,object_name from dba_objects;

72552 rowscreated.

 

SQL> insert into  t select object_id,object_name from dba_objects;

72552 rowscreated.

 

SQL> insert into  t select object_id,object_name from dba_objects;

72552 rowscreated.

 

SQL> insert into  t select object_id,object_name from dba_objects;

72552 rowscreated.


SQL> commit;

 

Commit complete.


SQL> ANALYZE TABLE T COMPUTE STATISTICS;

 

Table analyzed.


SQL> select blocks from user_tables where table_name='T';

 

   BLOCKS

----------

     2062

 

SQL> alter table t enable row movement;

 

Table altered.

 

SQL> alter table t shrink space;

 

 

Table altered.

 

 

SQL> ANALYZE TABLE T COMPUTE STATISTICS;

 

Table analyzed.

 

SQL> select blocks from user_tables where table_name='T';

 

BLOCKS

----------

1950

發佈了20 篇原創文章 · 獲贊 1 · 訪問量 4萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章