Begin Log Sequence Number specified for replication log scan is invalid.
The log sequence number (LSN) stored in the distribution database replication tables is later than the LSN specified in the transaction log as the next to be read by the Log Reader Agent. This indicates that the data is inconsistent between the publisher and distributor and the Log Reader Agent process does not know which record to correctly read next. This situation could occur, if rows were manually deleted from the MSrepl_transactions replication table or if the distribution database has sync with backup enabled, but publication database was restored without ensuring consistency between the databases.
Some scenarios where this situation could occur:
Sync with backup is enabled for the publishing database. You take backups of the publishing database while activity is occurring and while the log reader agent is running. You restore publisher database to earlier copy of backups.
Sync with backup is not enabled for the publishing database. You take backups of the publishing database while activity is occurring and while the log reader agent is running. You restore publisher database.
Reinitialize all subscriptions for the affected transactional publication to ensure the data is in sync.
Strategies for Backing Up and Restoring Snapshot and Transactional Replication
Name | Description | Default Value |
Enabled | Enables or disables the workflow. | No |
Priority | Defines Alert Priority. | 2 |
Severity | Defines Alert Severity. | 2 |
Target | Microsoft.SQLServer.2008.DBEngine | ||
Category | EventCollection | ||
Enabled | False | ||
Alert Generate | True | ||
Alert Severity | Error | ||
Alert Priority | High | ||
Remotable | True | ||
Alert Message |
|
ID | Module Type | TypeId | RunAs |
---|---|---|---|
DS | DataSource | Microsoft.SQLServer.2008.EventProvider | Default |
GenerateAlert | WriteAction | System.Health.GenerateAlert | Default |
<Rule ID="Microsoft.SQLServer.2008.BeginLSNSpecifiedForReplicationLogscanInvalidRule" Target="SQL2008Core!Microsoft.SQLServer.2008.DBEngine" Enabled="false" 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>18765</EventNumber>
</DataSource>
</DataSources>
<WriteActions>
<WriteAction ID="GenerateAlert" TypeID="SystemHealth!System.Health.GenerateAlert">
<Priority>2</Priority>
<Severity>2</Severity>
<AlertMessageId>$MPElement[Name="Microsoft.SQLServer.2008.BeginLSNSpecifiedForReplicationLogscanInvalidRule.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>