Issue with CDC and Replication enabled

Hello,

We have this strange issue with CDC and replication. Let me explain

1. We have a database on write server and we replicate some tables to the read server. There are 15 tables that we replication and 8 of them have computed columns that are persisted.

2. We also have CDC enabled on the same database where we have transactional replication enabled. I know that both CDC and replication uses replication log reader. Some how, all the time we see the log_reuse_wait says replication

3. If I add around 100-200 MB into these tables, with these persisted columns, it will be around 500 MB of data. But the replication is queuing up 10-15 GB of data.

4. I checked CDC tables, and the updates are in cdc tables. Also, I don't see CDC capture job. Is this because there is already replication enabled?

What might be the issue that's causing the log to hold for a very long extended periods of time? We don't see any issue with log reader and CDC.

March 30th, 2015 3:28pm

2. Log_reuse_wait will show replication status both for CDC and replication.

4. Yes as you are using transaction replication, Log Reader Agent is created for the database and the capture job wont exist.

When the Log Reader Agent is used for both change data capture and transactional replication, replicated changes are first written to the distribution database. Then, captured changes are written to the change tables. Both operations are committed together. If there is any latency in writing to the distribution database, there will be a corresponding latency before changes appear in the change tables.

https://msdn.microsoft.com/en-us/library/cc645938.aspx?f=255&MSPPError=-2147217396

As you said CDC updates are in cdc table I dont see any issue.

You could run DBCC OPENTRAN to see the old active transaction? It will give you more info.

Free Windows Admin Tool Kit Click here and download it now
March 30th, 2015 11:15pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics