I started receiving DB Mail notifications like the ones below. I looked in the Job Activity Monitor and could see that the distribution cleanup job stopped working for some reason.
DATE/TIME: 11/9/2014 11:26:57 PM
DESCRIPTION: Replication-@rowcount_only parameter must be the value 0,1, or 2. 0=7.0 compatible checksum. 1=only check rowcou: agent distribution@rowcount_only parameter must be the value 0,1, or 2. 0=7.0 compatible checksum. 1=only scheduled for retry. Could not clean up the distribution transaction tables.
COMMENT: (None)
JOB RUN: (None)
I looked in a number of places and found some code to clear out old data sitting in the distribution database that had already been received by the subscriber. When I run the code no rows are cleared out and the database continues to grow. The oldest transaction is from 11/6/14 during the 11pm hour. What do I need to do?
SELECT TOP 50 * FROM [distribution].[dbo].[MSrepl_transactions](nolock) ORDER BY entry_time ASC; GO SELECT COUNT(*) FROM [distribution].[dbo].[MSrepl_transactions]; GO EXEC dbo.sp_MSdistribution_cleanup @min_distretention = 0, @max_distretention = 144; GO
Here is the error message from the job History:
Deactivated initial snapshot for anonymous publication(s). New subscriptions must wait for the next scheduled snapshot. [SQLSTATE 01000] (Message 21077) Could not remove directory '\\MachineName\Snapshot\unc\NAVISION_ISS 2009_CRMSYNCHRONIZATION\20141106213358\'. Check the security context of xp_cmdshell and close other processes that may be accessing the directory. [SQLSTATE 42000] (Error 20015) Replication-@rowcount_only parameter must be the value 0,1, or 2. 0=7.0 compatible checksum. 1=only check rowcou: agent distribution@rowcount_only parameter must be the value 0,1, or 2. 0=7.0 compatible checksum. 1=only scheduled for retry. Could not clean up the distribution transaction tables. [SQLSTATE 01000] (Message 14152). The step failed
Lee Markum