Skip to content

Latest commit

 

History

History
60 lines (46 loc) · 2.31 KB

restart-an-interrupted-restore-operation-transact-sql.md

File metadata and controls

60 lines (46 loc) · 2.31 KB
title description author ms.author ms.reviewer ms.date ms.service ms.subservice ms.topic helpviewer_keywords
Restart interrupted restore operation
This example shows you how to restart an interrupted restore operation in SQL Server using Transact-SQL.
MashaMSFT
mathoma
randolphwest
08/04/2023
sql
backup-restore
conceptual
interrupted restore operation
restoring databases [SQL Server], restarting interrupted operation
resetting options changed after backup
database restores [SQL Server], restarting interrupted operation
restarting interrupted restore operation
restoring interrupted operation [SQL Server]

Restart an interrupted restore operation (Transact-SQL)

[!INCLUDE 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