客户端使用的数据库历史 [英] Database history for client usage

查看:109
本文介绍了客户端使用的数据库历史的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图找出在数据库上拥有历史记录的最佳方法,以跟踪已完成的插入/删除/更新。历史数据将需要编码到前端,因为它将被用户使用。创建历史表(用于存储历史记录的每个表的副本)不是一个很好的方法,因为数据分布在多个表中。



在这个时候,我最好的想法是创建一些历史表,这些表将反映我想向用户显示的输出。每当对特定表进行更改时,我将更新此历史记录表与数据。



我试图找出最好的方法将会。任何建议将不胜感激。



我正在使用Oracle + VB.NET

解决方案>

我已经非常成功地使用了一个模型,其中每个表都有一个审核副本 - 同一个表,其中包含几个附加字段(时间戳,用户ID,操作类型)和第一个表上的3个触发器,用于插入/更新/删除。

我认为这是一个非常好的处理方法,因为表和触发器可以从模型生成,并且从管理角度来看,开销很小。
应用程序可以使用表格向用户显示审核历史记录(只读)。


I'm trying to figure out what would be the best way to have a history on a database, to track any Insert/Delete/Update that is done. The history data will need to be coded into the front-end since it will be used by the users. Creating "history tables" (a copy of each table used to store history) is not a good way to do this, since the data is spread across multiple tables.

At this point in time, my best idea is to create a few History tables, which the tables would reflect the output I want to show to the users. Whenever a change is made to specific tables, I would update this history table with the data as well.

I'm trying to figure out what the best way to go about would be. Any suggestions will be appreciated.

I am using Oracle + VB.NET

解决方案

I have used very successfully a model where every table has an audit copy - the same table with a few additional fields (time stamp, user id, operation type), and 3 triggers on the first table for insert/update/delete.
I think this is a very good way of handling this, because tables and triggers can be generated from a model and there is little overhead from a management perspective. The application can use the tables to show an audit history to the user (read-only).

这篇关于客户端使用的数据库历史的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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