Restore Transactional Log Backup

  • Hi,

    I am new to this forum.Could anyone help me with this questions please. I am not able to resore my log backup.

    My plan for backup is daily full backup, and transactional log backup for every 5 minutes because we do not have much transactions.My data base recovery model is "Full", and I scheduled transactional Backup with time stamp file name, and it works. Now I have problem with restoring transactional log backup. I restored my Full backup with Recovery state " RECOVERY WITH STANDBY" , and Restore options "WITH REPLACE", but when I want to restore transactional log backup, it is grayed out.

    Any help would be greatly appreciated.

    Thank in advance,

  • You want to use "With NoRecovery" not "With Standby."

    Standby will roll back any uncommited transactions and put the DB in read-only. NoRecovery basically tells SQL Server that there's more to be restored, at which point you begin restoring your TLog backups. On the last TLog backup you intend to restore, you use the "With Recovery," after which you'll have a usable DB.

    Jason

  • jasona.work (4/15/2013)


    You want to use "With NoRecovery" not "With Standby."

    Standby will roll back any uncommited transactions and put the DB in read-only. NoRecovery basically tells SQL Server that there's more to be restored, at which point you begin restoring your TLog backups. On the last TLog backup you intend to restore, you use the "With Recovery," after which you'll have a usable DB.

    Jason

    Not quite true. WITH STANDBY allows you to bring a database into a read only state. Using an UNDO log you should be able to restore additional t-log backups until such time as you use WITH RECOVERY. This is how you can use a log shipped database for reporting.

  • Lynn Pettis (4/15/2013)


    jasona.work (4/15/2013)


    You want to use "With NoRecovery" not "With Standby."

    Standby will roll back any uncommited transactions and put the DB in read-only. NoRecovery basically tells SQL Server that there's more to be restored, at which point you begin restoring your TLog backups. On the last TLog backup you intend to restore, you use the "With Recovery," after which you'll have a usable DB.

    Jason

    Not quite true. WITH STANDBY allows you to bring a database into a read only state. Using an UDO log you should be able to restore additional t-log backups until such time as you use WITH RECOVERY. This is how you can use a log shipped database for reporting.

    Learn something every day!

    I stand corrected!

    😎

    Jason

  • Hi,

    For restoring a db from transactional backup first u need to restore latest full backup with 'RESTORE WITH NORECOVERY' option then transactional log backups(except latest transactional backup) in sequence with 'RESTORE WITH NORECOVERY' option & at last restore latest transactional backup with 'RESTORE WITH RECOVERY' . And now ur db is ready to use 🙂

  • pm.praveen.mehta89 (4/17/2013)


    Hi,

    For restoring a db from transactional backup first u need to restore latest full backup with 'RESTORE WITH RECOVERY' option then transactional log backups(except latest transactional backup) in sequence with 'RESTORE WITH RECOVERY' option & at last restore latest transactional backup with 'RESTORE WITH NORECOVERY' . And now ur db is ready to use 🙂

    Err... no. The complete other way around.

    You need to restore the full backup WITH NORECOVERY (or STANDBY), then all the log backups except the last WITH NORECOVERY (or STANDBY), then the last log backup is the one that restores WITH RECOVERY

    WITH RECOVERY signals the end of the restore process and brings the DB online. If you restore the full WITH RECOVERY, further log backups will fail to restore because the database is online and available. Attempts to restore logs will be met with an error saying that no files are ready to roll forward.

    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

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

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