DBMS_MVIEW.REFRESH Fails With ORA-01031

Problem statement:

  • user_a owns a materialized view (mv_demo);
  • user_b wants to refresh the mv_demo mview in the user_a schema;
  • dbms_refresh fails with ORA-01031: insufficient privileges.


Example:

SQL> exec dbms_mview.refresh('user_a.mv_demo');
BEGIN dbms_mview.refresh('user_a.mv_demo'); END;

*
ERROR at line 1:
ORA-01031: insufficient privileges
ORA-06512: at "SYS.DBMS_SNAPSHOT", line 2254
ORA-06512: at "SYS.DBMS_SNAPSHOT", line 2460
ORA-06512: at "SYS.DBMS_SNAPSHOT", line 2429
ORA-06512: at line 1

 

Solution:

grant ALTER ANY MATERIALIZED VIEW to user_b.

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章