Hi All
I'm after some help please, as I think I may have discovered a bug with SQL Log Shipping to a server that is also running SQL Reporting Services.
To try and help keep things clear, I have 4 servers, ServerA, ServerB, ServerC and ServerDR. ServerA, B and C are all within the same domain, whilst ServerDR is in a data centre offsite.
I have setup to logship several databases from ServerA (11.0.3000 - 2 node SQL cluster) to ServerDR (11.0.3128), this is working as it should and the databases are in a Standby / Read Only mode. I then setup to logship to ServerB (11.0.3128), from ServerA. This initially worked, but at certain times over night the log shipping would fail and leave the databases on ServerB in a restoring state, rather than Standby / Read Only state. I deleted logshipping and re-created the job. This runs fine through the day, but as soon as the evening comes it fails again. It seems that when the transaction backup doesn't have any data changes to apply, this is when it fails.
Log shipping is setup to restore into Standby / Read Only mode and disconnect the users.
I then tested log shipping from ServerA to ServerC and this has worked without fault over night. The only difference between ServerC and ServerDR, is that ServerB is running Reporting Services.
The logs from ServerB when the log restore fails is:
2013-12-27 15:16:05.82 * Error: Could not apply log backup file 'F:\Logshipped Files\xxxxx_20131224171511.trn' to secondary database 'Logship_xxxxx'.(Microsoft.SqlServer.Management.LogShipping) 2013-12-27 15:16:05.82 Error: An error occurred while processing
the log for database 'Logship_xxxxx'. 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 'Logship_xxxxx' (27: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 'Logship_xxxxx', file 'xxxxx' on file 1. Processed
1 pages for database 'Logship_xxxxx', file 'xxxxx' on file 1.(.Net SqlClient Data Provider) 2013-12-27 15:16:05.82 Error: Could not log history/error message.(Microsoft.SqlServer.Management.LogShipping) 2013-12-27 15:16:05.82 Error: ExecuteNonQuery requires
an open and available Connection. The connection's current state is closed.(System.Data) * 2013-12-27 15:16:05.82 Skipping log backup file 'F:\Logshipped Files\xxxxx_20131224173011.trn' for secondary database 'Logship_xxxxx' because the file could not be verified.
2013-12-27 15:16:05.82 * Error: Could not log history/error message.(Microsoft.SqlServer.Management.LogShipping) 2013-12-27 15:16:05.82 Error: ExecuteNonQuery requires an open and available Connection. The connection's current state is closed.(System.Data)
2013-12-27 15:16:05.82 Error: Could not apply log backup file 'F:\Logshipped Files\xxxxx_20131224174511.trn' to secondary database 'Logship_xxxxx'.(Microsoft.SqlServer.Management.LogShipping)This is a snippet and it repeats itself
I then have run Restore VerifyOnly from disk = 'D:\.....' to check the integrity of the log file it has copied. This returnsThe backup set on file 1 is valid.
If I manually apply this log with:
RESTORE LOG Logship_xxxxx
FROM DISK='F:\Logshipped Files\xxxxx_20131223193011.trn'
WITH STANDBY='F:\Logshipped Files\UNDO\UNDO_xxxxx_ARCHIVE.DAT'
This fails with the:
Processed 0 pages for database 'Logship_xxxxx', file 'xxxxx' on file 1. Processed 1 pages for database 'Logship_xxxxx', file 'xxxxx_log' on file 1. Msg 9004, Level 16, State 6, Line 1 An error occurred while processing the log for database 'Logship_xxxxx'. If possible, restore from backup. If a backup is not available, it might be necessary to rebuild the log. Msg 3013, Level 16, State 1, Line 1 RESTORE LOG is terminating abnormally. Msg 3414, Level 21, State 1, Line 1 An error occurred during recovery, preventing the database 'Logship_xxxxx' (27: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.
It will then allow me to move onto the next log, which will generate the same error, but then when I hit a log with some slight data change, this applies successfully and puts the database back into Standby / Read Only.
I have also checked the SQL jobs that are running on ServerB to see if there is anything that is causing an issue and nothing coincides with the timings of the restores.
Apologies if I have missed anything, but any ideas would help a lot.
Thank you.