日志传送 - 忽略特定表上的删除
我有一个场景,我有一个数据库,其中一个表可以获取大量插入,并且对于这些插入来说性能出色至关重要。
我还有很多报告,其中一些已放在桌子上。
因此,我想创建一个报告数据库,它可以稍微滞后于主数据库,我可以使用它来运行查询,这样报告就不会影响主表的性能。
绝对的大小也是一个问题 - 我想保留报告的所有历史记录,但交易表只需要最后一两天,顶部。
我正在考虑日志传送 - 它可以让我轻松复制系统中的所有表,这样我就可以轻松保持同步 - 但我希望能够从主表中删除“额外”记录以确保它保持不变活泼,但将它们留在报告数据库中。
有没有办法为特定表配置日志传送以不传送删除请求?如果没有,有人对此有一个很好的建议(除了“编写每天运行的脚本”之外)?
I've got a scenario where I have a database with one table that gets tons of inserts, and it's vital that the performance is excellent for those inserts.
I also have a lot of reports, some of which hit that table.
Thus, I want to create a reporting database, which can lag the primary database a little, that I can use for running queries, so the reports don't impact the performance of the primary table.
Sheer size is also a concern - I want to keep all the history for the reports, but the transaction table only needs the last day or two, tops.
I was considering log shipping - it'll let me easily replicate all the tables in the system, so I can keep things in sync easily - but I want to be able to delete the "extra" records from the primary table to ensure it stays snappy, yet leave them in the reporting database.
Is there any way to configure log shipping for a specific table to not ship delete requests? If not, anyone have a nice suggestion for this (other than "write a script that runs every day")?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
没有。日志传送旨在复制整个数据库。在删除表的同时,无法使用日志传送来保留表的整个历史记录 - 您必须编写一些自定义的内容。
Nope. Log shipping is designing to replicate the entire database. There's no way to use log shipping to keep the entire history of your table while deleting it out - you're going to have to write something custom.