1

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

谢谢你的帮助

约翰内斯

4

2 回答 2

0

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.

于 2010-08-31T14:02:01.953 回答
0

如果存在,您可能可以查询 MV 日志本身:

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

于 2010-08-31T14:06:42.770 回答