There’s a little something to keep in mind when restoring a SQL replication publisher

So the other day I had to restore the SQL Server replication publisher.  When I restored it I made sure to use the KEEP_REPLICATION option on the restore (also available in the SSMS UI) so replication should come back online.  However when I restarted the log reader I the following error message.

The log scan number (6367:10747:6) passed to log scan in database ‘%d’ is not valid. This error may indicate data corruption or that the log file (.ldf) does not match the data file (.mdf). If this error occurred during replication, re-create the publication. Otherwise, restore from backup if the problem results in a failure during startup. (Source: MSSQLServer, Error number: 9003)

Needless to say this error looks pretty damn scarey.  In reality it isn’t actually that bad.  What this error is basically saying is that the LSN that is returned from the database is older than the one logged in the replication database.  The best part is that the fix is pretty easy.  Simply run the stored procedure “sp_replrestart” in the published database.

Denny

Share

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Trust DCAC with your data

Your data systems may be treading water today, but are they prepared for the next phase of your business growth?