| title | Restart interrupted restore operation | ||||||
|---|---|---|---|---|---|---|---|
| description | This example shows you how to restart an interrupted restore operation in SQL Server using Transact-SQL. | ||||||
| author | MashaMSFT | ||||||
| ms.author | mathoma | ||||||
| ms.reviewer | randolphwest | ||||||
| ms.date | 08/04/2023 | ||||||
| ms.service | sql | ||||||
| ms.subservice | backup-restore | ||||||
| ms.topic | how-to | ||||||
| helpviewer_keywords |
|
[!INCLUDE SQL Server]
This article explains how to restart an interrupted restore operation.
-
Execute the interrupted
RESTOREstatement again, specifying:- The same clauses used in the original
RESTOREstatement. - The
RESTARTclause.
- The same clauses used in the original
RESTORE ... WITH RESTART restarts the restore process. There's no resume option for an interrupted restore operation.
However, RESTART saves some time by skipping the analysis phase of database recovery, and in most cases, RESTART doesn't need to recreate the database files, which can save a significant amount of time for larger databases, especially if Instant File Initialization (IFI) isn't enabled.
This example restarts an interrupted restore operation, using the example AdventureWorks2022 database.
-- Restore a full database backup of the AdventureWorks database.
RESTORE DATABASE AdventureWorks2022
FROM DISK = 'C:\Temp\AdventureWorks2022.bak';
GO
-- The restore operation halted prematurely.
-- Repeat the original RESTORE statement specifying WITH RESTART.
RESTORE DATABASE AdventureWorks2022
FROM DISK = 'C:\Temp\AdventureWorks2022.bak'
WITH RESTART;
GO