none
Restoring Database

    Question

  • Hi,

    I have taken a full backup and subsequent transaction log backup.

    I was successfull in restoring the Full backup to another server (with NO recovery), but when I try restoring the transaction log backup (with no recovery) I get the below message

    The log in this backup set begins at LSN 1587234000000358400001, which is too recent to apply to the database. An earlier log backup that includes LSN 1587227000001432600001 can be restored.

    I have not skipped any T log restoration in between, then why do I see this error. I don't have any earlier t backup.. just one full and the subsequent T log.

    Note : I am restoring this to an already existing database (overwriting) 

    Wednesday, January 22, 2014 10:17 AM

Answers

  • Hi Sudhakar,

    As the error shows, you were trying to restore the database with a transaction log backup whose first LSN is 1587234000000358400001, however, the current database is just restored to LSN 1587227000001432600001. To restore transaction log backups, the log chain must be continuous which means the last LSN of a previous transaction log backup must be the same as the first LSN of a transaction log backup that will be restored next. In your scenario, the LSN 1587227000001432600001 restored by the database full backup, and the LSN 1587234000000358400001 of a transaction log backup is not the same, hence, the database restore failed because of the broken log chain.

    If you were indeed restoring the correct transaction log backup, it seems be the reason that the current transaction log backup was ever overridden. For example, maybe you ran the backup log script twice by mistake and the backup log script with INIT option enabled which means the existing file will be overwritten. In your issue, there is no way to restore the database with the current transaction log backup.

    In addition, you can query the FirstLSN and LastLSN of each database full backup and transaction log backup and find that the LSN is not continual:

    select name,first_lsn,last_lsn,checkpoint_lsn,* from msdb..backupset where database_name='SAMPLE_DB'

    Regards,
    Mike Yin

    If you have any feedback on our support, please click here


    Mike Yin
    TechNet Community Support

    Friday, January 24, 2014 3:09 AM
    Moderator