跟踪 Oracle 中物化视图的更改

发布于 2024-09-16 20:27:04 字数 103 浏览 3 评论 0原文

跟踪 Oracle 中物化视图更改的最佳方法是什么?我知道,触发器是可用的,并且 CDC 似乎不适用于物化视图。有什么巧妙的解决办法吗?

感谢您的帮助

约翰内斯

what is the best way to track changes of a materialized views in Oracle. I know, that triggers are available and CDC does not seem to work with materialized views. Are there any clever solutions?

Thanks for your help

Johannes

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

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

发布评论

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

评论(2

明月夜 2024-09-23 20:27:04

您可以查询 MV 日志本身(如果存在):

http://www.sqlsnippets。 com/en/topic-12878.html

You could probably query the MV log itself, if present:

http://www.sqlsnippets.com/en/topic-12878.html

醉殇 2024-09-23 20:27:04

我假设您正在谈论识别增量刷新的物化视图中发生的更改。如果 MV 与基础表位于同一数据库中,您可以在存储 sysdate 或 systimestamp 值的结果集中定义一个额外的列,例如 LAST_UPDATED。如果 MV 位于不同的数据库中,您就会遇到问题。

实际上,我刚刚收到来自 Oracle 的补丁,该补丁修复了一个错误,允许将 ROWSCN(以及 ROWSCN 时间戳)持久保存到远程 MV 中,因此这应该是分布式 MV 的一个选项。 rowscn 时间戳存在 +/- 3 秒的模糊性,因此如果您需要更高的精度,您可以考虑滚动自己的解决方案。

I assume you are talking about identifying the changes that happen in incrementally-refreshed materialized views. If the MV is in the same database as the underlying tables you can define an extra column, say LAST_UPDATED, in the result set that stores the value of sysdate or systimestamp. If the MV is in a different database you'll have a problem.

I actually just received a patch from Oracle that fixes a bug to allow persisting ROWSCN (and therefore the ROWSCN timestamp) into the remote MV, so this should be an option for distributed MV's. There's a fuzziness of +/- 3 seconds in rowscn timestamps so if you need greater precision you're looking at rolling your own solution.

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