Tuesday, 22 May 2012

Backup and Restore Interrupted Databases

Backup and Restore Interrupted Databases

Most of the times we face the issue of the BACKUP or the RESTORE operation terminating abnormally before completion. For instance look at the below example to understand the backup operation that stopped after 30 % of completion and RESTORE operation failed after 70% of completion

Problem :
BACKUP DATABASE MAXCLONE TO DISK = 'C:\MAXCLONE.BAK' WITH NOFORMAT, INIT, NOSKIP,STATS = 10

10 percent completed
20 percent completed
30 percent completed
.
.
.
..
Backup operation failed....


RESTORE DATABASE [MAXCLONE] FROM  DISK = 'C:\MAXCLONE.BAK' 
WITH NOUNLOAD, REPLACE,  STATS = 10


10 percent completed
20 percent completed
30 percent completed
40 percent completed
50 percent completed
60 percent completed
..
Restore Operation terminating abnormally....

Solution :
Reissue the commands with the keyword RESTART at the end as shown below....

BACKUP DATABASE MAXCLONE TO DISK = 'C:\MAXCLONE.BAK' WITH NOFORMAT, INIT, NOSKIP, RESTARTSTATS = 30


30 percent completed
80 percent completed
90 percent completed
.
.
Backup Database successfully processed 1549 pages ....



-- get backup information from backup file

RESTORE FILELIST FROM  DISK = 'C:\MAXCLONE.BAK'

-- restore the database

RESTORE DATABASE [MAXCLONE] FROM  DISK = 'C:\MAXCLONE.BAK'
WITH RESTART, NOUNLOAD, REPLACE,