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博客 ” ,链接:http://blog.itpub.net/350519/viewspace-1041927/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/350519/viewspace-1041927/
9589

被折叠的 条评论
为什么被折叠?



