oracle数据库中的日志插入/更新/删除 [英] log insertions/updates/deletions in oracle database

查看:230
本文介绍了oracle数据库中的日志插入/更新/删除的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

要理解应用程序,如果可以某种方式记录每个数据库更改,将非常有帮助.然后,您可以在前端执行操作,然后查看数据库中发生的情况. (我只关心最后的5分钟左右,但是更多不会受伤.)那有什么可能呢?

To understand an application it would be quite helpful if every database change could be logged somehow. Then you can execute an action on the frontend and see what happens in the database. (I only care about the last 5 minutes, or so, but more would not hurt.) What possibilities exist for that?

我知道可以配置JDBC驱动程序来记录执行的语句,但是它记录的日志多于我不希望看到的日志(例如,我不在乎查询),并且被混入您的日志文件中. :-/

I know it is possible to configure the JDBC driver to log the executed statements, but it logs rather more than I want to see (I don't care about queries, for instance) and is mixed wildly into your logfiles. :-/

我可以想到的另一件事是为每个表创建触发器,以将有关更改的数据写入日志记录表.有人设法做到这一点吗?尤其是创建一个脚本来为给定的一组表创建那些触发器的方法?

Another thing I can think of is to create triggers for each table that write data on the changes into a logging-table. Did anyone manage to do that? Especially creating a script that creates those triggers for a given set of tables?

推荐答案

使用触发器,您可以保留以前的数据(数据的历史记录).为什么不简单地将日志插入日志表中?

With the triggers you can just keep the previous data (a history of your data). why you don't simply insert your logs in a log table?

这篇关于oracle数据库中的日志插入/更新/删除的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆