Professional Documents
Culture Documents
– Recover space, but don’t amend the high water mark (HWM).
ALTER TABLE scott.emp SHRINK SPACE COMPACT;
O Select abaixo, efetua a geração dos scripts para redução e realocação do espaço livre nas tabelas:
select t.*,
'ALTER ' || t.segment_type || ' ' || t.segment_name || ' ENABLE ROW MOVEMENT;' as enable_row_mov,
'ALTER ' || t.segment_type || ' ' || t.segment_name || ' SHRINK SPACE CASCADE;' as shrink,
'ALTER ' || t.segment_type || ' ' || t.segment_name || ' DISABLE ROW MOVEMENT;' as disable_row_mov
from (
select segment_name, segment_type, bytes/1024/1024 Size_Mb
from user_segments
where segment_type = 'TABLE'
and not exists(
select 1
from user_tab_columns
where table_name = segment_name
and data_type IN ('LONG', 'LONG RAW'))
order by bytes/1024/1024 DESC ) t;
fonte:
http://www.superti.org/?p=122
http://veduardodba.wordpress.com/2011/12/29/shrink-a-table/
Postado por Emerson S. Gaudencio às 09:41
blog.gaudencio.net.br/2013/11/oracle-shrink-de-tabelas-dentro-da.html 1/1