ORACLE 修改表的表空间

来源:互联网 发布:新海诚 知乎 编辑:程序博客网 时间:2024/05/25 23:25

1、先找到这哪些表的表空间不对。

 

select * from dba_tables where tablespace_name='TDB';

 

 

2、将表空间在 TDB 中的移到表空间 TDB2009 中

语法是: alter   table   table_name   move   tablespace   tablespace_name;

 

alter table tdb2009.ASSOC_INFO move tablespace TDB2009;
alter table tdb2009.BGUSERPOPD move tablespace TDB2009;

 

打完收工

 

select 'alter index TDB2009.'||index_name||' rebuild online nologging tablespace TDB2009;' from user_indexes

 

补充:

 

怎么在oracle中,把一个表空间的所有索引换到另一个表空间呢?
select 'alter index ' || index_name || ' move tablespace TDB2009;' from user_indexes

原创粉丝点击