Upravit

Sdílet prostřednictvím


Restart an interrupted restore operation (Transact-SQL)

Applies to: SQL Server

This article explains how to restart an interrupted restore operation.

Restart an interrupted restore operation

  1. Execute the interrupted RESTORE statement again, specifying:

    • The same clauses used in the original RESTORE statement.
    • The RESTART clause.

Remarks

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.

Example

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

Next steps