Skip to content

Latest commit

 

History

History
57 lines (40 loc) · 3.59 KB

example-online-restore-of-a-read-only-file-simple-recovery-model.md

File metadata and controls

57 lines (40 loc) · 3.59 KB
title description author ms.author ms.date ms.service ms.subservice ms.topic helpviewer_keywords
Online restore: read-only file (simple recovery model)
This example shows an online restore in SQL Server of a read-only file for a database using the simple recovery model with multiple filegroups.
MashaMSFT
mathoma
03/14/2017
sql
backup-restore
conceptual
restore sequences [SQL Server], online
online restores [SQL Server], simple recovery model
simple recovery model [SQL Server], RESTORE examples

Example: Online Restore of a Read-Only File (Simple Recovery Model)

[!INCLUDE SQL Server]

This topic is relevant for [!INCLUDEssNoVersion] databases under the simple recovery model that contain a read-only filegroup. Under the simple recovery model, a read-only file can be restored online if a file backup exists that was taken since the file became read-only for the last time.

In this example, a database named adb contains three filegroups. Filegroup A is read/write, and filegroups B and C are read-only. Initially, all of the filegroups are online. A read-only file in filegroup B, b1, has to be restored. The database administrator can restore it by using a backup that was taken after the file became read-only. For the duration of the restore, filegroup B will be offline, but the remainder of the database will remain online.

Restore Sequence

Note

The syntax for an online restore sequence is the same as for an offline restore sequence.

To restore the file, the database administrator uses the following restore sequence:

RESTORE DATABASE adb FILE='b1' FROM filegroup_B_backup   
WITH RECOVERY  

The file is now online.

Additional Examples

See Also

Online Restore (SQL Server)
Piecemeal Restores (SQL Server)
File Restores (Simple Recovery Model)
Restore and Recovery Overview (SQL Server)
RESTORE (Transact-SQL)