oracle中跟踪数据变化的最佳方式

作为我正在谈论的标题,在 oracle 中跟踪数据更改的最佳方法是什么?我只想知道哪一行被更新/删除/插入?

as the title i am talking about, what's the best way to track data changes in oracle? i just want to know which row being updated/deleted/inserted?

一开始我想到了触发器,但是我需要在每个表上写更多的触发器,然后把影响到我的更改表的rowid记录下来,这不好,然后我在谷歌搜索,学习关于物化视图的新概念记录和更改数据捕获,

at first i think about the trigger, but i need to write more triggers on each table and then record down the rowid which effected into my change table, it's not good, then i search in Google, learn new concepts about materialized view log and change data capture,

物化视图日志对我有好处,我可以将它与原始表进行比较,然后我可以获得不同的记录,甚至不同的字段,我认为方法与我从原始表创建/复制新表相同(但我不知道有什么不同?);

materialized view log is good for me that i can compare it to original table then i can get the different records, even the different of the fields, i think the way is the same with i create/copy new table from original (but i don't know what's different?);

更改数据捕获组件对我来说很复杂:),所以我不想浪费时间研究它.

change data capture component is complicate for me :), so i don't want to waste my time to research it.

任何人都拥有在 oracle 中跟踪数据变化的最佳方法的经验?

anybody has the experience the best way to track data changes in oracle?

推荐答案

您需要查看 审计 声明.它收集 SYS.AUD$ 表中的所有审计记录.

You'll want to have a look at the AUDIT statement. It gathers all auditing records in the SYS.AUD$ table.

示例:

AUDIT insert, update, delete ON t BY ACCESS

问候,
罗布.

相关文章