備份至鏡像媒體集 (Transact-SQL)Back Up to a Mirrored Media Set (Transact-SQL)

適用於: 是SQL Server 否Azure SQL Database 否Azure Synapse Analytics (SQL DW) 否平行處理資料倉儲 APPLIES TO: yesSQL Server noAzure SQL Database noAzure Synapse Analytics (SQL DW) noParallel Data Warehouse

本主題描述在備份 SQL ServerSQL Server 資料庫時,如何使用 Transact-SQLTransact-SQL BACKUP 陳述式來指定鏡像媒體集。This topic describes how to use the Transact-SQLTransact-SQL BACKUP statement to specify a mirrored media set when backing up a SQL ServerSQL Server database. 請在 BACKUP 陳述式中,指定 TO 子句中的第一個鏡像。In your BACKUP statement, specify the first mirror in the TO clause. 然後在鏡像自身的 MIRROR TO 子句中指定每一個鏡像。Then, specify each mirror in its own MIRROR TO clause. TO 和 MIRROR TO 子句都必須指定相同的備份裝置數目和類型。The TO and MIRROR TO clauses must specify the same number and type of backup devices.

範例Example

下列範例會建立先前圖表中所闡述的鏡像媒體集,並將 AdventureWorks2012AdventureWorks2012 資料庫備份至兩個鏡像。The following example creates the mirrored media set illustrated in the previous illustration and backs up the AdventureWorks2012AdventureWorks2012 database to both mirrors.

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

從鏡像備份還原To restore from a mirrored backup

另請參閱See Also

BACKUP (Transact-SQL) BACKUP (Transact-SQL)
鏡像備份媒體集 (SQL Server)Mirrored Backup Media Sets (SQL Server)