CDC is enabled, but cdc.dbo<table-name>_CT table is not being populated

送分小仙女□ 提交于 2020-01-01 12:17:30

问题


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.


回答1:


Do the following:

  1. Stop the capture job;
  2. Run EXEC 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.


来源:https://stackoverflow.com/questions/23744083/cdc-is-enabled-but-cdc-dbotable-name-ct-table-is-not-being-populated

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!