Log Shipping Error

  • I am new to log shipping and began a test yesterday. I set up a primary, secondary, and monitor server to backup, copy, and restore every 5 minutes. It ran great until 4am this morning. Since then, I get this error message: "[Microsoft SQL-DMO (ODBC SQLState: 42000)] Error 4305: [Microsoft][ODBC SQL Server Driver][SQL Server]The log in this backup set begins at LSN 3842000000026500001, which is too late to apply to the database. An earlier log backup that includes LSN 3840000000035500001 can be restored.

    [Microsoft][ODBC SQL Server Driver][SQL Server]RESTORE LOG is terminating abnormally."

    The job restore history looks like this:

    Copy Succeeded 4:00am 1 file Log#555.trn

    Load Succeeded 4:00am 1 file Log#555.trn

    Copy Succeeded 4:05am 2 file Log#605.trn

    Load Failed 4:05am 1 file Log#555.trn

    And so on....

    After the error, the copies are good, but the load keeps showing Log#555.trn.

    Any ideas?

  • All your transaction logs must be applied on your secondary server in the same order they were done on the primary. For whatever reason the restore of the 4:05 log failed and until you successfully apply this log none of the others will be restored.

    You can either manually apply all the logs or (probably quicker) restart log shipping and try and find the cause of the failed restore. Could have been the restore couldn't get exclusive access of the database at that time.....?

  • Also check if any non-logged operations (select into, truncate table, etc.) occurred. This always broke log shipping at my office and sometimes the only way to get it going again was to perform a full backup and restart all the shipping.

  • You might want to check your backup strategy.

    I bet it started at 4am and your database was locked because of it.

    That might be the root cause of your failure.

    Lowell

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • The thing I can't work out, is why did Log Shipping try to re-apply #555 after it had successfully applied it 5 minutes earlier?

    Does any sort of time sync occur on 1 or both servers at 04:00? Seems it was copying 1 file at a time and then all of a sudden it did 2 (presumably #600 and #605) after 4am.

    Hve you tried quarter-hourly backups, with a 5 minute delay in the restore operation? Just a shot in the dark.

    Cheers,

    - Mark


    Cheers,
    - Mark

  • You need to have sufficient delay between the copying and restoring the log backups. This is to take account of network condition and if the log backups are large. The restore may be taking place before the log is shipped across to the secondary server.

Viewing 6 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic. Login to reply