After enabling CDC in SQL Server (see: http://mahadevanrv.blogspot.in/2011/05/change-data-capture-in-sql-server.html). We can modify the retention period and the number of transactions that to be handled in Change Data Capture table.
Before configureing one should understand the basic terms in CDC Configuration:
Execute the below query to get the CDC configured values:
Execute the below query to change capture instances:
EXEC sys.sp_cdc_change_job @job_type = 'capture'
,@maxtrans = 501
,@maxscans = 10
,@continuous = 1
,@pollinginterval = 5
Execute the below query to change retention period:
EXEC sys.sp_cdc_change_job @job_type = 'cleanup'
,@retention = 4320 -- Number of minutes to retain (72 hours)
,@threshold = 5000
Using this method we can use CDC hold the required period of historical data, i.e., for last 1 month, last 1 year or last 10 days, etc.
you mentiond above that @threshold = 5000. what does that mean and what is default value.
ReplyDeleteWhat difference it makes if you change from default to something different number like 5000.
Thanks