ORACLE如何修改表的表空间

手册/FAQ (453) 2016-05-05 10:52:00

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

THE END