物化视图 - 识别上次刷新
我目前访问了一系列视图和具体化视图。物化由第三方维护,该第三方几乎不提供有关物化频率和成功的信息。最近,物化视图无法刷新,我已经发送了许多报告,其中包含不正确/延迟的数据。
目前,我正在查询我打算用来确定事务系统内最新更新何时发生的每个物化,如果尚未刷新,则其余代码不会执行,但是这会浪费很多精力,有时会导致错误的假设(物化视图可能已刷新,但没有进行其他事务 - 因此代码的其余部分不会执行),我更喜欢另一种方法。
有没有办法识别物化视图是否已使用Oracle系统表刷新?如果没有,有谁知道我如何在无需联系第三方的情况下做到这一点?
I presently access a series of views and materialized views. The materialized are maintained by a third party who offers little information regarding the frequency and success of the materialization. Of late the materialized views have failed to refresh and I have sent out numerous reports with incorrect/delayed data contained within.
At present I am querying each materialized I intend to use to establish when the latest update occurred within the transactional system, if it has not been refreshed then the rest of the code does not execute, however this a lot of wasted effort and can sometimes lead to an incorrect assumption (the materialized view may have been refreshed, but there were no additional transactions made - therefore the remainder of the code does not execute) and I would prefer another method.
Is there a way to identify whether a materialized view has been refreshed using an Oracle system table? If not, does anyone have any ideas how I would do this without having to contact the third party?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
看起来 doc_180 已经在评论中回答了这个问题,我不确定为什么它没有被添加为答案
如果您有权访问 DBA 表,您可以用
DBA_MVIEWS
替换ALL_MVIEWS
。这将使您能够访问有关每个物化视图何时刷新的信息,而不仅仅是您有权访问的物化视图的子集。当然,在这种情况下,这可能不是特别重要的区别。It looks like doc_180 already answered this in the comments, I'm not sure why it didn't get added as the answer
If you have access to the DBA tables, you could substitute
DBA_MVIEWS
forALL_MVIEWS
. That would allow you to get access to information about when every materialized view was refreshed rather than just the subset of materialized views that you have access to. Of course, that's probably not a difference that is particularly important in this case.不幸的是,oracle 默认日期格式是 YYYY-MM-DD。如果你需要时间
只需使用这样的东西:
Unfortunately oracles default date format is YYYY-MM-DD. If you need the time
just use something like this:
我个人使用 all_snapshots,此信息是 DBA_MVIEWS 或 ALL_MVIEWS 信息的补充
Personally i use the all_snapshots, and this information is complementary to the information of the DBA_MVIEWS or ALL_MVIEWS