物化视图快速刷新报 ORA-12008 & ORA-01031
用户A创建了物化视图,物化视图里边引用了用户B的表,现在用户C执行exec dbms_mview.refresh('MV_pi_to_res_lhr', 'F');报错:
ORA-12008: error in materialized view refresh path
ORA-01031: insufficient privileges
ORA-06512: at "SYS.DBMS_SNAPSHOT", line 2255
ORA-06512: at "SYS.DBMS_SNAPSHOT", line 2461
ORA-06512: at "SYS.DBMS_SNAPSHOT", line 2430
ORA-06512: at line 1
解决:
GRANT CREATE MATERIALIZED VIEW TO USER_NAME;
grant GLOBAL QUERY REWRITE, ON COMMIT REFRESH, ALTER ANY MATERIALIZED VIEW to USER_NAME;
grant flashback on 基表 to USER_NAME; --需要将基表的所有权限赋权给创建物化视图的用户
grant flashback on 物化视图日志表 to USER_NAME;
&
时间: 2024-10-23 20:06:28