SQL Server Restore – Losing One Day of Data

backuprestoresql serversql-server-2008-r2

I have SQL 2008 R2 64bit and it is backed up with ASIGRA SQL backup. The issue I have is that we had corruption on the server and the DB got corrupted yet the LDF file is in tact and does have all the changes since the last backup.

So I can easily restore the backup, but Can I then implement the changes logged in the LDF file so I can get back the day of changes we lost.

Best Answer

First things first, before you restore anything - back up your log with no_truncate.

If your database is offline, then take a copy of your LDF file first, then bring your database online, ignoring any errors, and then do your log backup.

This log backup is then the last one in your recovery process, which involves a full database backup which doesn't have corruption, and all the log backups since.

But also, consider what kind of corruption it is. If it's in a non-clustered index only, then you could drop and recreate the index and remove your corruption that way.