I have a materalized view I've been using for quite awhile now where I perform a fast refresh every night prior to another job. The PROC gets called through an automated system (Active Batch), and contains the following refresh:
DBMS_MVIEW.REFRESH(LIST=>'GLMV_TAX_CODE_HIST',PARALLELISM => 8);
A few weeks ago, I randomly began getting this error:
Exit Code Description: ORA-12008: error in materialized view refresh path
ORA-01031: insufficient privileges
ORA-06512: at "SYS.DBMS_SNAPSHOT", line 2566
ORA-06512: at "SYS.DBMS_SNAPSHOT", line 2779
ORA-06512: at "SYS.DBMS_SNAPSHOT", line 2748
After a bit of research, figured it was simply a matter of granting permissions based on my findings, so ran the following, which appeared to work:
GRANT SELECT ON MLOG$_TAX_CODE_HIST TO MYUSER;
GRANT CREATE ANY materialized view to MYUSER;
GRANT ALTER ANY MATERIALIZED VIEW TO MYUSER;
Grant ALTER ANY SNAPSHOT to MYUSER;
Grant create session, alter any materialized view to MYUSER;
Figured it might have been an issue with the user I was calling the PROC from, but even after changing it to the creator of the Mview and such, still getting the same error.... Now the strange part is, if I login via client app (Toad) and I run the refresh manually as the same user, it works fine, no errors, but then as soon as I try to call it via "Active Batch" workflow automation, it happens again.... Anyone have any idea what I'm missing here?