ITPub博客

首页 > 数据库 > 数据库开发技术 > 从system/sysaux空间转移TABLE&Index到其它表空间

从system/sysaux空间转移TABLE&Index到其它表空间

原创 数据库开发技术 作者:ningzi82 时间:2010-11-16 14:05:51 0 删除 编辑

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

请登录后发表评论 登录
全部评论

注册时间:2008-12-16

  • 博文量
    130
  • 访问量
    358891