從system/sysaux空間轉移TABLE&Index到其它表空間

ningzi82發表於2010-11-16

select owner,segment_name,segment_type,tablespace_name,bytes/1024/1024 Mb from dba_segments
where (tablespace_name in('SYSTEM','SYSAUX')) and (owner not in ('SYS','SYSTEM')) and
(owner in ('SMP','SMP_EMS')) order by Mb desc;

select 'alter table '||segment_name||'move tablespace users;' from dba_segments
where (tablespace_name in('SYSTEM','SYSAUX')) and (owner not in ('SYS','SYSTEM')) and
(owner in ('SMP','SMP_EMS')) and segment_type='TABLE';


select 'alter index '||segment_name||'rebuild online tablespace users;' from dba_segments
where (tablespace_name in('SYSTEM','SYSAUX')) and (owner not in ('SYS','SYSTEM')) and
(owner in ('SMP','SMP_EMS')) and segment_type='INDEX';

[@more@]

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/789833/viewspace-1041553/,如需轉載,請註明出處,否則將追究法律責任。

相關文章