Procedimiento para desfragmentar tablas en Oracle

218 views
Skip to first unread message

Wilson Barraza

unread,
Jan 22, 2007, 2:09:51 PM1/22/07
to Adminitración Oracle
select '/* ' ||OWNER || '.' || SEGMENT_NAME || ' Tamaño Data:' ||
round(BYTES/1024/1024) || ' */'
from dba_segments
where owner= 'SIEBEL'
and SEGMENT_NAME in (upper(:1))
union all
select 'alter table ' || owner || '.' || table_name || ' move
tablespace ' || 'xdb_paso;'
from dba_tables
where table_name in (upper(:1))
and owner= 'SIEBEL'
union all
select 'alter table ' || owner || '.' || table_name || ' move
tablespace ' || 'xdb;'
from dba_tables
where table_name in (upper(:1))
and owner= 'SIEBEL'
union all
select 'alter index ' || owner || '.' || index_name || ' rebuild
TABLESPACE ' || tablespace_name || ';'
from dba_indexes
where owner= 'SIEBEL'
and table_name in (upper(:1))
and index_type <> 'LOB'
;

Reply all
Reply to author
Forward
0 new messages