Events
31 Mar, 11 pm - 2 Apr, 11 pm
The biggest SQL, Fabric and Power BI learning event. March 31 – April 2. Use code FABINSIDER to save $400.
Register todayThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Applies to:
SQL Server
A piecemeal restore sequence restores and recovers a database in stages at the filegroup level, starting with the primary and all read/write, secondary filegroups.
In this example, database adb
is restored to a new computer after a disaster. The database is using the simple recovery model. Before the disaster, all the filegroups are online. Filegroups A
and C
are read/write, and filegroup B
is read-only. Filegroup B
became read-only before the most recent partial backup, which contains the primary filegroup and the read/write secondary filegroups, A
and C
. After filegroup B
became read-only, a separate file backup of filegroup B
was taken.
Partial restore of the primary and filegroups A
and C
.
RESTORE DATABASE adb FILEGROUP='A',FILEGROUP='C'
FROM partial_backup
WITH PARTIAL, RECOVERY;
At this point, the primary and filegroups A
and C
are online. All files in filegroup B
are recovery pending, and the filegroup is offline.
Online restore of filegroup B
.
RESTORE DATABASE adb FILEGROUP='B' FROM backup WITH RECOVERY;
All filegroups are now online.
Example: Piecemeal Restore of Only Some Filegroups (Simple Recovery Model)
Example: Online Restore of a Read-Only File (Simple Recovery Model)
Example: Piecemeal Restore of Database (Full Recovery Model)
Example: Piecemeal Restore of Only Some Filegroups (Full Recovery Model)
Example: Online Restore of a Read-Write File (Full Recovery Model)
Example: Online Restore of a Read-Only File (Full Recovery Model)
Online Restore (SQL Server)
BACKUP (Transact-SQL)
RESTORE (Transact-SQL)
Piecemeal Restores (SQL Server)
Events
31 Mar, 11 pm - 2 Apr, 11 pm
The biggest SQL, Fabric and Power BI learning event. March 31 – April 2. Use code FABINSIDER to save $400.
Register todayTraining
Module
Back up and restore your Azure SQL database - Training
Learn how to protect the data in your Azure SQL database and recover from data loss or corruption with backup and restore.
Documentation
Piecemeal restore: full recovery model - SQL Server
This example shows a piecemeal restore in SQL Server of a database using the full recovery model, beginning with a tail-log backup.
Piecemeal restore: some filegroups (full recovery model) - SQL Server
This example shows a piecemeal restore of only some filegroups in SQL Server of a database using the full recovery model.
Online Restore (SQL Server) - SQL Server
In SQL Server Enterprise edition, in some cases, you can restore data by file, page, or piecemeal restore while a database remains online.