If the database did not come back up
clean, you must perform the following procedure:
- From isql/w, drop the suspect database by using the DBCC dbrepair command
- Drop the devices the database was on. (This is another extremely good reason to have
each of your databases on separate devices.)
- Open Windows Explorer and delete the physical .dat file for the device you just dropped
in SQL Server. (No, SQL Server does not remove the file.)
- Using the device creation script you generate each night using the script in Appendix B,
recreate the devices you just dropped. (<filename>)
- Using the database creation script you generate each night using sp_help_revdatabase,
recreate the database(s) you dropped in step 1 using a for load option. (<filename>)
- Restore the database from the most recent full backup.
- Apply any transaction logs.
- Run a full battery of DBCCs (checkdb, newalloc, checkcatalog) on the restored database.
- Perform a full server backup.
- If replication is installed, remove replication for that database
- If the database is replicated, verify all replication components have been eliminated
- If the database is replicated, reinstall replication
- If the database is replicated, verify and test installation of all components
Corrupt msdb
You will need to restore from the most recent backup. After the restore is complete,
you must ensure that all of your tasks, alerts, and operators still exist and are working.
You can do this by recreating each of the tasks, alerts, and operators. A script for the
tasks is included in Appendix D.
- Recreate the msdb database by utilizing instmsdb.sql from the installation CD
- Restore from the most recent backup
Corrupt master
Having a corrupt master database is the most severe internal problem you can have in
SQL Server. This will require a full rebuild of the SQL Server. The process for doing this
is as follows:
- Run setup and execute a rebuild of master.
- When SQL Server completes the rebuild, place the server in single user mode.
- Restore the most recent backup of master.
- Verify that SQL Server is up and all databases are recognized.
- If all databases are recognized and available, run a few queries of random tables in
each database to verify.
- If master fails to restore cleanly
- Rebuild master
- Turn on allow updates
- BCP in the file from syslogins
- Turn off allow updates
- Do NOT attempt another restore of master and do NOT restore msdb
- Run script to recreate all dump devices
- Run script to recreate all tasks with the exception of replication tasks
- If everything checks out at this stage, restart SQL Server
- If replication is installed, remove replication for that database
- If the database is replicated, verify all replication components have been eliminated
- If the database is replicated, reinstall replication
- If the database is replicated, verify and test installation of all components
6.5 Disaster Recovery Plan 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18