Skip to content

Latest commit

 

History

History
37 lines (30 loc) · 1.75 KB

back-up-to-a-mirrored-media-set-transact-sql.md

File metadata and controls

37 lines (30 loc) · 1.75 KB
title description author ms.author ms.date ms.service ms.subservice ms.topic
Back Up to a Mirrored Media Set (Transact-SQL)
This article describes how to use the Transact-SQL BACKUP statement to specify a mirrored media set when backing up a SQL Server database.
MashaMSFT
mathoma
03/14/2017
sql
backup-restore
conceptual

Back Up to a Mirrored Media Set (Transact-SQL)

[!INCLUDE SQL Server] This topic describes how to use the [!INCLUDEtsql] BACKUP statement to specify a mirrored media set when backing up a [!INCLUDEssNoVersion] database. In your BACKUP statement, specify the first mirror in the TO clause. Then, specify each mirror in its own MIRROR TO clause. The TO and MIRROR TO clauses must specify the same number and type of backup devices.

Example

The following example creates the mirrored media set illustrated in the previous illustration and backs up the [!INCLUDEssSampleDBobject] database to both mirrors.

BACKUP DATABASE AdventureWorks2022  
TO TAPE = '\\.\tape0', TAPE = '\\.\tape1'  
MIRROR TO TAPE = '\\.\tape2', TAPE = '\\.\tape3'  
WITH  
    FORMAT,  
    MEDIANAME = 'AdventureWorks2022Set1';  
GO  

Related Tasks

To restore from a mirrored backup

See Also

BACKUP (Transact-SQL)
Mirrored Backup Media Sets (SQL Server)