Reputation: 453
I have one MV created in Schema1 whose master table are present in Schema2. Both Schema1 and Schema2 are on the same DB.
The MV creation works fine, however when Fast refresh of the MV is performed, I get the below error:
begin
DBMS_MVIEW.refresh('MV_NAME','F');
end;
Error report -
ORA-12008: error in materialized view refresh path
ORA-00942: table or view does not exist
ORA-06512: at "SYS.DBMS_SNAPSHOT", line 2809
ORA-06512: at "SYS.DBMS_SNAPSHOT", line 3025
ORA-06512: at "SYS.DBMS_SNAPSHOT", line 2994
ORA-06512: at line 2
12008. 00000 - "error in materialized view refresh path"
*Cause: Table SNAP$_<mview_name> reads rows from the view
MVIEW$_<mview_name>, which is a view on the master table
(the master may be at a remote site). Any
error in this path will cause this error at refresh time.
For fast refreshes, the table <master_owner>.MLOG$_<master>
is also referenced.
*Action: Examine the other messages on the stack to find the problem.
See if the objects SNAP$_<mview_name>, MVIEW$_<mview_name>,
<mowner>.<master>@<dblink>, <mowner>.MLOG$_<master>@<dblink>
still exist.
Error starting at line : 1 in command -
If I try to refresh it using Complete refresh as in :
begin
DBMS_MVIEW.refresh('MV_NAME','C');
end;
The refresh works fine, but I don't want to do this, because it is a performance hit.
Googled around this and found the following but nothing is working:
I did not find any of the below objects:SNAP$_<mview_name>, MVIEW$_<mview_name>,
<mowner>.<master>@<dblink>, <mowner>.MLOG$_<master>@<dblink>
the objects
Please advice what else can be checked in this.
Upvotes: 0
Views: 3374
Reputation: 1
Also consider adding the privilege 'Flashback Any Table'. That helped me after I received this error.
Upvotes: 0
Reputation: 453
After doing some research on this, was able to figure out the reason why the refresh was not working. Posting it here so that its helpful for others also. So it goes like this: When the MV was created, I had created the MV logs as well in the other schema (Schema2). When the fast refresh was happening, it was referring to the MV logs table and Schema1 does not have access to the Schema2 MV logs table, that is why the error was coming.
solution: Granted Schema1 select privilege on the MV logs tables present in schema 2.
Thanks
Upvotes: 2