数据库建模:查找数据在给定日期和时间下的样子
如果我有 table1、table2、table3..table50 存储有关产品的不同信息,那么
跟踪增量更改的有效方法是什么,如果我想返回并拉取该特定产品在给定中的外观日期,它会非常快速和准确。 我希望以一种可以快速检索并减少太多冗余的方式跟踪更改。
if i have table1, table2, table3..table50 that stores different information about a product
what would be the efficient way to keeping track of incremental changes in a way that if i want to go back and pull how that particular product looked in a give date, it would be very fast and accurate.
i would want to track changes in a way that it can be retrieved very fast and also reduce too many redundancy.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
1.如果您使用的是 Oracle 11g,则 Oracle 闪回技术可以让您执行此操作。
http://download.oracle.com/docs/cd/B28359_01/appdev.111/b28424/adfns_flashback.htm#BJFGJHCJ。
2.在旧版本中,您可以使用DBMS_WM包并为您需要的表启用版本控制。但是,您可以启用版本控制的表类型存在某些限制。
http://download.oracle.com/docs /cd/B10501_01/appdev.920/a96628/long_ref.htm#80312
3.到目前为止我见过的其他实现都有自己的一些DBMS_WM程序版本。基本上,有一个类似的结构。
最后两列用于查看记录在数据库中“逻辑活动”的时间段。该实现是使用触发器完成的,其中
“使当前行过期(更新)+
插入新行”
转换为“使当前
请
如果您只想跟踪某些列的更改(例如,假设您只关心部门和薪资变化),最后一种方法可能会解决您的目的。
不要选择类似的模型(
不要
将每列更改存储为单独的行)http://asktom.oracle.com/pls/apex/f?p=100:11:0::::P11_QUESTION_ID:1769392200346820632
1.If you are on Oracle 11g, Oracle Flashback technology is the feature that lets you do this.
http://download.oracle.com/docs/cd/B28359_01/appdev.111/b28424/adfns_flashback.htm#BJFGJHCJ.
2.In older versions, you can use the DBMS_WM package and enable versioning for the tables that you need. However, there are certain restrictions on the kinds of tables you can enable versioning for.
http://download.oracle.com/docs/cd/B10501_01/appdev.920/a96628/long_ref.htm#80312
3.The other implementations I have seen so far have their own version of some procedures of DBMS_WM. Basically, have a structure like..
Where the final two columns are used to see for what time period a record was "logically active" in the Database. The implementation is done using triggers where
"Expire the Current Row(update)+
Insert a New Row"
Converted to "Expire the Current
row"
The last approach might solve your purpose if you only want to track changes to some columns (eg. Let's say only dept and salary changes are all you care about).
Please do not choose a model like this. (
Do not
Store each column change as a separate row)http://asktom.oracle.com/pls/apex/f?p=100:11:0::::P11_QUESTION_ID:1769392200346820632