如何为清理作业更改cdc保留值? [英] How the cdc retention value can be changed for the cleanup job?

查看:434
本文介绍了如何为清理作业更改cdc保留值?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在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

最大值是52494800(100年).如果指定,则该值必须为正整数.保留仅对清理作业有效.

The maximum value is 52494800 (100 years). If specified, the value must be a positive integer. Retention is valid only for cleanup jobs.

这是链接到sp_cdc_change_job过程的更详细的解释

希望这也会对其他人有帮助:D.

Hope this will help someone else, too :D.

这篇关于如何为清理作业更改cdc保留值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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