oralce数据库表空间迁移
作者:互联网
/*迁移表的表空间 */ SELECT 'alter table ' || TABLE_NAME || ' move tablespace KAVINS;' FROM ALL_TABLES WHERE OWNER = 'KAVINS'; /*迁移索引表空间*/ SELECT 'alter index ' || INDEX_NAME || ' rebuild tablespace KAVINS;' FROM USER_INDEXES WHERE TABLE_OWNER = 'KAVINS' AND INDEX_NAME NOT LIKE '%$$'; /*LOB类型表空间迁移*/ SELECT 'alter table ' || TABLE_NAME || ' move lob (' || COLUMN_NAME || ')' || 'store as(tablespace KAVINS); ' FROM USER_LOBS; /*重建索引语句*/ SELECT 'alter index ' || INDEX_NAME || ' rebuild;' FROM USER_INDEXES WHERE STATUS = 'UNUSABLE';
标签:INDEX,oralce,NAME,数据库,USER,KAVINS,迁移,alter,SELECT 来源: https://www.cnblogs.com/kavins/p/14332156.html