Database Corruption Week 3 Solution

Database Corruption Week 3 Solution

Here is the solution for week three. The original database and details for this can be found here:

http://stevestedman.com/server-health/database-corruption-challenge/week-3-database-corruption-challenge/week-3-challenge-details/

This week was kind of easy as all that is needed is to backup the transaction log with NO_TRUNCATE, and then follow a standard restore. If for some reason the database had been detached then this would have been slightly more tricky, however creating a dummy database would have only taken a few minutes more.

BACKUP LOG [CorruptionChallenge3] TO DISK = N'C:\Path\tail.trn' WITH INIT, NO_TRUNCATE;
GO
USE [master]
RESTORE DATABASE [CorruptionChallenge3] FROM  DISK = N'C:\Path\CorruptionChallenge3_Full.bak' WITH  FILE = 1,
MOVE N'CorruptionChallenge3' TO N'C:\Path\CorruptionChallenge3.mdf',
MOVE N'CorruptionChallenge3_log' TO N'C:\Path\CorruptionChallenge3_log.LDF',  NORECOVERY,  NOUNLOAD,  STATS = 5
RESTORE LOG [CorruptionChallenge3] FROM  DISK = N'C:\Path\3\TransLog_CorruptionChallenge30.trn' WITH  FILE = 1,  NORECOVERY,  NOUNLOAD,  STATS = 5
RESTORE LOG [CorruptionChallenge3] FROM  DISK = N'C:\Path\TransLog_CorruptionChallenge31.trn' WITH  FILE = 1,  NORECOVERY,  NOUNLOAD,  STATS = 5
RESTORE LOG [CorruptionChallenge3] FROM  DISK = N'C:\Path\TransLog_CorruptionChallenge32.trn' WITH  FILE = 1,  NORECOVERY,  NOUNLOAD,  STATS = 5
RESTORE LOG [CorruptionChallenge3] FROM  DISK = N'C:\Path\tail.trn' WITH  FILE = 1,  NOUNLOAD,  STATS = 5
GO

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *