简体   繁体   中英

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM