Every time I make a backup, as part of the procedure I do a restore to make sure the back up is okYou can always make a backup and go to it, only to find that the backup is bad (I actually have never seen that happen, but the job of a dba is to be a pessimist)I also create regression script to test out all of my sprocs. We use that also everytime we migrate code changes, but I guess you could use that as wellmake this part of your back up plansUSE [master]GO-- Check to see that the DB is in Good HealthDBCC CHECKDB ('<dbname>')GO-- Back up DB to a local drive on the server, not across the networkBACKUP DATABASE [<dbname>] TO DISK = N'<fp>\<servername>_<instancename>_<dbname>_D<yyyymmdd>_T<hhmiss>.BAK' WITH NOFORMAT, INIT, NAME = N'<dbnaem> Full Database Backup', SKIP, NOREWIND, NOUNLOAD, STATS = 10GO-- Run This next block through the VerifyDECLARE @backupSetId intSELECT @backupSetId = position FROM msdb..backupset WHERE database_name=N'<dbname>' AND backup_set_id=(select max(backup_set_id) from msdb..backupset where database_name=N'<dbname>' ) IF @backupSetId is null BEGIN raiserror(N'Verify failed. Backup information for database ''<dbname>'' not found.', 16, 1) ENDRESTORE VERIFYONLYFROM DISK = N'<fp>\<servername>_<instancename>_<dbname>_D<yyyymmdd>_T<hhmiss>.BAK' WITH FILE = @backupSetId, NOUNLOAD, NOREWINDGO-- Run this to test the back up. Once the Backup Verify is restored, go check the verify database-- Check for logical file names and locationsRESTORE FILELISTONLY FROM DISK = N'<fp>\<servername>_<instancename>_<dbname>_D<yyyymmdd>_T<hhmiss>.BAK' GO-- Test the BackupALTER DATABASE <dbname>_VERIFY SET SINGLE_USER WITH ROLLBACK IMMEDIATEGO-- Restore Database to VerifyRESTORE DATABASE <dbname>_VERIFYFROM DISK = N'<fp>\<servername>_<instancename>_<dbname>_D<yyyymmdd>_T<hhmiss>.BAK' WITH MOVE '<dbname>' TO '<fp DBFile>\<dbname>\<dbname>_VERIFY.MDF' , MOVE '<dbname>_LOG' TO '<fp DBFile>\<dbname>\<dbname>_VERIFY.LDF' , REPLACEGO-- Put the database into Multi user and read write modeALTER DATABASE <dbname>_VERIFY SET READ_WRITEALTER DATABASE <dbname>_VERIFY SET MULTI_USERGO-- Check out the Verify DB to make sure it looks good.USE [<dbname>_VERIFY]GO
Brett8-)Hint: Want your questions answered fast? Follow the direction in this linkhttp://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspxWant to help yourself?http://msdn.microsoft.com/en-us/library/ms130214.aspxhttp://weblogs.sqlteam.com/brettk/http://brettkaiser.blogspot.com/