Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 SQL Server Administration (2005)
 How to restore DB after last Log Backup

Author  Topic 

rajkumarrai_bis
Yak Posting Veteran

78 Posts

Posted - 2008-11-03 : 02:11:55
one of our DB was corrupted at 2-nov-08 1:15 PM and last log backup is of 2-nov-08 1:00 PM.

How can I restore DB to 2-nov-08 1:15 PM?

GilaMonster
Master Smack Fu Yak Hacker

4507 Posts

Posted - 2008-11-03 : 05:20:57
Backup the tail of the log.
Backup log <Database Name> TO Disk = < Filename > WITH NO_TRUNCATE

Then restore your full backup and all of the logs in sequence (all with the NO_RECOVERY option) and finally restore the backup of the tail of the log.

--
Gail Shaw
SQL Server MVP
Go to Top of Page

rajkumarrai_bis
Yak Posting Veteran

78 Posts

Posted - 2008-11-03 : 07:16:53
thanks for the reply
i have a confusion
i will take log backup -- no problem
but restoring it will restore DB till its end or should i use "STOPAT" switch for tail log backup restore ?
one more question this tail log backup is no different from other log backups right ?

Go to Top of Page

GilaMonster
Master Smack Fu Yak Hacker

4507 Posts

Posted - 2008-11-03 : 10:43:38
No stop at. You want to restore right up to the last transaction. Unless it's the log that's corrupt, restoring the log won't put the corruption back into the DB. That's assuming you mean corruption that CheckDB picked up, and not something like someone dropping a table.

A tail log backup is just a log backup. It's restored the same way as any other log backup. The only thing that's different about it is that when the backup is taken the log records aren't truncated afterwards.

--
Gail Shaw
SQL Server MVP
Go to Top of Page
   

- Advertisement -