Friday, August 15, 2008

Shrink a table

select sum(bytes) from dba_segments where segment_name = 'ETPPRICE';
alter table etsdyn.etpprice enable row movement;
ALTER TABLE etsdyn.etpprice SHRINK SPACE CASCADE;
alter table etsdyn.etpprice disable row movement;
select sum(bytes) from dba_segments where segment_name = 'ETPPRICE';
alter index etsdyn.ETPPRICE_PK rebuild online;