SansSQL: Log Shipping

Wednesday, May 1, 2013

LSN mismatch error in Log Shipping

LSN mismatch is a common issue which happens in Log Shipping and because of which the Log Shipping goes out of sync.
When you check the history, you will find messages like below
Msg 4305, Level 16, State 1, Line 1
The log in this backup set begins at LSN 36000000048400001, which is too recent to apply to the database. An earlier log backup that includes LSN 20000000022100001 can be restored.
Msg 3013, Level 16, State 1, Line 1
RESTORE LOG is terminating abnormally.
According to this error message, I am trying to restore a log backup before which I need to restore another backup which is taken earlier than this.

Wednesday, June 20, 2012

Understanding .TUF file in log shipping

I am very happy and excited to be part of Sans SQL with this being my first contribution here. So without wasting much time let us get on...

What is .TUF file? What is the significance of the same? Any implications if the file is deleted?

.TUF file is the Transaction Undo File, which is created when performing log shipping to a server in Standby mode.
When the database is in Standby mode the database recovery happens when the log is restored; and this mode also creates a file on destination server with .TUF extension which is the transaction undo file.

This file contains information on all modifications performed at the time backup is taken.

The file plays a important role in Standby mode... the reason being very obvious while restoring the log backup all uncommitted transactions are recorded to the undo file with only committed transactions written to disk which enables the users to read the database. So when we restore next transaction log backup; SQL Server will fetch all the uncommitted transactions from undo file and check with the new transaction log backup whether committed or not.

If found to be committed the transactions will be written to disk else it will be stored in undo file until it gets committed or rolled back.

So... that's it for now! Happy Reading!!

Ads