基于非快刷新视图的快刷新物化视图

发布于 2024-12-05 10:42:26 字数 432 浏览 1 评论 0原文

我发现我可以拥有两个表,并根据这些连接的表创建提交时快速刷新 物化视图

然而,我想做的是基于以下内容进行提交时快速刷新物化视图:

(1)连接到的表
(2) 一个完全按需刷新物化视图,它本身是基于其他视图(即普通视图)的。

当我尝试这样做时,我收到错误 ORA-12053,该错误谈到 from 子句中的条目相互依赖,即使它们显然不存在依赖关系。

我可以通过将 (2) 替换为普通表来解决此问题,并且只需向该表中执行批量插入,而不是刷新物化视图。但是,如果没有必要,我宁愿不这样做。

我将尝试使用一个最小的示例来说明该错误,但是如果您能让我了解我想要做的事情是否可能(最好通过示例)或不可能,那就太好了。

I've found that I can have two tables and create a fast refresh on commit materialized view based on those tables joined.

What I would like to do however is to make a fast refresh on commit materialized view based on the following:

(1) A table JOINED TO
(2) A complete refresh on demand materialized view which itself is based on other views (ordinary views, that is).

When I try to this I get error ORA-12053, which talked about entries in the from clause having dependencies on each other, even when they clearly don't.

I can work around this by replacing (2) with an ordinary table, and just doing a bulk insert into this table instead of refreshing the materialized view. However, I'd rather not do this if not necessary.

I'll try to work on a minimal example that illustrates the error, but if you could give me an idea of whether what I want to do is possible (preferably by an example) or not possible that would be great.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

£噩梦荏苒 2024-12-12 10:42:26

请遵循以下事实来了解错误。

  1. Fast Refresh on Commit 物化视图按行刷新
    基于对基表所做的更改的行。
  2. Refresh Complete on Demand 物化视图的刷新方式为
    截断目标表并重新插入所有内容。
  3. 上层物化视图的刷新将不可能,因为
    oracle 无法跟踪表 2 上的更改(即刷新完成
    物化视图。)

Follow these facts to understand the error.

  1. The Fast Refresh on Commit materialized view is refreshed row by
    row based on changes made on base tables.
  2. The Refresh Complete on Demand materialized view is refreshed by
    truncate the destination table and reinsert everything.
  3. The refresh of the upper materialized view won't be possible because
    oracle can't track changes on table 2 (that is, the refresh complete
    materialized view.)
陌上芳菲 2024-12-12 10:42:26

嵌套物化视图存在限制。我在这篇博文中描述了它们。 ORA-12053 是不满足嵌套 MV 的第一个限制的结果。使底层 MV 更加复杂(连接、聚合或联合所有 MV)是一个解决方案。

问候,
抢。

There are restrictions on nested materialized views. I described them in this blogpost. The ORA-12053 is the result of not satisfying the first restriction of nested MV's. Making the underlying MV more complex (a join, aggregate or union all MV), is a solution.

Regards,
Rob.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文