question

sukh_ohbaley avatar image
sukh_ohbaley asked

Restoring a Log Backup

Hello, I'm trying to test my backups by doing a transaction log backup over a restoring state database on my local instance. (Just playing around with Log Shipping to learn how to do a point in time recovery) But everytime I try to restore a log I keep on getting the following error: Msg 4326, Level 16, State 1, Line 2 The log in this backup set terminates at LSN 231494000011373900001, which is too early to apply to the database. A more recent log backup that includes LSN 231494000014726400001 can be restored. Msg 3013, Level 16, State 1, Line 2 RESTORE LOG is terminating abnormally. The full backup was taken last night at 22:10 and I am just trying to test it with one or 2 log restores over this database.... I do'tr understand why its not working. can anyone please help me with this? Its not even a failover, I just want to be able to restore logs over a restoring state database for practice...in an effort to learn Log Shipping... Many thanks, Sukhdeep
log-shipping
1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

sukh_ohbaley avatar image sukh_ohbaley commented ·
Anyone??? Please??
0 Likes 0 ·

1 Answer

·
JohnM avatar image
JohnM answered
I would suspect that you are attempting to restore that transaction log out of order. There should be a transaction log backup that was taken before that one that needs to be applied first. You have to apply them in sequential order. Reference: https://blog.sqlauthority.com/2015/08/10/sql-server-error-msg-4305-level-16-state-1-the-log-in-this-backup-set-terminates-at-lsn-which-is-too-early-to-apply-to-the-database/ Hope that helps.
5 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

sukh_ohbaley avatar image sukh_ohbaley commented ·
Hi, Thank you for your response. I believe I have them in order, because what I am checking is the LSN number from the full backup to the next transaction log backup. But the LSN I get from the Full backup when I run my RESTORE HEADERONLY check, I cannot locate the next one in sequence in the transaction log backups....and there are no logs hich appear to be missing? Regards,
0 Likes 0 ·
JohnM avatar image JohnM commented ·
Is there another job that might be running in the background taking transaction log backups?
0 Likes 0 ·
sukh_ohbaley avatar image sukh_ohbaley commented ·
Yes there is, but how would that interfere with the restore I am trying to restore on my local instance? Basically, I am not failing over on the secondary server? I've got last night's full backup and all I want to do is restore atleast 2 or 3 transaction log backups over the RESTORING state database? Thanks,
0 Likes 0 ·
JohnM avatar image JohnM commented ·
Were those log backups taken right behind the full backup?
0 Likes 0 ·
sukh_ohbaley avatar image sukh_ohbaley commented ·
No, these were backups as part of the Log shipping process. I restored the PROD database to my local instance on my machine. I left it in RESTORING state. I then just tried to take a few log backups created after the full backup was done and tried to RESTORE them over the Backup I had just currently placed in my local instance. So would this also mean that the LSN of the transaction log backups created in LOG SHIPPING has no tie in with the LSN of the full database backup?
0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.