Could not clean up the distribution history tables

Microsoft.SQLServer.2008.CouldNotCleanUpDistributionHistoryTablesRule (Rule)

Knowledge Base article:

Summary

The distribution history cleanup process could not delete expired rows from one or more of the history tables.

Causes

The data from history tables include the msdb table sysreplicationalerts and the distribution database tables MSsnapshot_history, MSlogreader_history, MSdistribution_history, MSqreader_history, MSmerge_history, and MSrepl_errors cannot be removed.

Resolutions

Check for other messages in the job history or other logs that occur around the same time as this error. Troubleshoot those messages first.

Overrideable Parameters

Name

Description

Default Value

Enabled

Enables or disables the workflow.

Yes

Priority

Defines Alert Priority.

2

Severity

Defines Alert Severity.

2

Element properties:

TargetMicrosoft.SQLServer.2008.DBEngine
CategoryEventCollection
EnabledTrue
Alert GenerateTrue
Alert SeverityError
Alert PriorityHigh
RemotableTrue
Alert Message
Could not clean up the distribution history tables
{0}

Member Modules:

ID Module Type TypeId RunAs 
DS DataSource Microsoft.SQLServer.2008.EventProvider Default
GenerateAlert WriteAction System.Health.GenerateAlert Default

Source Code:

<Rule ID="Microsoft.SQLServer.2008.CouldNotCleanUpDistributionHistoryTablesRule" Target="SQL2008Core!Microsoft.SQLServer.2008.DBEngine" Enabled="true" ConfirmDelivery="true">
<Category>EventCollection</Category>
<DataSources>
<DataSource ID="DS" TypeID="Microsoft.SQLServer.2008.EventProvider">
<ComputerName>$Target/Host/Property[Type="Windows!Microsoft.Windows.Computer"]/NetworkName$</ComputerName>
<PublisherName>$Target/Property[Type="SQL!Microsoft.SQLServer.DBEngine"]/ServiceName$</PublisherName>
<EventNumber>20553</EventNumber>
</DataSource>
</DataSources>
<WriteActions>
<WriteAction ID="GenerateAlert" TypeID="SystemHealth!System.Health.GenerateAlert">
<Priority>2</Priority>
<Severity>2</Severity>
<AlertMessageId>$MPElement[Name="Microsoft.SQLServer.2008.CouldNotCleanUpDistributionHistoryTablesRule.AlertMessage"]$</AlertMessageId>
<AlertParameters>
<AlertParameter1>Event ID: $Data/EventDisplayNumber$. $Data/EventDescription$</AlertParameter1>
</AlertParameters>
<Suppression>
<SuppressionValue>$Data/LoggingComputer$</SuppressionValue>
<SuppressionValue>$Data/PublisherName$</SuppressionValue>
<SuppressionValue>$Data/EventDisplayNumber$</SuppressionValue>
</Suppression>
</WriteAction>
</WriteActions>
</Rule>