We are using log shipping and RESTORE WITH STANDBY on SQL Server 2012 in order to restore the database in read-only mode for reporting purposes. However, the log shipping setup keeps breaking after completing a restore of one or two log backups. Log-shipping only breaks when it is running as RESTORE WITH STANDBY; RESTORE WITH NORECOVERY does not cause any problems.
I have reset up log shipping multiple times but no luck and also reconfigured log shipping on other secondary server which is in same domain and its working fine there it means its not a either network or log file corruption issue. I have ran the DBCC Checkdb and no db corruption found and also verified the log file with restore verifyonly option and that file is valid
Errors:
Message
Error: Could not apply log backup file '<path:\<DBName>\<DBName>_.trn' to secondary database '<DBName>'.(Microsoft.SqlServer.Management.LogShipping) ***
Error: An error occurred while processing the log for database '<DBName>'. If possible, restore from backup. If a backup is not available, it might be necessary to rebuild the log.
An error occurred during recovery, preventing the database '<DBName>' (10:0) from restarting. Diagnose the recovery errors and fix them, or restore from a known good backup. If errors are not corrected or
expected, contact Technical Support.
RESTORE LOG is terminating abnormally.
Processed 0 pages for database '<DBName>', file '<DBName>' on file 1.
Error: Could not log history/error message.(Microsoft.SqlServer.Management.LogShipping) ***
Error: ExecuteNonQuery requires an open and available Connection. The connection's current state is closed.(System.Data) ***
Skipping log backup file '<path\<DBName>\<DBName>_.trn' for secondary database '<DBName>' because the file could not be verified.
Error: Could not log history/error message.(Microsoft.SqlServer.Management.LogShipping) ***
Error: ExecuteNonQuery requires an open and available Connection. The connection's current state is closed.(System.Data) ***
Error: An error occurred restoring the database access mode.(Microsoft.SqlServer.Management.LogShipping) ***
Error: ExecuteScalar requires an open and available Connection. The connection's current state is closed.(System.Data) ***
Deleting old log backup files. Primary Database: '<DBName>'
Rahul