oracle - 物化 View 的部分刷新

标签 oracle refresh partial materialized-views

我们有一张 table TB_1它具有按月和周列划分的月度和周数据。我们也有物化 View MV_1继承自表TB_1 .

我们希望每周或每月刷新实体化 View 。

不确定我们如何从物化日志中捕获的所有更改中过滤出每周或每月的更改以进行部分刷新。

现在我们正在考虑在 TB_1 中有一个标志列.通过清除物化日志和更新标志,我们认为我们可以实现这一点。

有没有比根据特定标准进行部分刷新的过程更有效的方法?

最佳答案

我们这里有一个类似的案例:我们找到的解决方案是 partition the materialized view逐月(使用 PCT )。如果您在许可中将此作为一个选项,这可能是一个解决方案。然后您必须对“详细信息表”进行分区,TB_1 ,可能还有 MV_1 的“详细信息表” .

execute dbms_mview.refresh( 
   list => 'your_partitioned_mview'
 , method => 'P'                -- this is where PCT is specified
 , atomic_refresh => false 
);

Is it possible to partially refresh a materialized view in Oracle?上还有其他解决方案.

编辑:

我会说使用“待刷新”标志进行快速刷新的解决方案值得尝试。不确定您是否需要事先清除 Mview 日志。只需更改要更新的记录的标志值即可。这是一个 nice howto我发现。

如果您有 Oracle 12.2, they introduced real-time Mviews ,这可能是您正在寻找的...

Oracle 12.2 introduced the concept of real-time materialized views, which allow a statement-level wind-forward of a stale materialised view, making the data appear fresh to the statement. This wind-forward is based on changes computed using materialized view logs, similar to a conventional fast refresh, but the operation only affect the current statement. The changes are not persisted in the materialized view, so a conventional refresh is still required at some point.



realtime mview concept

@use416,请让我们发布实际适用于您的案例的信息。

关于oracle - 物化 View 的部分刷新,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51654064/

相关文章:

sql - 当存储为 BINARY XML 时,Oracle XMLType 有多大

javascript - 更新变量时动态刷新模板的一部分golang

javascript - 无法触发仅一部分 javascript 的刷新

http - 206 部分未缓存

java - 从 Wildfly 数据源重新启动后重新连接到 oracle db

oracle - PLSQL_V2_COMPATIBILITY 兼容性

entity-framework - Entity Framework 查询仅返回部分对象图

javascript - Javascript 过程是部分的还是全部的?

oracle - AUTONOMOUS_TRANSACTION : pros and cons

php - 如何在页面刷新后保持单选按钮处于选中状态?