Transaction Log Restore question

  • It’s well known that database Restore procedure starts with transaction log (TL) backup with No_Truncate option. But in case when Sql server crashed we can’t do this. Can we apply instead existing database .ldf file to restore last transactions (after last successful TL backup)? Thanks

  • Sorry, guys, probably I confused myself and you too because, probably, if the whole server crashed, database .ldf file is not accessible too. Therefore, I would like slightly to rephrase my question- if, by any reason, after database failure happened we can't make TL backup with No_Truncate option is it possible to restore very last transactions (after last successful TL backup)? Thanks

  • YES, but the logs have to be in sequential order.

    1. restore the database from the full backup (.bak file)

    2. restore any differential backups, if any

    3. restore logs in sequential order.

     

    if you can't restore, and have the database files, you can use sp_atach_db to attach the  database.

  • Thanks for your answer, but I am not sure I can use either way you pointed. My concern is regarding restoring last transactions that are not part of last TL backup. That means, if I didn’t make (by some reason) TL backup with No_Truncate at the point of failure I can’t, certainly, restore these last transactions. Regarding attaching- it works if both database files are OK. In this case there is no problem to restore, but, let say, .mdf file was damaged, but .ldf is OK. Actually, last transactions that are not part of last TL backup, are inside .ldf file. But question is how to use them for restoring? Thanks

  • OK, if there is no yet answer I am looking for, let me to rephrase my question one more time- is there a way to utilize database transaction log .ldf file to restore very last transactions that are not part of last TL backup? Thanks

  • no.

  • If you are .ldf file is in place, you can take a T-log backup with No_Truncate.

    However, if you are not able to take a log backup, you will be able to get the data of only the backups u have already taken before the crash.

    Hope this helps.

    --Kishore

  • see this article from MS:

    http://support.microsoft.com/kb/253817/EN-US/

     

  • Thanks, Martin! This is what I am loooking for.

Viewing 9 posts - 1 through 8 (of 8 total)

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