I have enabled CDC using the following steps:
exec sys.sp_cdc_enable_db;
exec sys.sp_cdc_enable_table
@source_schema = N'dbo',
@source_name = N'table_name',
@role_name = N'CDC_Access',
@supports_net_changes = 1;
I can see that a CT table has been created in the System Tables; SQL Server Agent is on, and I can see the cdc.db_name_capture job has been created and is running.
However, even though the table_name table is being populated, I never see anything in the CT table. I have other tables that have CDC enabled for them in the same database which are being updated, and CDC is capturing data for them and storing it in the CT table created for that specific table.
Why would this one table not be capturing data even though other tables are?
I read online that perhaps it has something to do with the transaction log becoming too large, but I still have plenty of drive space left (~2TB free).
What can I do to debug this issue?
Thank you so much, in advance! :)
Edit 1
Here is the output of exec sys.sp_cdc_help_change_data_capture
. subscription_events is the table that I am having troubles with.
Edit 2
Here is the output of exec sys.sp_cdc_help_jobs;
.
Edit 3
Here is the output of select * from sys.dm_cdc_log_scan_sessions;
.
Here is the output of select * from sys.dm_cdc_errors;
Edit 4
Running select serverproperty('productversion')
provides the following version number: 11.0.3401.0
.
sys.sp_cdc_help_change_data_capture
? Is it okay? – Eatableexec sys.sp_cdc_change_data_capture
and I see my new table in there, alongside the other tables that are functioning properly. I'll add the output of that row as an edit to my question. – Habituateexec sp_cdc_help_jobs
– Eatablesys.dm_cdc_log_scan_sessions
,sys.dm_repl_traninfo
andsys.dm_cdc_errors
. Please check them too. Especially the first one with end_time of NULL. – Eatablesys.dm_cdc_log_scan_sessions
andsys.dm_cdc_errors
. Thesys.dm_repl_traninfo
table is huge, and I wasn't sure what information to look at. I've never used these tables before, so thank you for mentioning them to me; what am I looking for in here? – Habituateselect serverproperty('productversion')
). We might be witnessing a bug here. I think short term solution is to restart the capture job, but long term this may require installing a Cumulative Update. – Eatableselect serverproperty('productversion')
provides the following version number:11.0.3401.0
. – HabituateEXEC sp_repldone @xactid = NULL, @xact_segno = NULL, @numtrans = 0, @time = 0, @reset = 1; EXEC sp_replflush
; 3) close this query window in which you executed these commands; 4) start the capture job; 5) check the sys.dm_cdc_errors table for new rows and check if the changes starting to be visible. – Eatablecdc.dbo_subscription_events_CT
table! Thank you so much! :) So this is a known bug with SQL Server then? Also, if you add this as an answer, I will mark it as such. – Habituatesys.dm_cdc_errors
table is empty. – Habituate