Is it possible to detect which table is what data changed in oracle materialized view using trigger?
I have a materialized view and I want to detect:
- when materialized view is updated
- which table(s)'s
- what data's 开发者_运维知识库(or row) changed?
If you are using a MV log there should already be a trigger on the base table(s) and the triggers an populating the material view log (actually its a table) This would assume that you are doing fast refreshes instead of complete refreshes. Check the following tables to see if they contain the information that you are looking for:
select trigger_name from user_triggers
where table_name = '<you table name>'
SELECT master, log_table, rowids, primary_key
FROM user_snapshot_logs;
desc mlog$_<your table name>
desc rupd$_<your table name>
The mlog$_... and rupd$... name may get truncated in case the base table's name is too long. Hope that helps you.
精彩评论