带有重映射的Impdp在POST_TABLE_ACTION上仍然使用旧架构失败

时间:2017-08-17 09:59:31

标签: oracle schema remap impdp

我正在尝试在重新映射架构和表空间时导入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的最后部分,它在某种程度上无法使用OLD用户。

有人可以告诉我出了什么问题以及如何解决它?

1 个答案:

答案 0 :(得分:1)

要导入排除post_table_action并且在将schemaname更改为正确值后手动执行语句:

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;