Can't restore transaction logs

  • Hi Everyone,

    I cannot restore the transaction logs after restoring the full backup.

    It shows the transaction log is too early to apply. I have the following scheduled jobs to take backup files.

    10:30 PM - Full Backup

    11:00 PM - Transaction log

    12:00 AM - Transaction log

    Can't restore the 11:00 PM transaction log.

    The database has mirrored database also.

    Hope to hear from you SQL pro.

    Thanks in advance.

  • Sounds like the full backups last LSN is after the 11pm transaction log backup.

    Check msdb.dbo.backupset correlating the first & last LSN columns to get the restore order.

    But in this case it will be 10:30 Full, 12:00 TXLog

  • What time did the full backup complete? What's the message you get when you try to restore?

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • The full backup completed at 11:00 PM

    Error:

    System.Data.SqlClient.SqlError: The log in this backup set begins at LSN #, which is too recent to apply to the database. An earlier log backup that includes LSN # can be restored.

    Thanks.

  • marygrace_laurente23 (11/12/2012)


    The full backup completed at 11:00 PM

    Error:

    System.Data.SqlClient.SqlError: The log in this backup set begins at LSN #, which is too recent to apply to the database. An earlier log backup that includes LSN # can be restored.

    Ah, in that case there's an earlier log backup that needs to be applied first. Perhaps one that ran at 10:30?

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • We don't have 10:30 PM transaction log.

    What we is hourly transaction log backup.

    10:00 PM - Transaction Log

    10:30 PM - Full Backup (every day)

    11:00 PM - Transaction Log

    12:00 AM - Transaction Log onwards

  • Then you need to restore the 10PM transaction log.

    As the error said "The log in this backup set begins at LSN #, which is too recent to apply to the database. An earlier log backup that includes LSN # can be restored. "

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • Tried already to restore the 10 PM transaction log but showing same error.

  • Then you must be using an earlier full backup and not the current one from the latest 10:30 backup.

    Check through the backupset table and correlate which log file it is wanting you to restore using the LSN columns and the LSN that the restore error message is giving you.

  • anthony.green (11/15/2012)


    Then you must be using an earlier full backup and not the current one from the latest 10:30 backup.

    Yup.

    A backup that starts at 10:30 and finishes at 11:30 may well need the tran log backup from 10:00 and the one from 11:00 (plus all later), but it could not need any from before that.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • GilaMonster (11/15/2012)


    anthony.green (11/15/2012)


    Then you must be using an earlier full backup and not the current one from the latest 10:30 backup.

    This.

    A backup that starts at 10:30 and finishes at 11:30 may well need the tran log backup from 10:00 and the one from 11:00 (plus all later), but it could not need any from before that.

    Appreciate that but if the 10pm transaction log was still to recent to restore to the 10:30pm full backup then I assumed that the full backup is ealier in the transaction log chain, possibly from the night before

  • anthony.green (11/15/2012)


    Appreciate that but if the 10pm transaction log was still to recent to restore to the 10:30pm full backup then I assumed that the full backup is ealier in the transaction log chain, possibly from the night before

    Err... that's what I said.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • GilaMonster (11/15/2012)


    anthony.green (11/15/2012)


    Appreciate that but if the 10pm transaction log was still to recent to restore to the 10:30pm full backup then I assumed that the full backup is ealier in the transaction log chain, possibly from the night before

    Err... that's what I said.

    Sorry, I must of miss interpreted

  • anthony.green (11/15/2012)


    GilaMonster (11/15/2012)


    anthony.green (11/15/2012)


    Then you must be using an earlier full backup and not the current one from the latest 10:30 backup.

    This.

    A backup that starts at 10:30 and finishes at 11:30 may well need the tran log backup from 10:00 and the one from 11:00 (plus all later), but it could not need any from before that.

    Appreciate that but if the 10pm transaction log was still to recent to restore to the 10:30pm full backup then I assumed that the full backup is ealier in the transaction log chain, possibly from the night before

    I swear this reads like there are multiple full backups in the backup file because the backup file was not initialized. Maybe check to see how many full backups are actually in the full backup file just on the chance that this is the case?

Viewing 14 posts - 1 through 13 (of 13 total)

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