使用 Oracle 10 监视哪个语句更新(以及何时)某个表行
我正在使用(必须)设计糟糕的 Oracle(10) DB,我没有管理权限(尽管我可以在我的方案中创建表、触发器等)。
现在我遇到了一个问题:该数据库与多个用户/程序连接。 我必须找出谁更新了某一行、何时以及如果可能的话:使用什么样的语句。 是否可以?
提前致谢!
I'm using (have to) a badly designed Oracle(10) DB, for which I don't have admin rights (although I can create tables, triggers, etc in my scheme).
Now I had run into a problem: this DB connected with several users/programs. I must find out who updates a certain row, when, and if possible: with what kind of statement. Is it possible?
Thanks in advance!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果您拥有启用审核的管理员权限,那么执行此操作会更容易。 如果没有审计能力,您只能使用触发器来处理插入/更新/删除的日志记录。 在您的情况下,由于您只对更新感兴趣,因此您可以在表上放置一个触发器,以便在更新后触发,该触发器将更改的内容、由谁、从何处、到什么日期以及在哪一天记录到另一个表。
It would be easier to do this if you had admin rights to enable auditing. Without the power of auditing you are left with the use of triggers to handle the logging of inserts/updates/delete. In your case since you are interested in only update, you can put a trigger on the table to fire after the update which logs to another table what was changed, by whom, from where and to what and on what day.
我会为您正在使用的表创建一个日记表。 它将向您显示操作类型和 oracle 用户...以及一堆其他数据(如果您需要)。
I would create a journal table for the table you are working with. It will show you the operation type and the oracle user...as well as a bunch of other data if you need it.