Example: Piecemeal Restore of Database (Simple Recovery Model)
SQL Server 2005
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
AandC.
At this point, the primary and filegroupsRESTORE DATABASE adb FILEGROUP='A',FILEGROUP='C' FROM partial_backup WITH PARTIAL, RECOVERY;
AandCare online. All files in filegroupBare recovery pending, and the filegroup is offline.
-
Online restore of filegroup
B.
All filegroups are now online.RESTORE DATABASE adb FILEGROUP='B' FROM backup WITH RECOVERY;
Concepts
Performing Piecemeal RestoresOther Resources
BACKUP (Transact-SQL)Examples of Restore Sequences for Several Restore Scenarios
RESTORE (Transact-SQL)
