Share via

sql log shipping restore failure

Edward Hall 1 Reputation point
2021-02-02T15:46:17.263+00:00

What is causing this error and how do i correct it.

2021-02-02 10:06:04.32 Error: Could not apply log backup file '\secondary\SQLLogShip\dbname_20210201143000.trn' to secondary database 'dbname'.(Microsoft.SqlServer.Management.LogShipping)
2021-02-02 10:06:04.32 **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' (19: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.
Processed 1 pages for database 'dbname', file 'dbname_log' on file 1.(.Net SqlClient Data Provider) **
2021-02-02 10:06:04.33 Error: Could not log history/error message.(Microsoft.SqlServer.Management.LogShipping)

Some history.
we have several databases log shipped into standby mode for reporting purposes to the same secondary server most work fine but we have a small few that do not. We have duplicated the settings from the working ones to this one. Didn't help, Both servers are the same versions.
once we delete it and re setup the log shipping on a 15 min interval with disconnect users selected it will run normally 1 or 2 cycles then this error shows up. I have tried to get it going but it has to be re setup to get back to working again. it seems to run ok with "norecovery" selected, but that is useless for reporting functions. There is a second log backup job but this database is excluded. We even tried suspending that 2nd job, that didn't make any difference. The same error shows up on the 2nd or 3rd cycle.

We have run out of ideas to check.

SQL Server | Other
SQL Server | Other

Additional SQL Server features and topics not covered by specific categories


3 answers

Sort by: Most helpful
  1. Reinaldo J Blanco Medina 21 Reputation points
    2021-08-31T14:24:19.497+00:00

    Hi @Edward Hall ,

    Did you get the solution? I am having the same issue...

    Was this answer helpful?


  2. Cris Zhan-MSFT 6,676 Reputation points
    2021-02-03T07:50:45.107+00:00

    Hi @Edward Hall

    Please look into the SQL Server ERRORLOG,windows Log for any errors related to log shipping.

    In addition, here is a fix that may be applicable to your situation, please check.

    Was this answer helpful?


  3. Erland Sommarskog 134.7K Reputation points MVP Volunteer Moderator
    2021-02-02T22:14:20.263+00:00

    It looks like the original error message which relates why it was not possible to apply to the log has gone lost somewhere.

    I would first check the SQL Server error log in hope that it may be there.

    If that does not work out, I would try to trace errors on the SQL Server machine. As it happens, I have an article on my web site on how do this with extended events and a view to look at the exceptions: http://www.sommarskog.se/Short%20Stories/trace-exceptions.html

    Was this answer helpful?

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.