DB Audit Trail 的最佳实现是什么? [英] What is the best implementation for DB Audit Trail?

查看:42
本文介绍了DB Audit Trail 的最佳实现是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

数据库审计跟踪记录用户上次修改、修改日期和创建日期.

有几种可能的实现方式:

  • SQL Server 触发器
  • 向数据库添加 UserModified、ModifiedDate、CreatedDate 列,并相应地在存储过程或插入、更新语句中包含逻辑.

如果您在答案中包含实现(或链接到),那就太好了.

解决方案

根据您在做什么,您可能希望将审计从数据层移到数据访问层.它为您提供更多控制权.

我在 NHibernate 和 SqlServer 这里问了一个类似的问题.>

A DB Audit Trail captures the User Last Modified, Modified Date, and Created Date.

There are several possible implementations:

  • SQL Server Triggers
  • Add UserModified, ModifiedDate, CreatedDate columns to the database and include logic in Stored Procedures or Insert, Update statements accordingly.

It would be nice if you include implementation (or link to) in your answer.

解决方案

Depending on what you're doing, you might want to move the audit out of the data layer into the data access layer. It give you more control.

I asked a similar question wrt NHibernate and SqlServer here.

这篇关于DB Audit Trail 的最佳实现是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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