oracle查看某一表的表空间,以及修改单一表的表空间
拼接语句查询出所有表要迁入表空间的语句,这样可以批量查询出来,修改方便。 select 'alter table ' || table_name || ' move tablespace 要迁入的表空间;' from dba_tables t where t . owner = '要迁出的表归属用户名' ; 查询出指定表空间下的表: select tablespace_name , table_name from user_tables WHERE tablespace_name = '表空间名称' ; 查询出单一表对应的表空间: select tablespace_name , table_name from user_tables where table_name = '表名' ; 修改单一表对应的表空间: alter table 表名 move tablespace 表空间名称 ; 修改完空间后,会出现部分问题,比如索引失效: 此时需要查看所有的索引,重新添加索引: select 'alter index ' || index_name || ' rebuild online;' from user_indexes where status <> 'VALID' and index_name not like '%$$' ; 来源: CSDN 作者: So Young_ 链接