Presentation is loading. Please wait.

Presentation is loading. Please wait.

Warner Chaves MCM / MVP / SQLTurbo.com / Pythian.com

Similar presentations


Presentation on theme: "Warner Chaves MCM / MVP / SQLTurbo.com / Pythian.com"— Presentation transcript:

1 Warner Chaves MCM / MVP / SQLTurbo.com / Pythian.com
The Restore Cookbook SQLSaturday Ottawa 2015 Warner Chaves MCM / MVP / SQLTurbo.com / Pythian.com

2 Bio SQL Server DBA for 10 years.
Previously an L3 DBA at HP, now a Principal Consultant at Pythian in Ottawa Ontario. SQL Server MCM and MVP. Blog: sqlturbo.com Company: Pythian.com

3 Agenda Objective: present different RESTORE scenarios in the form of recipes: easy to remember, to reference and repeat. Scenarios we’ll visit: RESTORE of a damaged FILEGROUP. RESTORE of a specific damaged FILE. RESTORE of a damaged PAGE. Recover from losing the Transaction Log.

4 RESTORE a damaged FILEGROUP
Ingredients: Database in FULL recovery mode. Full backup or individual Filegroup backups (preferable). Log backups. Sequence: Take the tail log backup. NO_TRUNCATE might be necessary. Restore the damaged filegroup(s) using the filegroup backup or a Full backup with the FILEGROUP clause. Putting the db offline/online could be necessary. If you had to offline/online the db, take another tail log backup! Restore log backups to roll forward the affected filegroup until you’re done with the tail.

5 RESTORE a specific damaged FILE
Ingredients: Database in FULL recovery mode. Full backup or individual Filegroup backups (preferable). Log backups. Sequence: Take the tail log backup. NO_TRUNCATE might be necessary. Restore the damaged filegroup(s) using the filegroup backup or a Full backup with the FILE clause. Putting the db offline/online could be necessary. If you had to offline/online the db, take another tail log backup! Restore log backups to roll forward the affected filegroup until you’re done with the tail.

6 RESTORE a damaged PAGE Ingredients: Sequence:
Database in FULL recovery mode. Filegroup must be read-write. Full backup or individual Filegroup backups (preferable). Log backups. Sequence: Restore the damaged page(s) with a filegroup backup or a Full backup. Take the tail log backup. Restore log backups to roll forward the affected filegroup until you’re done with the tail.

7 Recover from losing the Transaction Log
The #1 option is to restore from backups. If there are no backups (shame on you!), emergency mode…. Ingredients: The system stakeholders are aware of possible loss of data and general inconsistency by going this route. Luck, faith, an up-to-date resume. Sequence: Run an ALTER DATABASE * SET EMERGENCY Run a DBCC CHECKDB REPAIR_ALLOW_DATA_LOSS (SINGLE_USER is needed) Run an ALTER DATABASE * SET MULTI_USER

8 Standard Edition IMPORTANT NOTE: Standard Edition will support these RESTORE scenarios in OFFLINE mode only. ONLINE mode is Enterprise only.

9 Recap Go over your environment and the possible scenarios you could face and come up with your own recipes. Get a test machine and run the scenarios yourself. Document the steps. If there’s a change in db layout, infrastructure or backup solution, revisit your recipes.

10 Questions?

11 Download package available here: http://sqlturbo


Download ppt "Warner Chaves MCM / MVP / SQLTurbo.com / Pythian.com"

Similar presentations


Ads by Google