物化视图上的快速刷新给出错误

问题描述 投票:0回答:1

我在Schema1中创建了一个MV,其主表存在于Schema2中。 Schema1和Schema2都在同一个DB上。

MV创建工作正常,但是当执行MV的快速刷新时,我得到以下错误:

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 -

如果我尝试使用完全刷新刷新它,如下所示:

begin
  DBMS_MVIEW.refresh('MV_NAME','C');
end;

刷新工作正常,但我不想这样做,因为它是一个性能影响。

用Google搜索并发现以下内容但没有任何效果:

  1. 在主表(Schema2)上向MV所有者(Schema1)提供显式授权:这是否但刷新失败。
  2. 丢弃MV并重新创建,(这样,MV第一次正确刷新,但是当再次运行相同的作业时,弹出相同的错误)。
  3. 检查所有同义词是否正常工作。

我没有找到任何下面的对象:SNAP$_<mview_name>, MVIEW$_<mview_name>, <mowner>.<master>@<dblink>, <mowner>.MLOG$_<master>@<dblink>对象

请告知其他可以检查的内容。

oracle oracle11g
1个回答
0
投票

在对此进行一些研究之后,能够找出刷新不起作用的原因。在这里发布,以便它也有助于其他人。所以它是这样的:当创建MV时,我也在其他模式(Schema2)中创建了MV日志。当快速刷新发生时,它指的是MV日志表,而Schema1无法访问Schema2 MV日志表,这就是错误即将发生的原因。

解决方案:授予Schema1对架构2中存在的MV日志表的选择权限。

谢谢

© www.soinside.com 2019 - 2024. All rights reserved.