Error 14421 Log Shipping
Contents |
SERVER - Log Shipping Restore Job Error: The file is too recent to apply to the secondary database October 20, 2015Pinal DaveSQL, SQL Server, SQL Tips and Tricks1 commentIf http://blog.sqlauthority.com/2015/10/20/sql-server-log-shipping-restore-job-error-the-file-is-too-recent-to-apply-to-the-secondary-database/ you are a DBA and handled Log-shipping as high availability solution, there are a number of common errors that come that you would over a period of http://www.sqlcoffee.com/Troubleshooting162.htm time become pro on resolving. Here is one of the common error which you must have seen:Message 2015-10-13 21:09:05.13 *** Error: The file ‘C:\LS_S\LSDemo_20151013153827.trn' is too recent error 14421 to apply to the secondary database ‘LSDemo'.(Microsoft.SqlServer.Management.LogShipping) *** 2015-10-13 21:09:05.13 *** Error: The log in this backup set begins at LSN 32000000047300001, which is too recent to apply to the database. An earlier log backup that includes LSN 32000000047000001 can be restored. RESTORE LOG is terminating abnormally.(.Net SqlClient Data Provider) *** Above error is a severity 16 state shown in failure of the history of restore job. If the failure is more than configured thresholds, then we would start seen below error in SQL ERRORLOG on secondary also: 2015-10-14 06:22:00.240 spid60 Error: 14421, Severity: 16, State: 1. 2015-10-14 06:22:00.240 spid60 The log shipping secondary database PinalServer.LSDemo has restore threshold of 45 minutes and is out of sync. No restore was performed for 553 minutes. Restored latency is 4 minutes. Check agent log and logshipping monitor information.To start troubleshooting, we can look at Job activity monitor on secondary which would fail with the below state: If you know SQL transaction log backup basics, you might be able to guess the cause. If we look closely to the error, it talks about LSN mismatch. Most of the cases, a manual transaction log backup was taken. I remember few scenarios where a 3rd party tool would have taken transaction log backup of database which was also part of a log shipping conf