重新映射的 Impdp 在 POST_TABLE_ACTION 上失败,仍在使用旧模式

Impdp with remap failing on POST_TABLE_ACTION still using old schema

我正在尝试在重新映射架构和表空间时导入 oracle 转储:

impdp usr/pass \
    EXCLUDE=table_statistics \
    DIRECTORY=EXPDP \
    REMAP_SCHEMA=ORG_USR:NEW_USR \
    REMAP_TABLESPACE=ORG_TS:NEW_TS \
    DUMPFILE=FILE.dmp \
    PARALLEL=2 \
    LOGFILE=FILE.imp.log

作业导入所有表,然后开始处理对象类型:

Import: Release 12.1.0.2.0 - Production on Thu Aug 17 11:13:06 2017

[ ... the import remaps correct ]

Processing object type SCHEMA_EXPORT/TABLE/TABLE_DATA
. . imported "NEW_USR"."SOMETABLE"              112.4 MB 1402414 rows
. . imported "NEW_USR"."SOMEOTHERTABLE"                 235.9 MB  955249 rows
. . imported "NEW_USR"."SOMETABLE3"                 86.91 MB  440513 rows

[... everything works until ...]

Processing object type SCHEMA_EXPORT/TABLE/TRIGGER
Processing object type SCHEMA_EXPORT/STATISTICS/MARKER
Processing object type SCHEMA_EXPORT/TABLE/POST_TABLE_ACTION
ORA-39083: Object type POST_TABLE_ACTION failed to create with error:
ORA-01435: user does not exist
Failing sql is:
BEGIN
 SYS.DBMS_SNAPSHOT_UTL.SYNC_UP_LOG('ORG_USR','TABLEA');
 END;
ORA-39083: Object type POST_TABLE_ACTION failed to create with error:
ORA-01435: user does not exist
Failing sql is:
BEGIN
 SYS.DBMS_SNAPSHOT_UTL.SYNC_UP_LOG('ORG_USR','TABLEB');
 END;
ORA-39083: Object type POST_TABLE_ACTION failed to create with error:
ORA-01435: user does not exist
Failing sql is:
BEGIN
 SYS.DBMS_SNAPSHOT_UTL.SYNC_UP_LOG('ORG_USR','TABLEC');
 END;
Processing object type SCHEMA_EXPORT/MATERIALIZED_VIEW
Processing object type SCHEMA_EXPORT/TABLE/MATERIALIZED_VIEW_LOG
Job "SYSTEM"."SYS_IMPORT_FULL_01" completed with 3 error(s) at Thu Aug 17 11:19:02 2017 elapsed 0 00:05:56

我确实指定了 REMAP_SCHEMAREMAP_TABLESPACE,导入运行大部分 正确。

但在最后部分尝试 Processing object type SCHEMA_EXPORT/TABLE/POST_TABLE_ACTION 它以某种方式使用旧用户失败。

谁能告诉我哪里出了问题以及如何解决?

解决方案是导入排除 post_table_action 并在将架构名称更改为正确值后手动执行语句:

impdp usr/pass \
    EXCLUDE=post_table_action \
    DIRECTORY=EXPDP \
    REMAP_SCHEMA=ORG_USR:NEW_USR \
    REMAP_TABLESPACE=ORG_TS:NEW_TS \
    DUMPFILE=FILE.dmp \
    PARALLEL=2 \
    LOGFILE=FILE.imp.log

BEGIN
SYS.DBMS_SNAPSHOT_UTL.SYNC_UP_LOG('ORG_USR','TABLEA');
END;
BEGIN
SYS.DBMS_SNAPSHOT_UTL.SYNC_UP_LOG('ORG_USR','TABLEB');
END;
BEGIN
SYS.DBMS_SNAPSHOT_UTL.SYNC_UP_LOG('ORG_USR','TABLEC');
END;