truncate log on cdc enabled database

NeophyteSQL 241 Reputation points
2021-07-29T13:49:55.643+00:00

As a part of database decryption, one of the processes is to truncate the log file.

the database can be altered to simple and then shrunk.
if database has cdc enabled, will this still be possible to truncate the log after changing the recovery model to simple.
or does the cdc process need to be disabled.

please advice on this.

thanks

SQL Server | Other
{count} votes

1 answer

Sort by: Most helpful
  1. CathyJi-MSFT 22,396 Reputation points Microsoft External Staff
    2021-07-30T02:20:22.787+00:00

    Hi @NeophyteSQL ,

    Yes, the log still can be truncated after all the changes that are marked for capture have been gathered by the capture process. You do not need to disable CDC.

    Quote from MS document Change Data Capture.

    When a database is enabled for change data capture, even if the recovery mode is set to simple recovery the log truncation point will not advance until all the changes that are marked for capture have been gathered by the capture process. If the capture process is not running and there are changes to be gathered, executing CHECKPOINT will not truncate the log.


    If the response is helpful, please click "Accept Answer" and upvote it, as this could help other community members looking for similar queries.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.