xtts ORA-39943

今天在做xtts迁移的时候碰到了个数据库报错,现将信息整理如下:

检查表空间的自包含情况: execute sys.dbms_tts.transport_set_check('XXX,XXX,XXX', true); 检查是否有报错信息: select * from sys.transport_set_violations; 发现大量如下报错: ORA-39943: Global index XXX in tablespace XXX has orphaned entries. <br> 发现索引里面有孤儿数据,大致有下面几个方法: 1 能确定索引没什么用,删了了事。 2 对索引进行清理: alter index coalesce cleanup parallel 5; 并行度根据实际情况设置 3 重建索引: alter index rebuild online parallel 4; <br> 下面是参考的mos文档信息: Transportable Tablespaces (TTS) Export Failed WITH ORA-39943: Global index XXX in tablespace YYY has orphaned entries. (Doc ID 3005636.1) 文档内容如下: <br> APPLIES TO: Oracle Database - Enterprise Edition - Version 19.19.0.0.0 and later Information in this document applies to any platform. SYMPTOMS Errors during TTS export: <br> ORA-39123: Data Pump transportable job aborted ORA-39187: The transportable set is not self-contained, violation list is: <br> ORA-39943: Global index in tablespace has orphaned entries. <br> job "SYS"."SYS_EXPORT_TRANSPORTABLE_01" stopped due to fatal error. <br> CHANGES N/A <br> CAUSE Tablespace has orphaned entries. <br> <br> <br> <br> SOLUTION <br> alter index coalesce cleanup parallel 5; <br> <br> exec dbms_part.cleanup_gidx(''); <br> ERROR as line 1: ORA-20000: No global index segments were cleaned ORA-06512: at "SYS.DBMS_PART", line 225 ORA-06512: at "SYS.DBMS_PART", line 290 ORA-06512: at line 1 <br> Testing internally demonstrated that the aforementioned solution is effective, but it did not prove successful for one customer. <br> If the above does not work, then use the solution below. <br> <br> alter index rebuild online parallel 4; <br> After rebuilding the index, sys.dbms_tts.transport_set_check returned no errors. <br> SQL> EXEC sys.dbms_tts.transport_set_check('TBS1,TBS2',TRUE); >>>>>>>>>>>>replace with your tablespace names. SQL> select * from sys.transport_set_violations; <br>