首页 > 代码库 > impdp 导入物化视图(mv)时报错 :ORA-31685: Object type MATERIALIZED_VIEW

impdp 导入物化视图(mv)时报错 :ORA-31685: Object type MATERIALIZED_VIEW

本文为原创文章,转载请注明出处: http://blog.csdn.net/msdnchina/article/details/38782657

impdp 导入物化视图(mv)时报错 :ORA-31685: Object type MATERIALIZED_VIEW

db 版本为10.2.0.4
impdp 命令为
impdp sys/as dumpfile=scott.dmp logfile=scott_imp_no_remap.log

导入的报错为:
Processing object type SCHEMA_EXPORT/MATERIALIZED_VIEW
ORA-31685: Object type MATERIALIZED_VIEW:"SCOTT"."LEITEST0719" failed due to insufficient privileges. Failing sql is:
CREATE MATERIALIZED VIEW "SCOTT"."LEITEST0719" USING ("LEITEST0719", (8, 'FS', 1, 0, 0, "SCOTT", "LEITEST0719", '2013-07-24 17:21:42', 0, 52219, '1950-01-01 12:00:00', '', 0, 8912636, 0, NULL, (1, "OBJECT_ID", "OBJECT_ID", 0, 321, 0)), 2097249, 8, ('1950-01-01 12:00:00', 4, 0, 0, 8912636, 0, 0, 1, NULL, NULL), '@BBB') REFRESH FAST WITH PRIMARY KEY AS SELECT "LEITEST0719"."OWNER" "OWNER","
Processing object type SCHEMA_EXPORT/TABLE/MATERIALIZED_VIEW_LOG

处理方法为:

1.首先建立scott用户:create user scott identified by aaaaaa;
2.赋予scott用户建立mv的权限:grant create MATERIALIZED_VIEW to scott;
3.重新执行impdp即可:impdp sys/as dumpfile=scott.dmp logfile=scott_imp_no_remap.log

impdp 导入物化视图(mv)时报错 :ORA-31685: Object type MATERIALIZED_VIEW