ITPub博客

首页 > 应用开发 > IT综合 > HWM 释放空闲空间

HWM 释放空闲空间

原创 IT综合 作者:itpremier 时间:2010-11-23 11:38:47 0 删除 编辑

free unused space under HWM.

prerequisites: enable table row movement.

1, shrink space.

ALTER TABLE T2 SHRINK SPACE ;

2, move [tablespace].

ALTER TABLE T2 MOVE ;

-- sample code:

SELECT BLOCKS FROM USER_SEGMENTS WHERE SEGMENT_NAME='T2' ;
--384, 512
ALTER TABLE T2 ALLOCATE EXTENT (SIZE 1M) ;
exec dbms_stats.gather_table_stats(user,'t2')
DELETE T2 WHERE DEPTNO=10 ;
ALTER TABLE T2 DEALLOCATE UNUSED ;
ALTER TABLE T2 ENABLE ROW MOVEMENT;

-- blocks in user_tables indicate the HWM block.

select TABLE_NAME, BLOCKS,NUM_ROWS, A.sample_size, A.empty_blocks from user_tables A where table_name='T2' ;

[@more@]

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/350519/viewspace-1041927/ ,如需转载,请注明出处,否则将追究法律责任。

下一篇: free list ,hwm
请登录后发表评论 登录
全部评论

注册时间:2008-11-27

  • 博文量
    253
  • 访问量
    773713