1.修改表的空间
alter table TABLE_NAME move tablespace TABLESPACENAME
查询当前用户下的所有表
select 'alter table '|| table_name ||' move tablespace tablespacename;' from user_tables;
2.修改表的索引的空间
alter index INDEX_NAME rebuild tablespace TABLESPACENAME
查询当前用户下的所有索引
select 'alter index '|| index_name ||' rebuild tablespace tablespacename;' from user_indexes;
可以使用脚本执行查询的结果,这样就可以批量处理!
在移植看注意研究了下ORACLE ALTER TABLE MOVE 的语法:
ALTER TABLE table_name MOVE [ONLINE] tablespace_name;
通过上面的语句可以移植表到新表空间,
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/28686045/viewspace-1479215/
,如需转载,请注明出处,否则将追究法律责任。