oracle materialized view 不刷新,关于materialized view的数据更新性能

谢谢!

我自己也看了一下,materialized view log里面应该纪录了一些DML信息,force(incremental)应该是依据这些信息决定哪些纪录需要refresh,然后从基表检索更新所涉及的纪录。(你说的merge into好像跟incremental差不多抽象哦

5f60efcaccfa40b26873a6a9cb266119.gif)

另外on demand 和 query rewrite 互斥的说法我没有找到出处,请明示。

oracle文档种关于query rewrite的restrictions说法:

You should keep in mind the following restrictions:

The defining query of the materialized view cannot contain any non-repeatable expressions (ROWNUM, SYSDATE, non-repeatable PL/SQL functions, and so on).

The query cannot contain any references to RAW or LONG RAW datatypes or object REFs.

If the defining query of the materialized view contains set operators (UNION, MINUS, and so on), rewrite will use them for full text match rewrite only.

If the materialized view was registered as PREBUILT, the precision of the columns must agree with the precision of the corresponding SELECT expressions unless overridden by the WITH REDUCED PRECISION clause.

If the materialized view contains the same table more than once, it is possible to do a general rewrite, provided the query has the same aliases for the duplicate tables as the materialized view.

General Query Rewrite Restrictions

You should keep in mind the following restrictions:

If a query has both local and remote tables, only local tables will be considered for potential rewrite.

Neither the detail tables nor the materialized view can be owned by SYS.

SELECT and GROUP BY lists, if present, must be the same in the query of the materialized view.

Aggregate functions must occur only as the outermost part of the expression. That is, aggregates such as AVG(AVG(x)) or AVG(x)+ AVG(x) are not allowed.

CONNECT BY clauses are not allowed.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Oracle中,DBLINK(Database Link)是一种用于在不同数据库之间建立连接的对象。使用DBLINK,可以在一个数据库中访问另一个数据库中的表和视图。创建一个DBLINK非常简单,只需要使用CREATE DATABASE LINK语句即可。例如:create public database link dblink1 connect to db1 identified by "123*456" using 'db11' [2。 在使用DBLINK时,可以通过创建物化视图(Materialized View)来将远程数据库中的数据存储在本地数据库中,并创建相应的视图来访问这些数据。物化视图是一种预先计算的视图,它可以提高查询性能。通过使用DBLINK和物化视图,可以实现跨数据库的数据访问和查询优化。 要在Oracle中创建DBLINK和相关的视图,可以按照以下步骤进行操作: 1. 在PL/SQL工具中执行SQL语句创建DBLINK,确保DBLINK成功创建,并且可以在相关文件夹中找到已创建的链接。 2. 根据需要,可以使用CREATE MATERIALIZED VIEW语句创建物化视图。在创建物化视图时,可以指定DBLINK来引用远程数据库中的数据。 3. 创建相关的视图来访问物化视图中的数据。可以根据需要在本地数据库中创建视图,以便使用方便。 需要注意的是,在更新物化视图时,可能会遇到物化视图被锁定导致更新失败的情况。可以通过查询数据库相关的锁定信息来查找锁定物化视图的原因,并采取相应的措施解决锁定问题。 总之,通过使用DBLINK和物化视图,可以在Oracle中实现跨数据库的数据访问和查询优化,同时可以创建相关的视图来方便地访问和管理这些数据。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* *3* [【Oracle数据库使用DBLINK创建快照视图实现数据定时同步】](https://blog.csdn.net/qq_42563173/article/details/123597390)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"] - *2* [Oracle事例](https://download.csdn.net/download/C_chenshenghui/235319)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"] [ .reference_list ]

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值