问题描述
我正在asp.net mvc2应用程序上实现日志记录功能,该应用程序使用SqlServer2008作为数据库,并使用Entity Framework作为数据模型.
I'm implementing a logging feature on a asp.net mvc2 application, that uses SqlServer2008 as a database and Entity Framework as a data model.
我启用了SqlServer的CDC功能,并且其日志记录发生了变化,但是我只是注意到一些旧的日志记录数据已被删除.
I enabled CDC feature of SqlServer and it's logging changes well, but I just noticed that some of the old logging data is erased.
有人知道CDC的默认期限是什么,并且有人知道如何将其设置为不确定的值.
Does anyone know what's default period CDC keeps records, and does anyone know how could I set it to indefinite value.
推荐答案
我刚刚发现默认保留值为4320分钟= 72小时= 3天.
I just discovered that the default retention value is 4320 minutes = 72 hours = 3 days.
应该可以通过使用
sp_cdc_change_job @job_type='cleanup', @retention=minutes
这是链接到sp_cdc_change_job过程的更详细的解释
希望这也会对其他人有帮助:D.
Hope this will help someone else, too :D.
这篇关于如何为清理作业更改cdc保留值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!