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
Execute the interrupted
RESTORE
statement again, specifying:- The same clauses used in the original
RESTORE
statement. - The
RESTART
clause.
- The same clauses used in the original
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
Phản hồi
https://aka.ms/ContentUserFeedback.
Sắp ra mắt: Trong năm 2024, chúng tôi sẽ dần gỡ bỏ Sự cố với GitHub dưới dạng cơ chế phản hồi cho nội dung và thay thế bằng hệ thống phản hồi mới. Để biết thêm thông tin, hãy xem:Gửi và xem ý kiến phản hồi dành cho