比较审计跟踪的值

发布于 2024-09-01 01:36:00 字数 570 浏览 5 评论 0原文

我正在尝试为用 PLSQL/PHP 编写的现有数据库开发审计跟踪/跟踪解决方案 - 但是我仍然不确定是否有一个简单(易于实现和维护)的解决方案来跟踪字段/值的更改。例如,DB APP 的项目跟踪部分跟踪超过 200 个字段,理想情况下,我想要一种很好的方式来显示更改历史记录,例如:

5/10/2010 - Project 435232 updated by John Doe
Changed Project Name (Old: Test Project; New: Super Test Project)
Changed Submission Date (Old: 5/10/2010; New: 5/11/2010)
Changed Description (Old: This is an example!; New: This is a test example)

本质上,对于每个字段(数据库列),它将输出一个新行来显示旧/新值。到目前为止,我当前的想法是将数据的当前版本保存到临时表中,用新数据更新主表,然后将每一行加载到数组中并进行数组比较以确定差异。这看起来有点复杂,如果有更简单的方法我很想知道。

非常感谢任何想法或建议!

I'm attempting to develop an audit trail/tracking solution for an existing database written in PLSQL/PHP - however I'm still unsure as of yet on an easy (to implement and maintain) solution for tracking changes to fields/values. For instance, the project tracking portion of the DB APP tracks over 200 fields and ideally I'd like a nice way to show a history of changes, such as:

5/10/2010 - Project 435232 updated by John Doe
Changed Project Name (Old: Test Project; New: Super Test Project)
Changed Submission Date (Old: 5/10/2010; New: 5/11/2010)
Changed Description (Old: This is an example!; New: This is a test example)

Essentially for each field (db column) it would output a new line to show the old/new values. So far my current idea is saving the current version of the data to a temporary table, updating the primary table with the new data then loading each row into an array and doing an array compare to determine the differences. This seems a bit convoluted, and if there is an easier method I'd love to know it.

Any ideas or suggestions are much appreciated!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

樱娆 2024-09-08 01:36:00

您提出的是一个非常糟糕的 - 但非常普遍提出的 - 实现,原因我在 这个最近的 SO 线程

What you propose is a very bad - yet very commonly proposed - implementation, for the reasons I list in this other recent SO thread.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文