Oracle移动表空间命令

select 'alter table ' || t.table_name || ' move tablespace JZ_FXGL;'--移动的表
  from all_all_tables t
 where t.owner = 'FXGL'
   and t.tablespace_name = 'USERS';


select 'alter index ' || i.INDEX_NAME || ' rebuild;'--重建索引
  from all_indexes i
 where exists (select *
          from all_all_tables t
         where t.owner = 'FXGL'
           and t.tablespace_name = 'USERS'
           and t.table_name = i.TABLE_NAME
           and t.owner = i.TABLE_OWNER);

你可能感兴趣的:(Oracle移动表空间命令)