When log shipping is out of sync how to find LSN number

  • When log shipping is out of sync and we try to restore the transaction logs ,

    it gives error that the LSN number.....is too late to restore, try a earlier one.

    And at that time how can we know the LSN number of the transaction logs (which to be applied).

  • Can anybody help with this issue? Thanks.

  • First check the last file copied and restored to the secondary. Run the following queries on the secondary node.

    The following query will give you the last log backup file that was copied

    SELECT * FROM [msdb].[dbo].[log_shipping_secondary]

    Then check what was the last log backup file that was restored.

    SELECT * FROM [msdb].[dbo].[log_shipping_secondary_databases]

    Based on the name of the last file restored, see what should be the next file that should be restored. Make sure that you check the files on both primary and secondary. One of the files might not have got copied.

    Read the following post for more details.

    http://saveadba.blogspot.com/2011/12/sql-server-log-shipping-could-not-find.html

    You might get a better response if you posted this question in the 'Administration' section or the 'high availability' section

    Blog
    http://saveadba.blogspot.com/

  • Thank you... I'll re-post. I would like to know how to resolve this when I see that they are out of sync...

  • If you want to test this then set up log shipping in a test environment and delete/move a log backup file from the primary server before it gets copied to the secondary server.. That way you will be breaking the log chain.

    I am sure you will see the same error as before.

    Blog
    http://saveadba.blogspot.com/

  • For resolving the logshipping out of sync issue. generally you have restore the full backup of your primary database to secondary server.

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

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