Similar problem
Colin McLennan, November 17, 2006 - 7:54 am UTC
Tom,
The above was very interesting as I am having a similar problem on Oracle 10.2.0.1.0 but the error message is different from that in your example.
I have a user (User1) that owns a package (Package1) and I am trying to get this user to refresh a materialised view owned by another user (User2) by calling DBMS_MVIEW.REFRESH from Package1. The materialised view calls functions from a package (package2) owned by User2
I have granted explicit access to all of the elements to User1 including EXECUTE ANY PROCEDURE but continue to get the following error.
ERROR at line 1:
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 "USER1.PACKAGE1", line 308
ORA-06512: at line 1
Package1 contains another procedure used to analyse tables and I can get this to run as User1 no problem.
I am starting to loose the will to live. Can you breathe new life into me and point me towards a solution.
Thanks in advance.
Colin.
November 17, 2006 - 8:18 am UTC
turn on sql_trace and see if you can see what sql statement is failing, that'll help.
else set up a script that creates usera, userb, creates the tables, creates the minimum code - eg: reproduces the issue, so we can look at it in isolation with the smallest bit of code around it.
(eg: something I can run on my computer, complete, concise)
Alter Any Materialized View
Colin McLennan, November 17, 2006 - 10:59 am UTC
Tom,
The trace file was of little help as it was showing the error as being against the V$PARAMETER table.
However, I now have the package working. The solution was to grant ALTER ANY MATERIALIZED VIEW directly to the user rather than through a role.
Thanks for your help.
Colin.
ALTER ANY MATERIALIZED VIEW
fabian wiktorowski, October 29, 2009 - 3:55 am UTC
so when you want to refresh mview in other schema there is no grant ALTER MATERIALIZED VIEW schema.mv_name but only ALTER ANY MATERIALIZED VIEW, which let refresh (and change storage and so on) to ANY mview in system. I've lost something or there is really no grant which let refresh exactly one mview in other schema (which seems to be more secure)?