DW: Some useful system views when checking Materialized View

1. dba_mview_refresh_times/user_mview_refresh_times

This view lists the master table, mv and the last refresh time. When mv are fast refresh mv, the mv log will be purged only when all the mvs are refreshed and those logs are no longer useful.

 

2. mv log naming format

The materialized view log actually is a table , we can find it in sys.obj$, the name format is MLOG$_<TABLE_NAME> , this name can be found in user_snapshot_logs view. in this table, dmltype is recorded as U, I and D. it also has a snapshot timestamp, I believe Oracle refreshes mv by comparing the last_refresh time with the sanpshot timestamp in this log, it picks rows with snapshot timestamp later then the last refresh time. 

 

3. mv log and internal trigger

oracle captures changes in the table by internal trigger, unforutnately, I'm not able to find the trigger and it's source. The only information I can find is DBA_INTERNAL_TRIGGERS view. according to the view source ,the trigflag in sys.tab$ table reveals the type of such trigger.

 

4. filter column when create mv log.

create table mytest (a number, b number,c number);

When we create mv log

CREATE MATERIALIZED VIEW LOG ON mytest
PCTFREE 0
PCTUSED 99
WITH ROWID(A,B);

 

Here we use ROWID(A,B), in the mv log MLOG$_MYTEST, we can see the A, B columns are included. This meaningful columns is useful in system like Oracle 11i in which most tables has no primary key but unique key.

 

 


 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值