Search
Home
Articles
Backup
Books
Certification
FAQ
Products
Replication
Scripts
Seminars
Training
TSQL

MSDN Fourms
Fort Worth SSUG
Oklahoma City SSDG

Resume

Champion Valley Pens

6.5 Disaster Recovery Plan 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18

If the above procedure does not work or a database was reset to suspect after you reset the status, you have corruption that has propagated to the user databases. You must fix this by the following procedure.
  1. From isql/w, drop the suspect database by using the DBCC dbrepair command
  2. Drop the devices the database was on. (This is another extremely good reason to have each of your databases on separate devices.)
  3. Open Windows Explorer and delete the physical .dat file for the device your just dropped in SQL Server. (No, SQL Server does not remove the file.)
  4. Using the device creation script you generate each night using the script in Appendix B, recreate the devices you just dropped. (<filename>)
  5. 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>)
  6. Restore the database from the most recent full backup.
  7. Apply any transaction logs.
  8. Run a full battery of DBCCs (checkdb, newalloc, checkcatalog) on the restored database.
  9. If replication is installed, remove replication for that database
  10. If the database is replicated, verify all replication components have been eliminated
  11. If the database is replicated, reinstall replication
  12. If the database is replicated, verify and test installation of all components
  13. Perform a full server backup.

Bad master backup

If the backup of master is bad, you still have some options. The procedure to recover the server is as follows:

  1. Rebuild master
  2. Make sure the server is in single user mode.
  3. Start isql/w and issue a disk reinit for each of the database devices you should have on the server. (You can get the needed information from the output of the disk init script included in Appendix B that you should be running each night.) (<filename>)
  4. Execute a disk refit.
  5. Stop and restart SQL Server.
  6. Your server should come back to life with all of the databases intact.
  7. Recreate each of the backup devices.
  8. Execute the script generated by the proc in Appendix D to recreate any tasks.
  9. Turn on allow updates and stop and restart SQL Server
  10. BCP in the output file from syslogins.
  11. Turn off allow updates
  12. Stop and start SQL Server
  13. If replication is installed, remove replication for that database
  14. If the database is replicated, verify all replication components have been eliminated
  15. If the database is replicated, reinstall replication
  16. 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

Michael R. Hotek

All content on this site, except where noted, represents an original work of Michael R. Hotek and is protected by applicable copyright laws. The SQL Server FAQ is the sole work of Neil Pike. No page, portion of a page, or download may be used for commercial purposes in whole or in part without the express, written permission of the applicable author.