RESTORE 陳述式 - 引數 (Transact-SQL)RESTORE Statements - Arguments (Transact-SQL)

本主題適用於:是SQL Server (從 2008 開始)否Azure SQL Database否Azure SQL 資料倉儲 否平行處理資料倉儲 THIS TOPIC APPLIES TO:yesSQL Server (starting with 2008)noAzure SQL DatabasenoAzure SQL Data Warehouse noParallel Data Warehouse

此主題說明 RESTORE {DATABASE|LOG} 陳述式及一組相關的輔助陳述式 (RESTORE FILELISTONLY、RESTORE HEADERONLY、RESTORE LABELONLY、RESTORE REWINDONLY 和 RESTORE VERIFYONLY) 之<語法>章節所描述的引數。This topic documents the arguments that are described in the Syntax sections of the RESTORE {DATABASE|LOG} statement and of the associated set of auxiliary statements: RESTORE FILELISTONLY, RESTORE HEADERONLY, RESTORE LABELONLY, RESTORE REWINDONLY, and RESTORE VERIFYONLY. 大部份引數都只得到這六個引數其中一部份的支援。Most of the arguments are supported by only a subset of these six statements. 在每個引數的描述中,都會指出引數所得到的支援。The support for each argument is indicated in the description of the argument.

主題連結圖示 Transact-SQL 語法慣例Topic link icon Transact-SQL Syntax Conventions

語法Syntax

如需語法的詳細資訊,請參閱下列主題:For syntax, see the following topics:

引數Arguments

DATABASEDATABASE
支援者: RESTORESupported by: RESTORE

指定目標資料庫。Specifies the target database. 如果指定了檔案和檔案群組清單,就只會還原這些檔案和檔案群組。If a list of files and filegroups is specified, only those files and filegroups are restored.

如果是使用完整或大量記錄復原模式的資料庫,在大部分情況下, SQL ServerSQL Server 都會要求您先備份記錄結尾,再還原資料庫。For a database using the full or bulk-logged recovery model, SQL ServerSQL Server requires in most cases that you back up the tail of the log before restoring the database. 除非 RESTORE DATABASE 陳述式包含 WITH REPLACE 或 WITH STOPAT 子句 (必須指定在資料備份結束之後發生的時間或交易),否則如果沒有先備份記錄結尾便還原資料庫,就會產生錯誤。Restoring a database without first backing up the tail of the log results in an error, unless the RESTORE DATABASE statement contains either the WITH REPLACE or the WITH STOPAT clause, which must specify a time or transaction that occurred after the end of the data backup. 如需結尾記錄備份的詳細資訊,請參閱結尾記錄備份 (SQL Server)For more information about tail-log backups, see Tail-Log Backups (SQL Server).

LOGLOG
支援者: RESTORESupported by: RESTORE

指定要將交易記錄備份套用在這個資料庫上。Specifies that a transaction log backup is to be applied to this database. 您必須依照順序來套用交易記錄。Transaction logs must be applied in sequential order. SQL ServerSQL Server 會檢查備份的交易記錄,以確保交易是依照正確順序載入正確的資料庫。 checks the backed up transaction log to ensure that the transactions are being loaded into the correct database and in the correct sequence. 若要套用多個交易記錄,請在所有還原作業上使用 NORECOVERY 選項,但最後一項還原作業除外。To apply multiple transaction logs, use the NORECOVERY option on all restore operations except the last.

注意

最後還原的記錄通常是結尾記錄備份。Typically, the last log restored is the tail-log backup. 「結尾記錄備份」是在剛要還原資料庫之前 (通常是在資料庫作業失敗之後) 所建立的記錄備份。A tail-log backup is a log backup taken right before restoring a database, typically after a failure on the database. 從可能已損毀的資料庫中取得結尾記錄備份,可以擷取尚未備份的記錄 (記錄結尾) 來防止遺失工作。Taking a tail-log backup from the possibly damaged database prevents work loss by capturing the log that has not yet been backed up (the tail of the log). 如需詳細資訊,請參閱結尾記錄備份 (SQL Server)For more information, see Tail-Log Backups (SQL Server).

如需詳細資訊,請參閱套用交易記錄備份 (SQL Server)For more information, see Apply Transaction Log Backups (SQL Server).

{ database_name | @database_name_var}{ database_name | @database_name_var}
支援者: RESTORESupported by: RESTORE

這是記錄或完整資料庫要還原到其中的資料庫。Is the database that the log or complete database is restored into. 如果這個名稱是以變數 (@database_name_var) 的形式提供,您還可以將這個名稱指定為字串常數 (@database_name_var = database* name) ,或指定為字元字串資料類型的變數,但 **ntext* 或 text 資料類型除外。If supplied as a variable (@database_name_var), this name can be specified either as a string constant (@database_name_var = database* name) or as a variable of character string data type, except for the **ntext* or text data types.

<file_or_filegroup_or_page> [ ,...n ]<file_or_filegroup_or_page> [ ,...n ]
支援者: RESTORESupported by: RESTORE

指定要包括在 RESTORE DATABASE 或 RESTORE LOG 陳述式中的邏輯檔案或檔案群組或頁面的名稱。Specifies the name of a logical file or filegroup or page to include in a RESTORE DATABASE or RESTORE LOG statement. 您可以指定一份檔案或檔案群組的清單。You can specify a list of files or filegroups.

針對使用簡單復原模式的資料庫,只有當目標檔案或檔案群組是唯讀,或者這是 PARTIAL 還原 (會導致無用的檔案群組) 時,才能指定 FILE 和 FILEGROUP 選項。For a database that uses the simple recovery model, the FILE and FILEGROUP options are allowed only if the target files or filegroups are read only, or if this is a PARTIAL restore (which results in a defunct filegroup).

如果是使用完整或大量記錄復原模式的資料庫,在利用 RESTORE DATABASE 來還原一或多個檔案、檔案群組及 (或) 頁面之後,您必須將交易記錄套用在還原的資料所在的檔案上;套用記錄會使這些檔案與資料庫的其餘部分一致。For a database that uses the full or bulk-logged recovery model, after using RESTORE DATABASE to restore one or more files, filegroups, and/or pages, typically, you must apply the transaction log to the files containing the restored data; applying the log makes those files consistent with the rest of the database. 例外狀況如下:The exceptions to this are as follows:

  • 如果要還原的檔案在上次備份之前是唯讀的,便不需要套用交易記錄,RESTORE 陳述式會通知您這個情況。If the files being restored were read-only before they were last backed up—then a transaction log does not have to be applied, and the RESTORE statement informs you of this situation.

  • 備份包含主要檔案群組,且正在執行部分還原。If the backup contains the primary filegroup and a partial restore is being performed. 在這個情況下,不需要還原記錄,因為此時會從備份組中自動還原記錄。In this case, the restore log is not needed because the log is restored automatically from the backup set.

FILE = { logical_file_name_in_backup| @logical_file_name_in_backup_var}FILE = { logical_file_name_in_backup| @logical_file_name_in_backup_var}
命名要包括在資料庫還原中的檔案。Names a file to include in the database restore.

FILEGROUP = { logical_filegroup_name | @logical_filegroup_name_var }FILEGROUP = { logical_filegroup_name | @logical_filegroup_name_var }
命名要包括在資料庫還原中的檔案群組。Names a filegroup to include in the database restore.

注意: 只有在指定的檔案群組是唯讀的,且這是部分還原 (也就是使用 WITH PARTIAL) 時,才能在簡單復原模式中使用 FILEGROUP。Note FILEGROUP is allowed in simple recovery model only if the specified filegroup is read-only and this is a partial restore (that is, if WITH PARTIAL is used). 任何未還原的讀寫檔案群組都會標示為已解除功能,且以後無法還原到結果資料庫中。Any unrestored read-write filegroups are marked as defunct and cannot subsequently be restored into the resulting database.

READ_WRITE_FILEGROUPSREAD_WRITE_FILEGROUPS
選取所有讀寫檔案群組。Selects all read-write filegroups. 如果您有唯讀檔案群組要在讀寫檔案群組之後,在唯讀檔案群組之前還原,這個選項特別有用。This option is particularly useful when you have read-only filegroups that you want to restore after read-write filegroups before the read-only filegroups.

PAGE = 'file:page [ ,...* n* ]'PAGE = 'file:page [ ,...* n* ]'
指定要進行分頁還原 (只有使用完整或大量記錄復原模式的資料庫,才能支援分頁還原) 的一或多個頁面清單。Specifies a list of one or more pages for a page restore (which is supported only for databases using the full or bulk-logged recovery models). 其值如下:The values are as follows:

PAGEPAGE
指出一或多個檔案和頁面的清單。Indicates a list of one or more files and pages.

filefile
這是包含所要還原特定頁面之檔案的檔案識別碼。Is the file ID of the file containing a specific page to be restored.

pagepage
這是要在檔案中還原之頁面的頁面識別碼。Is the page ID of the page to be restored in the file.

nn
這是一個預留位置,表示可以指定多個頁面。Is a placeholder indicating that multiple pages can be specified.

在還原序列中,能夠還原到任何單一檔案的最大頁面數目是 1000。The maximum number of pages that can be restored into any single file in a restore sequence is 1000. 不過,如果檔案中有不少損毀的頁面,請考慮還原整個檔案,而不是還原頁面。However, if you have more than a small number of damaged pages in a file, consider restoring the whole file instead of the pages.

注意

分頁還原絕對不會復原。Page restores are never recovered.

如需分頁還原的詳細資訊,請參閱還原分頁 (SQL Server)For more information about page restore, see Restore Pages (SQL Server).

[ ,...n ][ ,...n ]
這是一個預留位置,表示可以在逗號分隔清單中指定多個檔案、檔案群組和頁面。Is a placeholder indicating that multiple files and filegroups and pages can be specified in a comma-separated list. 數目沒有限制。The number is unlimited.

FROM { <backup_device> [ ,...n ]| <database_snapshot> } 通常指定要還原備份的來源備份裝置。FROM { <backup_device> [ ,...n ]| <database_snapshot> } Typically, specifies the backup devices from which to restore the backup. 另外,您也可以在 RESTORE DATABASE 陳述式中,利用 FROM 子句來指定資料庫所要還原的資料庫快照集名稱,此時不能使用 WITH 子句。Alternatively, in a RESTORE DATABASE statement, the FROM clause can specify the name of a database snapshot to which you are reverting the database, in which case, no WITH clause is permitted.

如果省略 FROM 子句,就不會還原備份。If the FROM clause is omitted, the restore of a backup does not take place. 相反地,此時會復原資料庫。Instead, the database is recovered. 這可讓您復原已利用 NORECOVERY 選項來還原的資料庫,或切換到待命伺服器。This allows you to recover a database that has been restored with the NORECOVERY option or to switch over to a standby server. 如果省略 FROM 子句,就必須在 WITH 子句中指定 NORECOVERY、RECOVERY 或 STANDBY。If the FROM clause is omitted, NORECOVERY, RECOVERY, or STANDBY must be specified in the WITH clause.

<backup_device> [ ,...n ] 指定還原作業要用的邏輯或實體備份裝置。<backup_device> [ ,...n ] Specifies the logical or physical backup devices to use for the restore operation.

支援者: RESTORERESTORE FILELISTONLYRESTORE HEADERONLYRESTORE LABELONLYRESTORE REWINDONLY 以及 RESTORE VERIFYONLYSupported by: RESTORE, RESTORE FILELISTONLY, RESTORE HEADERONLY, RESTORE LABELONLY, RESTORE REWINDONLY, and RESTORE VERIFYONLY.

<backup_device>::= 指定備份作業要用的邏輯或實體備份裝置,如下所示:<backup_device>::= Specifies a logical or physical backup device to use for the backup operation, as follows:

{ logical_backup_device_name | @logical_backup_device_name_var } 這是用來還原資料庫的 sp_addumpdevice 所建立備份裝置的邏輯名稱,它必須遵照識別碼的規則。如果備份裝置名稱是以變數 (@logical_backup_device_name_var) 的方式來提供,您可以將這個名稱指定為字串常數 (@logical_backup_device_name_var = logical_backup_device_name),或指定為字元字串資料類型的變數,但 ntexttext 資料類型除外。{ logical_backup_device_name | @logical_backup_device_name_var } Is the logical name, which must follow the rules for identifiers, of the backup device(s) created by sp_addumpdevice from which the database is restored. If supplied as a variable (@logical_backup_device_name_var), the backup device name can be specified either as a string constant (@logical_backup_device_name_var = logical_backup_device_name) or as a variable of character string data type, except for the ntext or text data types.

{DISK | TAPE } = { 'physical_backup_device_name' | @physical_backup_device_name_var } 可讓您從具名磁碟或磁帶裝置還原備份。您應該用裝置的實際名稱 (例如,完整路徑和檔案名稱) 來指定磁碟和磁帶的裝置類型:DISK ='Z:\SQLServerBackups\AdventureWorks.bak'TAPE ='\\\\.\TAPE0'。如果備份裝置名稱是以變數 (@physical_backup_device_name_var) 的方式來指定,您可以將這個名稱指定為字串常數 (@physical_backup_device_name_var = '* physcial_backup_device_name'),或指定為字元字串資料類型的變數,但 **ntext* 或 text 資料類型除外。{DISK | TAPE } = { 'physical_backup_device_name' | @physical_backup_device_name_var } Allows backups to be restored from the named disk or tape device. The device types of disk and tape should be specified with the actual name (for example, complete path and file name) of the device: DISK ='Z:\SQLServerBackups\AdventureWorks.bak' or TAPE ='\\\\.\TAPE0'. If specified as a variable (@physical_backup_device_name_var), the device name can be specified either as a string constant (@physical_backup_device_name_var = '* physcial_backup_device_name') or as a variable of character string data type, except for the **ntext* or text data types.

如果所用的網路伺服器是用 UNC 名稱 (必須包含機器名稱),請指定磁碟裝置類型。If using a network server with a UNC name (which must contain machine name), specify a device type of disk. 如需如何使用通用命名慣例 (UNC) 名稱的詳細資訊,請參閱備份裝置 (SQL Server)For more information about how to use UNC names, see Backup Devices (SQL Server).

您用來執行 SQL ServerSQL Server 的帳戶,必須有遠端電腦或網路伺服器的 READ 存取權,才能執行 RESTORE 作業。The account under which you are running SQL ServerSQL Server must have READ access to the remote computer or network server in order to perform a RESTORE operation.

nn
這是一個預留位置,表示可以在逗號分隔清單中指定最多達 64 個備份裝置。Is a placeholder indicating that up to 64 backup devices may be specified in a comma-separated list.

還原序列所需要的備份裝置數目,是否與建立備份所屬的媒體集時所用的備份裝置數目相同,取決於還原作業是離線或在線上進行,如下所示:Whether a restore sequence requires as many backup devices as were used to create the media set to which the backups belong, depends on whether the restore is offline or online, as follows:

  • 如果是離線還原,用來還原備份的裝置可以比建立備份時所用的裝置少。Offline restore allows a backup to be restored using fewer devices than were used to create the backup.

  • 線上還原需要備份的所有備份裝置。Online restore requires all the backup devices of the backup. 試圖用較少的裝置來還原會失敗。An attempt to restore with fewer devices fails.

    例如,設想您已將資料庫備份在連接到伺服器的四部磁帶機中。For example, consider a case in which a database was backed up to four tape drives connected to the server. 線上還原會要求您將四個磁碟機連接到伺服器;離線還原則可讓您在機器只有不到四個磁碟機時還原備份。An online restore requires that you have four drives connected to the server; an offline restore allows you to restore the backup if there are less than four drives on the machine.

注意

當從鏡像媒體集中還原備份時,每個媒體家族只能指定單一鏡像。When you are restoring a backup from a mirrored media set, you can specify only a single mirror for each media family. 不過,如果有其他鏡像,當出現錯誤時,解決部分還原問題的速度會比較快。In the presence of errors, however, having the other mirrors enables some restore problems to be resolved quickly. 您可以利用另一個鏡像的對應磁碟區來替代損毀的媒體磁碟區。You can substitute a damaged media volume with the corresponding volume from another mirror. 請注意,如果是離線還原,您可以從比媒體家族少的裝置進行還原,但每個家族只會處理一次。Be aware that for offline restores you can restore from fewer devices than media families, but each family is processed only once.

<database_snapshot>::=<database_snapshot>::=
支援者: RESTORE DATABASESupported by: RESTORE DATABASE

DATABASE_SNAPSHOT =database_snapshot_nameDATABASE_SNAPSHOT =database_snapshot_name
將資料庫還原到 database_snapshot_name 所指定的資料庫快照集。Reverts the database to the database snapshot specified by database_snapshot_name. DATABASE_SNAPSHOT 選項只適用於完整的資料庫還原。The DATABASE_SNAPSHOT option is available only for a full database restore. 在還原作業中,資料庫快照集會取代完整資料庫備份。In a revert operation, the database snapshot takes the place of a full database backup.

還原作業需要指定的資料庫快照集是資料庫中的唯一資料庫快照集。A revert operation requires that the specified database snapshot is the only one on the database. 在還原作業期間,資料庫快照集和目的地資料庫都會標示為 In restoreDuring the revert operation, the database snapshot and the destination database and are both marked as In restore. 如需詳細資訊,請參閱 RESTORE DATABASE 中的<備註>一節。For more information, see the "Remarks" section in RESTORE DATABASE.

WITH 選項WITH Options

指定還原作業要用的選項。Specifies the options to be used by a restore operation. 如需哪些陳述式使用各個選項的摘要,請參閱這個主題稍後的<WITH 選項的支援摘要>一節。For a summary of which statements use each option, see "Summary of Support for WITH Options," later in this topic.

注意

這裡組織 WITH 選項的順序,與 RESTORE {DATABASE|LOG} 中<語法>一節的順序相同。WITH options are organized here in the same order as in the "Syntax" section in RESTORE {DATABASE|LOG}.

PARTIALPARTIAL
支援者: RESTORE DATABASESupported by: RESTORE DATABASE

指定部分還原作業,以還原主要檔案群組和任何指定的次要檔案群組。Specifies a partial restore operation that restores the primary filegroup and any specified secondary filegroup(s). PARTIAL 選項已隱含地選取主要檔案群組;不需要指定 FILEGROUP = 'PRIMARY'。The PARTIAL option implicitly selects the primary filegroup; specifying FILEGROUP = 'PRIMARY' is unnecessary. 若要還原次要檔案群組,您必須使用 FILE 選項或 FILEGROUP 選項明確指定檔案群組。To restore a secondary filegroup, you must explicitly specify the filegroup using the FILE option or FILEGROUP option.

在 RESTORE LOG 陳述式中,不得使用 PARTIAL 選項。The PARTIAL option is not allowed on RESTORE LOG statements.

PARTIAL 選項會啟動分次還原的初始階段,可讓您稍後再還原其餘的檔案群組。The PARTIAL option starts the initial stage of a piecemeal restore, which allows remaining filegroups to be restored at a later time. 如需詳細資訊,請參閱分次還原 (SQL Server)For more information, see Piecemeal Restores (SQL Server).

[ RECOVERY | NORECOVERY | STANDBY ][ RECOVERY | NORECOVERY | STANDBY ]
支援者: RESTORESupported by: RESTORE

RECOVERYRECOVERY
指示還原作業回復任何未認可的交易。Instructs the restore operation to roll back any uncommitted transactions. 在復原程序之後,資料庫便已備妥,可供使用。After the recovery process, the database is ready for use. 如果 NORECOVERY、RECOVERY 和 STANDBY 三者都沒有指定,預設值就是 RECOVERY。If neither NORECOVERY, RECOVERY, nor STANDBY is specified, RECOVERY is the default.

如果規劃了後續的 RESTORE 作業 (RESTORE LOG,或差異備份的 RESTORE DATABASE),就應該指定 NORECOVERY 或 STANDBY。If subsequent RESTORE operations (RESTORE LOG, or RESTORE DATABASE from differential) are planned, NORECOVERY or STANDBY should be specified instead.

當從舊版 SQL ServerSQL Server 還原備份組時,可能需要升級資料庫。When restoring backup sets from an earlier version of SQL ServerSQL Server, a database upgrade might be required. 當指定 WITH RECOVERY 時,會自動執行這項升級。This upgrade is performed automatically when WITH RECOVERY is specified. 如需詳細資訊,請參閱套用交易記錄備份 (SQL Server)For more information, see Apply Transaction Log Backups (SQL Server).

注意

如果省略 FROM 子句,就必須在 WITH 子句中指定 NORECOVERY、RECOVERY 或 STANDBY。If the FROM clause is omitted, NORECOVERY, RECOVERY, or STANDBY must be specified in the WITH clause.

NORECOVERYNORECOVERY
指示還原作業不回復任何未認可的交易。Instructs the restore operation to not roll back any uncommitted transactions. 如果稍後必須套用另一個交易記錄,請指定 NORECOVERY 或 STANDBY 選項。If another transaction log has to be applied later, specify either the NORECOVERY or STANDBY option. 如果 NORECOVERY、RECOVERY 和 STANDBY 三者都沒有指定,預設值就是 RECOVERY。If neither NORECOVERY, RECOVERY, nor STANDBY is specified, RECOVERY is the default. 在使用 NORECOVERY 選項的離線還原作業期間,無法使用資料庫。During an offline restore operation using the NORECOVERY option, the database is not usable.

若要還原資料庫備份和一或多個交易記錄,或每當需要多個 RESTORE 陳述式 (例如,還原完整資料庫備份,後面再接著差異資料庫備份) 時,除了最後一個 RESTORE 陳述式,RESTORE 需要所有 RESTORE 陳述式都使用 WITH NORECOVERY 選項。For restoring a database backup and one or more transaction logs or whenever multiple RESTORE statements are necessary (for example, when restoring a full database backup followed by a differential database backup), RESTORE requires the WITH NORECOVERY option on all but the final RESTORE statement. 最佳作法是在多步驟的還原序列中,在 ALL 陳述式上使用 WITH NORECOVERY,直到抵達所需要的復原點為止,之後,再使用專供復原的個別 RESTORE WITH RECOVERY 陳述式。A best practice is to use WITH NORECOVERY on ALL statements in a multi-step restore sequence until the desired recovery point is reached, and then to use a separate RESTORE WITH RECOVERY statement for recovery only.

當搭配檔案或檔案群組還原作業來使用時,NORECOVERY 會強制資料庫在還原作業之後,維持還原狀態。When used with a file or filegroup restore operation, NORECOVERY forces the database to remain in the restoring state after the restore operation. 在下列情況下,這非常有用:This is useful in either of these situations:

  • 正在執行還原指令碼,且始終在套用記錄。A restore script is being run and the log is always being applied.

  • 使用一系列檔案還原,且資料庫的用途並不是要能夠在兩項還原作業之間使用。A sequence of file restores is used and the database is not intended to be usable between two of the restore operations.

    在某些情況下,RESTORE WITH NORECOVERY 會將向前復原集向前捲動到足以與資料庫一致。In some cases RESTORE WITH NORECOVERY rolls the roll forward set far enough forward that it is consistent with the database. 在這種情況下,並不會進行回復,資料會依照這個選項的預期,維持離線狀態。In such cases, roll back does not occur and the data remains offline, as expected with this option. 不過, Database EngineDatabase Engine 會發出參考用訊息,說明此時可以利用 RECOVERY 選項來復原向前復原集。However, the Database EngineDatabase Engine issues an informational message that states that the roll-forward set can now be recovered by using the RECOVERY option.

STANDBY =standby_file_nameSTANDBY =standby_file_name
指定可供恢復復原效果的待命資料庫檔案。Specifies a standby file that allows the recovery effects to be undone. 離線還原可以使用 STANDBY 選項 (包括部分還原)。The STANDBY option is allowed for offline restore (including partial restore). 線上還原不允許使用這個選項。The option is disallowed for online restore. 試圖指定線上還原的 STANDBY 選項,會使還原作業失敗。Attempting to specify the STANDBY option for an online restore operation causes the restore operation to fail. 當資料庫需要升級時,不允許使用 STANDBY。STANDBY is also not allowed when a database upgrade is necessary.

待命資料庫檔案是用來保存 RESTORE WITH STANDBY 的恢復階段期間,所修改之分頁的「寫入時複製」前置影像。The standby file is used to keep a "copy-on-write" pre-image for pages modified during the undo pass of a RESTORE WITH STANDBY. 待命資料庫檔案可讓您在各次交易記錄還原作業之間,呼叫資料庫來進行唯讀存取,且可以搭配暖待命伺服器狀況或特殊復原狀況來使用,在這個狀況下,在各次記錄還原之間檢查資料庫會很有用。The standby file allows a database to be brought up for read-only access between transaction log restores and can be used with either warm standby server situations or special recovery situations in which it is useful to inspect the database between log restores. 在 RESTORE WITH STANDBY 作業之後,下一項 RESTORE 作業會自動刪除恢復檔案。After a RESTORE WITH STANDBY operation, the undo file is automatically deleted by the next RESTORE operation. 如果在下一項 RESTORE 作業之前,自動刪除這個待命資料庫檔案,就必須重新還原整個資料庫。If this standby file is manually deleted before the next RESTORE operation, then the entire database must be re-restored. 當資料庫在 STANDBY 狀態中,您應該如同任何其他資料庫檔案一樣,小心處理這個待命資料庫檔案。While the database is in the STANDBY state, you should treat this standby file with the same care as any other database file. 這個檔案不像其他資料庫檔案,只有在使用中的還原作業期間, Database EngineDatabase Engine 才會將這個檔案保持為開啟狀態。Unlike other database files, this file is only kept open by the Database EngineDatabase Engine during active restore operations.

standby_file_name 會指定一個待命資料庫檔案,這個檔案的位置儲存在資料庫記錄中。The standby_file_name specifies a standby file whose location is stored in the log of the database. 如果現有的檔案使用指定的名稱,就會覆寫檔案;否則, Database EngineDatabase Engine 會建立這個檔案。If an existing file is using the specified name, the file is overwritten; otherwise, the Database EngineDatabase Engine creates the file.

給定待命資料庫檔案的大小需求,會隨著還原作業期間,未認可的交易所產生的恢復動作量而不同。The size requirement of a given standby file depends on the volume of undo actions resulting from uncommitted transactions during the restore operation.

重要

如果指定的待命資料庫檔案名稱所在的磁碟機之可用磁碟空間已用完,還原作業就會停止。If free disk space is exhausted on the drive containing the specified standby file name, the restore operation stops.

如需 RECOVERY 和 NORECOVERY 的比較,請參閱 RESTORE 中的<備註>一節。For a comparison of RECOVERY and NORECOVERY, see the "Remarks" section in RESTORE.

LOADHISTORYLOADHISTORY
支援者: RESTORE VERIFYONLYSupported by: RESTORE VERIFYONLY

指定還原作業將資訊載入 msdb 記錄資料表中。Specifies that the restore operation loads the information into the msdb history tables. LOADHISTORY 選項會針對所驗證的單一備份組,將媒體集所儲存之 SQL ServerSQL Server 備份的相關資訊載入 msdb 資料庫的備份和還原記錄資料表中。The LOADHISTORY option loads information, for the single backup set being verified, about SQL ServerSQL Server backups stored on the media set to the backup and restore history tables in the msdb database. 如需記錄資料表的詳細資訊,請參閱系統資料表 (Transact-SQL)For more information about history tables, see System Tables (Transact-SQL).

<general_WITH_options> [ ,...n ]<general_WITH_options> [ ,...n ]

RESTORE DATABASE 和 RESTORE LOG 陳述式中支援一般的所有 WITH 選項。The general WITH options are all supported in RESTORE DATABASE and RESTORE LOG statements. 其中的某些選項也受到一或多個輔助陳述式所支援,如下所示。Some of these options are also supported by one or more auxiliary statements, as noted below.

還原作業選項Restore Operation Options

這些選項會影響還原作業的行為。These options affect the behavior of the restore operation.

MOVE 'logical_file_name_in_backup' TO 'operating_system_file_name' [ ...n ]MOVE 'logical_file_name_in_backup' TO 'operating_system_file_name' [ ...n ]
支援者: RESTORERESTORE VERIFYONLYSupported by: RESTORE and RESTORE VERIFYONLY

指定由 logical_file_name_in_backup 指定其邏輯名稱的資料或記錄檔,應該透過還原到 operating_system_file_name 所指定的位置來移動。Specifies that the data or log file whose logical name is specified by logical_file_name_in_backup should be moved by restoring it to the location specified by operating_system_file_name. 備份組中資料或記錄檔的邏輯檔案名稱,會與當初建立備份組時資料庫中的邏輯名稱相符。The logical file name of a data or log file in a backup set matches its logical name in the database when the backup set was created.

n 是預留位置,表示您可以指定其他 MOVE 陳述式。n is a placeholder indicating that you can specify additional MOVE statements. 針對您想要從備份組還原到新位置的每一個邏輯檔案指定 MOVE 陳述式。Specify a MOVE statement for every logical file you want to restore from the backup set to a new location. 根據預設,logical_file_name_in_backup 檔案會還原到它的原始位置。By default, the logical_file_name_in_backup file is restored to its original location.

注意

若要取得備份組中的邏輯檔清單,請使用 RESTORE FILELISTONLY。To obtain a list of the logical files from the backup set, use RESTORE FILELISTONLY.

如果利用 RESTORE 陳述式,將資料庫重新放置在相同的伺服器中,或將它複製到不同的伺服器中,您可能需要 MOVE 選項,才能重新放置資料庫檔案,以及避免與現有檔案發生衝突。If a RESTORE statement is used to relocate a database on the same server or copy it to a different server, the MOVE option might be necessary to relocate the database files and to avoid collisions with existing files.

當搭配 RESTORE LOG 來使用時,您只能利用 MOVE 選項來重新放置在還原的記錄所涵蓋的間隔期間加入的檔案。When used with RESTORE LOG, the MOVE option can be used only to relocate files that were added during the interval covered by the log being restored. 例如,如果記錄備份包含 file23 檔的新增檔案作業,您可以在 RESTORE LOG 上,利用 MOVE 選項來重新放置這個檔案。For example, if the log backup contains an add file operation for file file23, this file may be relocated using the MOVE option on RESTORE LOG.

SQL ServerSQL Server 快照集備份一起使用時,MOVE 選項只能用來在和原始 Blob 相同的儲存體帳戶內,將檔案重新配置到 Azure Blob。When used with SQL ServerSQL Server Snaphot Backup, the MOVE option can be used only to relocate files to an Azure blob within the same storage account as the original blob. MOVE 選項無法用來將快照集備份還原至本機檔案或不同的儲存體帳戶。The MOVE option cannot be used to restore the snapshot backup to a local file or to a different storage account.

如果您計畫將資料庫重新放置在相同的伺服器中,或將它複製到不同的伺服器時,使用 RESTORE VERIFYONLY 陳述式,您可能需要 MOVE 選項,才能確認目標有足夠的空間,以及識別與現有檔案可能發生的衝突。If a RESTORE VERIFYONLY statement is used when you plan to relocate a database on the same server or copy it to a different server, the MOVE option might be necessary to verify that sufficient space is available in the target and to identify potential collisions with existing files.

如需詳細資訊,請參閱 使用備份與還原複製資料庫For more information, see Copy Databases with Backup and Restore.

CREDENTIALCREDENTIAL
支援者: RESTORERESTORE FILELISTONLYRESTORE HEADERONLYRESTORE LABELONLYRESTORE VERIFYONLYSupported by: RESTORE, RESTORE FILELISTONLY, RESTORE HEADERONLY, RESTORE LABELONLY, and RESTORE VERIFYONLY.

適用於SQL Server 2012 (11.x)SQL Server 2012 (11.x) SP1 CU2 至 SQL Server 2017SQL Server 2017Applies to: SQL Server 2012 (11.x)SQL Server 2012 (11.x) SP1 CU2 through SQL Server 2017SQL Server 2017

只有在從 Microsoft Azure Blob 儲存體服務還原備份時使用。Used only when restoring a backup from the Microsoft Azure Blob storage service.

注意

使用 SQL Server 2012 (11.x)SQL Server 2012 (11.x) SP1 CU2 直到 SQL Server 2016 (13.x)SQL Server 2016 (13.x),從 URL 還原時,都只能從單一裝置還原。With SQL Server 2012 (11.x)SQL Server 2012 (11.x) SP1 CU2 until SQL Server 2016 (13.x)SQL Server 2016 (13.x), you can only restore from a single device when restoring from URL. 為了在從 URL 還原時能從多部裝置還原,您必須使用 SQL Server 2016 (13.x)SQL Server 2016 (13.x)目前的版本,而且必須使用共用存取簽章 (SAS) 權杖。In order to restore from multiple devices when restoring from URL you must use SQL Server 2016 (13.x)SQL Server 2016 (13.x) through current version) and you must use Shared Access Signature (SAS) tokens. 如需詳細資訊,請參閱啟用 SQL Server Managed Backup to Microsoft Azure在 Azure 儲存體上使用 Powershell 搭配共用存取簽章 (SAS) 權杖來簡化 SQL 認證的建立 (英文)。For more information, see Enable SQL Server Managed Backup to Microsoft Azure and Simplifying creation of SQL Credentials with Shared Access Signature ( SAS ) tokens on Azure Storage with Powershell.

REPLACEREPLACE
支援者: RESTORESupported by: RESTORE

指定即使已有另一個同名資料庫存在, SQL ServerSQL Server 仍應該建立指定的資料庫及其相關檔案。Specifies that SQL ServerSQL Server should create the specified database and its related files even if another database already exists with the same name. 在這種情況下,會刪除現有的資料庫。In such a case, the existing database is deleted. 如果沒有指定 REPLACE 選項,就會進行安全檢查。When the REPLACE option is not specified, a safety check occurs. 這樣可避免意外覆寫不同的資料庫。This prevents overwriting a different database by accident. 這項安全檢查可確保在同時發生下列兩種狀況時,RESTORE DATABASE 陳述式不會將資料庫還原到目前的伺服器中:The safety check ensures that the RESTORE DATABASE statement does not restore the database to the current server if the following conditions both exist:

  • RESTORE 陳述式所指定的資料庫已在目前的伺服器中,且The database named in the RESTORE statement already exists on the current server, and

  • 資料庫名稱不是備份組所記錄的資料庫名稱。The database name is different from the database name recorded in the backup set.

    另外,REPLACE 也可讓 RESTORE 覆寫無法確認為屬於還原中之資料庫的現有檔案。REPLACE also allows RESTORE to overwrite an existing file that cannot be verified as belonging to the database being restored. RESTORE 通常會拒絕覆寫先前已存在的檔案。Normally, RESTORE refuses to overwrite pre-existing files. 您也可以依照 RESTORE LOG 選項的相同方式來使用 WITH REPLACE。WITH REPLACE can also be used in the same way for the RESTORE LOG option.

    REPLACE 也覆寫了在還原資料庫之前,您必須先備份記錄結尾的需求。REPLACE also overrides the requirement that you back up the tail of the log before restoring the database.

    如需使用 REPLACE 選項所造成之影響的詳細資訊,請參閱 RESTORE (Transact-SQL)For information the impact of using the REPLACE option, see RESTORE (Transact-SQL).

RESTARTRESTART
支援者: RESTORESupported by: RESTORE

指定 SQL ServerSQL Server 應該重新啟動已中斷的還原作業。Specifies that SQL ServerSQL Server should restart a restore operation that has been interrupted. RESTART 會在中斷點上,重新啟動還原作業。RESTART restarts the restore operation at the point it was interrupted.

RESTRICTED_USERRESTRICTED_USER
支援者: RESTORESupported by: RESTORE.

限制 db_ownerdbcreatorsysadmin 等角色的成員才能存取新還原的資料庫。Restricts access for the newly restored database to members of the db_owner, dbcreator, or sysadmin roles. RESTRICTED_USER 會取代 DBO_ONLY 選項。RESTRICTED_USER replaces the DBO_ONLY option. SQL Server 2008SQL Server 2008 已停止 DBO_ONLY。DBO_ONLY has been discontinued with SQL Server 2008SQL Server 2008.

請搭配 RECOVERY 選項來使用這個項目。Use with the RECOVERY option.

備份組選項Backup Set Options

這些選項會在包含要還原之備份的備份組上運作。These options operate on the backup set containing the backup to be restored.

FILE ={ backup_set_file_number | @backup_set_file_number }FILE ={ backup_set_file_number | @backup_set_file_number }
支援者: RESTORERESTORE FILELISTONLYRESTORE HEADERONLYRESTORE VERIFYONLYSupported by: RESTORE, RESTORE FILELISTONLY, RESTORE HEADERONLY, and RESTORE VERIFYONLY.

識別要還原的備份組。Identifies the backup set to be restored. 例如, backup_set_file_number1 ,表示備份媒體的第一個備份組; backup_set_file_number2 ,表示第二個備份組。For example, a backup_set_file_number of 1 indicates the first backup set on the backup medium and a backup_set_file_number of 2 indicates the second backup set. 您可以使用 RESTORE HEADERONLY 陳述式來取得備份組的 backup_set_file_numberYou can obtain the backup_set_file_number of a backup set by using the RESTORE HEADERONLY statement.

當未指定時,預設值是 1,但 RESTORE HEADERONLY 除外,在此案例中會處理媒體集中的所有備份組。When not specified, the default is 1, except for RESTORE HEADERONLY in which case all backup sets in the media set are processed. 如需詳細資訊,請參閱本主題稍後的「指定備份組」。For more information, see "Specifying a Backup Set," later in this topic.

重要

這個 FILE 選項和用來指定資料庫檔案的 FILE 選項無關,FILE = { logical_file_name_in_backup | @logical_file_name_in_backup_var }。This FILE option is unrelated to the FILE option for specifying a database file, FILE = { logical_file_name_in_backup | @logical_file_name_in_backup_var }.

PASSWORD = { password | @password_variable }PASSWORD = { password | @password_variable }
支援者: RESTORERESTORE FILELISTONLYRESTORE HEADERONLYRESTORE VERIFYONLYSupported by: RESTORE, RESTORE FILELISTONLY, RESTORE HEADERONLY, and RESTORE VERIFYONLY.

提供備份組的密碼。Supplies the password of the backup set. 備份組密碼是一個字元字串。A backup-set password is a character string.

注意

這項功能處於維護模式,並可能在 Microsoft SQL Server 的未來版本中移除。This feature is in maintenance mode and may be removed in a future version of Microsoft SQL Server. 請避免在新的開發工作中使用這項功能,並規劃修改目前使用這項功能的應用程式。Avoid using this feature in new development work, and plan to modify applications that currently use this feature.

如果建立備份組時指定了密碼,您就必須提供密碼,才能從備份組中執行任何還原作業。If a password was specified when the backup set was created, that password is required to perform any restore operation from the backup set. 指定錯誤密碼,或備份組沒有密碼,卻指定了密碼,都是錯誤。It is an error to specify the wrong password or to specify a password if the backup set does not have one.

重要

這個密碼只為媒體集提供弱的保護。This password provides only weak protection for the media set. 如需詳細資訊,請參閱相關陳述式的<權限>一節。For more information, see the Permissions section for the relevant statement.

媒體集選項Media Set Options

這些選項會處理整個媒體集。These options operate on the media set as a whole.

MEDIANAME = { media_name | @media_name_variable}MEDIANAME = { media_name | @media_name_variable}
支援者: RESTORERESTORE FILELISTONLYRESTORE HEADERONLYRESTORE LABELONLYRESTORE VERIFYONLYSupported by: RESTORE, RESTORE FILELISTONLY, RESTORE HEADERONLY, RESTORE LABELONLY, and RESTORE VERIFYONLY.

指定媒體的名稱。Specifies the name for the media. 如果提供的話,媒體名稱必須符合備份磁碟區中的媒體名稱;否則,還原作業會終止。If provided, the media name must match the media name on the backup volumes; otherwise, the restore operation terminates. 如果 RESTORE 陳述式中沒有媒體名稱,就不會檢查備份磁碟區中的相符媒體名稱。If no media name is given in the RESTORE statement, the check for a matching media name on the backup volumes is not performed.

重要

在備份和還原作業中使用一致的媒體名稱,可以為還原作業所選的媒體提供額外的安全檢查。Consistently using media names in backup and restore operations provides an extra safety check for the media selected for the restore operation.

MEDIAPASSWORD = { mediapassword | @mediapassword_variable }MEDIAPASSWORD = { mediapassword | @mediapassword_variable }
支援者: RESTORERESTORE FILELISTONLYRESTORE HEADERONLYRESTORE LABELONLYRESTORE VERIFYONLYSupported by: RESTORE, RESTORE FILELISTONLY, RESTORE HEADERONLY, RESTORE LABELONLY, and RESTORE VERIFYONLY.

提供媒體集的密碼。Supplies the password of the media set. 媒體集密碼是一個字元字串。A media-set password is a character string.

注意

這項功能處於維護模式,並可能在 Microsoft SQL Server 的未來版本中移除。This feature is in maintenance mode and may be removed in a future version of Microsoft SQL Server. 請避免在新的開發工作中使用這項功能,並規劃修改目前使用這項功能的應用程式。Avoid using this feature in new development work, and plan to modify applications that currently use this feature.

如果在格式化媒體集時提供了密碼,就必須使用這個密碼,才能存取媒體集中的任何備份組。If a password was provided when the media set was formatted, that password is required to access any backup set on the media set. 指定錯誤密碼,或媒體集沒有密碼,卻指定了密碼,都是錯誤。It is an error to specify the wrong password or to specify a password if the media set does not have any.

重要

這個密碼只為媒體集提供弱的保護。This password provides only weak protection for the media set. 如需詳細資訊,請參閱相關陳述式的<權限>一節。For more information, see the "Permissions" section for the relevant statement.

BLOCKSIZE = { blocksize | @blocksize_variable }BLOCKSIZE = { blocksize | @blocksize_variable }
支援者: RESTORESupported by: RESTORE

指定實體區塊大小 (以位元組為單位)。Specifies the physical block size, in bytes. 支援的大小為 512、1024、2048、4096、8192、16384、32768 和 65536 (64 KB) 位元組。The supported sizes are 512, 1024, 2048, 4096, 8192, 16384, 32768, and 65536 (64 KB) bytes. 磁帶裝置的預設值為 65536,其他裝置則為 512。The default is 65536 for tape devices and 512 otherwise. 一般而言這個選項是不必要的,因為 RESTORE 會自動選取裝置適用的區塊大小。Typically, this option is unnecessary because RESTORE automatically selects a block size that is appropriate to the device. 明確指出區塊大小會覆寫自動選取的區塊大小。Explicitly stating a block size overrides the automatic selection of block size.

如果您要從 CD-ROM 還原備份,請指定 BLOCKSIZE=2048。If you are restoring a backup from a CD-ROM, specify BLOCKSIZE=2048.

注意

一般而言,只有從磁帶裝置讀取時,這個選項才會對效能造成影響。This option typically affects performance only when reading from tape devices.

資料傳送選項Data Transfer Options

這些選項可讓您從備份裝置最佳化資料傳送。The options enable you to optimize data transfer from the backup device.

BUFFERCOUNT = { buffercount | @buffercount_variable }BUFFERCOUNT = { buffercount | @buffercount_variable }
支援者: RESTORESupported by: RESTORE

指定要用於還原作業的 I/O 緩衝區總數。Specifies the total number of I/O buffers to be used for the restore operation. 您可以指定任何正整數,不過,緩衝區的數目很大時,可能會因為 Sqlservr.exe 處理序中的虛擬位址空間不足而造成「記憶體不足」錯誤。You can specify any positive integer; however, large numbers of buffers might cause "out of memory" errors because of inadequate virtual address space in the Sqlservr.exe process.

緩衝區使用的總空間可由下列公式判斷:*buffercount******* maxtransfersize*。The total space used by the buffers is determined by: *buffercount******* maxtransfersize*.

MAXTRANSFERSIZE = { maxtransfersize | @maxtransfersize_variable }MAXTRANSFERSIZE = { maxtransfersize | @maxtransfersize_variable }
支援者: RESTORESupported by: RESTORE

以位元組為單位,指定要用於備份媒體與 SQL ServerSQL Server 之間的最大傳送單位。Specifies the largest unit of transfer in bytes to be used between the backup media and SQL ServerSQL Server. 可能的值是 65536 位元組 (64 KB) 的倍數,最大可達 4194304 位元組 (4 MB)。The possible values are multiples of 65536 bytes (64 KB) ranging up to 4194304 bytes (4 MB).

注意

當資料庫已設定 FILESTREAM,或包括記憶體內 OLTP 檔案群組時,MAXTRANSFERSIZE 在還原時應該大於或等於備份建立時使用的大小。When the database has configured FILESTREAM, or includes or In-Memory OLTP File Groups, MAXTRANSFERSIZE at the time of restore should be greater than or equal to what was used when the backup was created.

錯誤管理選項Error Management Options

這些選項可讓您決定還原作業是否要啟用備份總和檢查碼,以及作業在發生錯誤時是否要停止。These options allow you to determine whether backup checksums are enabled for the restore operation and whether the operation stops on encountering an error.

{ CHECKSUM | NO_CHECKSUM }{ CHECKSUM | NO_CHECKSUM }
支援者: RESTORERESTORE FILELISTONLYRESTORE HEADERONLYRESTORE LABELONLYRESTORE VERIFYONLYSupported by: RESTORE, RESTORE FILELISTONLY, RESTORE HEADERONLY, RESTORE LABELONLY, and RESTORE VERIFYONLY.

預設行為是,如果有總和檢查碼,便驗證總和檢查碼,如果沒有,就不檢查,繼續作業。The default behavior is to verify checksums if they are present and proceed without verification if they are not present.

CHECKSUMCHECKSUM
指定必須驗證備份總和檢查碼,如果備份沒有備份總和檢查碼,還原作業便會失敗,且會出現一則訊息,指出總和檢查碼不存在。Specifies that backup checksums must be verified and, if the backup lacks backup checksums, causes the restore operation to fail with a message indicating that checksums are not present.

注意

只有在使用備份總和檢查碼時,頁面總和檢查碼才會與備份作業相關。Page checksums are relevant to backup operations only if backup checksums are used.

依預設,在發現無效的總和檢查碼時,RESTORE 會報告一則總和檢查碼錯誤,且會停止作業。By default, on encountering an invalid checksum, RESTORE reports a checksum error and stops. 不過,如果您指定 CONTINUE_AFTER_ERROR,在損毀狀況可接受的情況下,RESTORE 會在傳回總和檢查碼錯誤和無效總和檢查碼所在頁碼之後,繼續作業。However, if you specify CONTINUE_AFTER_ERROR, RESTORE proceeds after returning a checksum error and the number of the page containing the invalid checksum, if the corruption permits.

如需使用備份總和檢查碼的詳細資訊,請參閱在備份和還原期間的可能媒體錯誤 (SQL Server)For more information about working with backup checksums, see Possible Media Errors During Backup and Restore (SQL Server).

NO_CHECKSUMNO_CHECKSUM
明確停用還原作業的總和檢查碼驗證。Explicitly disables the validation of checksums by the restore operation.

{ STOP_ON_ERROR | CONTINUE_AFTER_ERROR }{ STOP_ON_ERROR | CONTINUE_AFTER_ERROR }
支援者: RESTORERESTORE FILELISTONLYRESTORE HEADERONLYRESTORE LABELONLYRESTORE VERIFYONLYSupported by: RESTORE, RESTORE FILELISTONLY, RESTORE HEADERONLY, RESTORE LABELONLY, and RESTORE VERIFYONLY.

STOP_ON_ERRORSTOP_ON_ERROR
指定在發生第一個錯誤之後,便停止還原作業。Specifies that the restore operation stops with the first error encountered. 這是 RESTORE 的預設行為,但預設值是 CONTINUE_AFTER_ERROR 的 VERIFYONLY 除外。This is the default behavior for RESTORE, except for VERIFYONLY which has CONTINUE_AFTER_ERROR as the default.

CONTINUE_AFTER_ERRORCONTINUE_AFTER_ERROR
指定在發生錯誤之後,還原作業繼續運作。Specifies that the restore operation is to continue after an error is encountered.

如果備份包含損毀的頁面,您最好利用不含錯誤的替代備份 (像是在頁面損毀之前所取得的備份) 來重複還原作業。If a backup contains damaged pages, it is best to repeat the restore operation using an alternative backup that does not contain the errors—for example, a backup taken before the pages were damaged. 不過,您也可以利用還原陳述式的 CONTINUE_AFTER_ERROR 選項來還原損毀的備份,嘗試搶救這些資料,做為最後的手段。As a last resort, however, you can restore a damaged backup using the CONTINUE_AFTER_ERROR option of the restore statement and try to salvage the data.

FILESTREAM 選項FILESTREAM Options

FILESTREAM ( DIRECTORY_NAME =directory_name )FILESTREAM ( DIRECTORY_NAME =directory_name )
支援者: RESTORERESTORE VERIFYONLYSupported by: RESTORE and RESTORE VERIFYONLY

適用於SQL Server 2012 (11.x)SQL Server 2012 (11.x)SQL Server 2017SQL Server 2017Applies to: SQL Server 2012 (11.x)SQL Server 2012 (11.x) through SQL Server 2017SQL Server 2017

Windows 相容的目錄名稱。A windows-compatible directory name. SQL ServerSQL Server 執行個體的所有資料庫層級 FILESTREAM 目錄名稱之間,此名稱必須是唯一的。This name should be unique among all the database-level FILESTREAM directory names in the SQL ServerSQL Server instance. 不論 SQL ServerSQL Server 定序設定為何,唯一性比較不區分大小寫。Uniqueness comparison is done in a case-insensitive fashion, regardless of SQL ServerSQL Server collation settings.

監視選項Monitoring Options

這些選項可讓您從備份裝置監視資料傳送。These options enable you to monitor the transfer of data transfer from the backup device.

STATS [ = percentage ]STATS [ = percentage ]
支援者: RESTORERESTORE VERIFYONLYSupported by: RESTORE and RESTORE VERIFYONLY

每次另一個百分比完成時,便顯示一則訊息,用來量測進度。Displays a message each time another percentage completes, and is used to gauge progress. 如果省略 percentage,每完成約 10%, SQL ServerSQL Server 都會顯示一則訊息。If percentage is omitted, SQL ServerSQL Server displays a message after each 10 percent is completed (approximately).

STATS 選項報告到達下一個間隔之報告臨界值的完成百分比。The STATS option reports the percentage complete as of the threshold for reporting the next interval. 這項作業大略是以指定的百分比來進行;例如,當 STATS=10 時, Database EngineDatabase Engine 會大約依照這個間隔來進行報告;例如,當實際的精確百分比為 40% 時,這個選項可能會顯示 43%。This is at approximately the specified percentage; for example, with STATS=10, the Database EngineDatabase Engine reports at approximately that interval; for instance, instead of displaying precisely 40%, the option might display 43%. 對大型備份組而言,這不成問題,因為在已完成的 I/O 呼叫之間,百分比完成的移動非常緩慢。For large backup sets, this is not a problem because the percentage complete moves very slowly between completed I/O calls.

磁帶選項Tape Options

這些選項僅適用於「磁帶」裝置。These options are used only for TAPE devices. 如果所使用的不是磁帶裝置,將忽略這些選項。If a nontape device is being used, these options are ignored.

{ REWIND | NOREWIND }{ REWIND | NOREWIND }
這些選項僅適用於「磁帶」裝置。These options are used only for TAPE devices. 如果所使用的不是磁帶裝置,將忽略這些選項。If a non-tape device is being used, these options are ignored.

REWINDREWIND
支援者: RESTORERESTORE FILELISTONLYRESTORE HEADERONLYRESTORE LABELONLYRESTORE VERIFYONLYSupported by: RESTORE, RESTORE FILELISTONLY, RESTORE HEADERONLY, RESTORE LABELONLY, and RESTORE VERIFYONLY.

指定 SQL ServerSQL Server 將釋放和倒轉磁帶。Specifies that SQL ServerSQL Server release and rewind the tape. REWIND 是預設值。REWIND is the default.

NOREWINDNOREWIND
支援者: RESTORERESTORE VERIFYONLYSupported by: RESTORE and RESTORE VERIFYONLY

在任何其他 RESTORE 陳述式中指定 NOREWIND,都會產生錯誤。Specifying NOREWIND in any other restore statement generates an error.

指定 SQL ServerSQL Server 將會在備份作業之後,讓磁帶維持在開啟狀態。Specifies that SQL ServerSQL Server will keep the tape open after the backup operation. 對磁帶執行多次備份作業時,可以使用這個選項來改進效能。You can use this option to improve performance when performing multiple backup operations to a tape.

NOREWIND 隱含 NOUNLOAD,而這些選項無法相容於單一的 RESTORE 陳述式。NOREWIND implies NOUNLOAD, and these options are incompatible within a single RESTORE statement.

注意

如果您使用 NOREWIND,則 SQL ServerSQL Server 的執行個體會保有磁帶機的擁有權,直到在相同處理序中執行的 BACKUP 或 RESTORE 陳述式使用 REWIND 或 UNLOAD 選項,或是伺服器執行個體關閉為止。If you use NOREWIND, the instance of SQL ServerSQL Server retains ownership of the tape drive until a BACKUP or RESTORE statement running in the same process uses either the REWIND or UNLOAD option, or the server instance is shut down. 保留磁帶的開啟狀態可以防止其他處理序存取這個磁帶。Keeping the tape open prevents other processes from accessing the tape. 如需如何顯示開啟的磁帶清單及關閉開啟的磁帶之詳細資訊,請參閱備份裝置 (SQL Server)For information about how to display a list of open tapes and to close an open tape, see Backup Devices (SQL Server).

{ UNLOAD | NOUNLOAD }{ UNLOAD | NOUNLOAD }
支援者: RESTORERESTORE FILELISTONLYRESTORE HEADERONLYRESTORE LABELONLYRESTORE REWINDONLY 以及 RESTORE VERIFYONLYSupported by: RESTORE, RESTORE FILELISTONLY, RESTORE HEADERONLY, RESTORE LABELONLY, RESTORE REWINDONLY, and RESTORE VERIFYONLY.

這些選項僅適用於「磁帶」裝置。These options are used only for TAPE devices. 如果所使用的不是磁帶裝置,將忽略這些選項。If a non-tape device is being used, these options are ignored.

注意

UNLOAD/NOUNLOAD 是工作階段設定,在工作階段的存留期間會一直保持不變,直到指定其他設定來進行重設為止。UNLOAD/NOUNLOAD is a session setting that persists for the life of the session or until it is reset by specifying the alternative.

UNLOADUNLOAD
指定在備份完成之後,便自動倒轉和卸載磁帶。Specifies that the tape is automatically rewound and unloaded when the backup is finished. UNLOAD 是在工作階段開始時的預設值。UNLOAD is the default when a session begins.

NOUNLOADNOUNLOAD
指定在 RESTORE 作業之後,磁帶仍會在磁帶機上保持載入。Specifies that after the RESTORE operation the tape remains loaded on the tape drive.

<replication_WITH_option><replication_WITH_option>

只有在建立備份時複寫了資料庫,這個選項才會相關。This option is relevant only if the database was replicated when the backup was created.

KEEP_REPLICATIONKEEP_REPLICATION
支援者: RESTORESupported by: RESTORE

當設定複寫來處理記錄傳送時,請使用 KEEP_REPLICATION。Use KEEP_REPLICATION when setting up replication to work with log shipping. 它可防止在暖待命伺服器中還原資料庫備份或記錄備份時,或在復原資料庫時,移除複寫設定。It prevents replication settings from being removed when a database backup or log backup is restored on a warm standby server and the database is recovered. 不允許使用 NORECOVERY 選項還原備份時,請指定這個選項。Specifying this option when restoring a backup with the NORECOVERY option is not permitted. 若要確定在還原之後,複寫能夠正常運作,請執行下列動作:To ensure replication functions properly after restore:

  • 暖待命伺服器的 msdbmaster 資料庫必須與主要伺服器的 msdbmaster 資料庫同步。The msdb and master databases at the warm standby server must be in sync with the msdb and master databases at the primary server.

  • 必須重新命名暖待命伺服器,使用與主要伺服器相同的名稱。The warm standby server must be renamed to use the same name as the primary server.

<change_data_capture_WITH_option><change_data_capture_WITH_option>

只有在建立備份時,資料庫啟用了異動資料擷取,這個選項才會相關。This option is relevant only if the database was enabled for change data capture when the backup was created.

KEEP_CDCKEEP_CDC
支援者: RESTORESupported by: RESTORE

KEEP_CDC 應該用來防止在另一部伺服器中還原資料庫備份或記錄備份時,或在復原資料庫時,移除異動資料擷取設定。KEEP_CDC should be used to prevent change data capture settings from being removed when a database backup or log backup is restored on another server and the database is recovered. 不允許使用 NORECOVERY 選項還原備份時,請指定這個選項。Specifying this option when restoring a backup with the NORECOVERY option is not permitted.

使用 KEEP_CDC 來還原資料庫不會建立異動資料擷取作業。Restoring the database with KEEP_CDC does not create the change data capture jobs. 若要在還原資料庫之後擷取記錄檔中的變更,請針對已還原的資料庫重新建立擷取程序作業和清除作業。To extract changes from the log after restoring the database, recreate the capture process job and the cleanup job for the restored database. 如需詳細資訊,請參閱 sys.sp_cdc_add_job (Transact-SQL)For information, see sys.sp_cdc_add_job (Transact-SQL).

如需如何搭配資料庫鏡像使用異動資料擷取的詳細資訊,請參閱異動資料擷取和其他 SQL Server 功能For information about using change data capture with database mirroring, see Change Data Capture and Other SQL Server Features.

<service_broker_WITH_options><service_broker_WITH_options>

開啟或關閉 Service BrokerService Broker 訊息傳遞,或設定新的 Service BrokerService Broker 識別碼。Turns Service BrokerService Broker message delivery on or off or sets a new Service BrokerService Broker identifier. 只有在建立備份時,資料庫啟用 (啟動) 了 Service BrokerService Broker,這個選項才會相關。This option is relevant only if Service BrokerService Broker was enabled (activated) for the database when the backup was created.

{ ENABLE_BROKER | ERROR_BROKER_CONVERSATIONS | NEW_BROKER }{ ENABLE_BROKER | ERROR_BROKER_CONVERSATIONS | NEW_BROKER }
支援者: RESTORE DATABASESupported by: RESTORE DATABASE

ENABLE_BROKERENABLE_BROKER
指定在還原結束時啟用 Service BrokerService Broker 訊息傳遞,以便立即傳送訊息。Specifies that Service BrokerService Broker message delivery is enabled at the end of the restore so that messages can be sent immediately. 根據預設, Service BrokerService Broker 訊息傳遞會在還原期間停用。By default Service BrokerService Broker message delivery is disabled during a restore. 資料庫會保留現有的 Service Broker 識別碼。The database retains the existing Service Broker identifier.

ERROR_BROKER_CONVERSATIONSERROR_BROKER_CONVERSATIONS
結束所有交談,並顯示一則指出已附加或還原資料庫的錯誤。Ends all conversations with an error stating that the database is attached or restored. 這可讓您的應用程式執行現有交談作業的正規清除工作。This enables your applications to perform regular clean up for existing conversations. Service Broker 訊息傳遞將保持停用,直到這項作業完成之後才會啟用。Service Broker message delivery is disabled until this operation is completed, and then it is enabled. 資料庫會保留現有的 Service Broker 識別碼。The database retains the existing Service Broker identifier.

NEW_BROKER NEW_BROKER
指定資料庫應該被指派新的 Service Broker 識別碼。Specifies that the database be assigned a new Service Broker identifier. 由於資料庫會被視為新的 Service Broker,因此系統會立即移除資料庫中所有現有的交談,而不會產生結束對話訊息。Because the database is considered to be a new Service Broker, existing conversations in the database are immediately removed without producing end dialog messages. 您必須使用新的識別碼來重新建立參考舊 Service Broker 識別碼的任何路由。Any route referencing the old Service Broker identifier must be recreated with the new identifier.

<point_in_time_WITH_options><point_in_time_WITH_options>

支援者: RESTORE {DATABASE|LOG} 且只適用於完整或大量記錄復原模式。Supported by: RESTORE {DATABASE|LOG} and only for the full or bulk-logged recovery models.

您可以在 STOPAT、STOPATMARK 或 STOPBEFOREMARK 子句中指定目標復原點,藉以將資料庫還原至特定時間點或交易。You can restore a database to a specific point in time or transaction, by specifying the target recovery point in a STOPAT, STOPATMARK, or STOPBEFOREMARK clause. 指定的時間或交易一律是從記錄備份中還原。A specified time or transaction is always restored from a log backup. 在還原順序的每個 RESTORE LOG 陳述式中,您必須在相同的 STOPAT、STOPATMARK 或 STOPBEFOREMARK 子句中指定目標時間或交易。In every RESTORE LOG statement of the restore sequence, you must specify your target time or transaction in an identical STOPAT, STOPATMARK, or STOPBEFOREMARK clause.

您必須先還原其端點早於目標復原點的完整資料庫備份,當做時間點還原的必要條件。As a prerequisite to a point-in-time restore, you must first restore a full database backup whose end point is earlier than your target recovery point. 若要協助您識別要還原哪個資料庫備份,可以選擇性地在 RESTORE DATABASE 陳述式中指定 WITH STOPAT、STOPATMARK 或 STOPBEFOREMARK 子句,以便在資料庫備份太接近指定的目標時間時引發錯誤。To help you identify which database backup to restore, you can optionally specify your WITH STOPAT, STOPATMARK, or STOPBEFOREMARK clause in a RESTORE DATABASE statement to raise an error if a data backup is too recent for the specified target time. 不過,系統一定會還原完整的資料備份,即使它包含目標時間也一樣。But the complete data backup is always restored, even if it contains the target time.

注意

RESTORE_DATABASE 與 RESTORE_LOG 時間點 WITH 選項類似,但是只有 RESTORE LOG 可支援 mark_name 引數。The RESTORE_DATABASE and RESTORE_LOG point-in-time WITH options are similar, but only RESTORE LOG supports the mark_name argument.

{ STOPAT | STOPATMARK | STOPBEFOREMARK }{ STOPAT | STOPATMARK | STOPBEFOREMARK }

STOPAT = { 'datetime' | @datetime_var }STOPAT = { 'datetime' | @datetime_var }
指定要將資料庫還原到 datetime@datetime_var 參數指定的日期和時間當時所處的狀態。Specifies that the database be restored to the state it was in as of the date and time specified by the datetime or @datetime_var parameter. 如需指定日期和時間的詳細資訊,請參閱日期和時間資料類型與函數 (Transact-SQL)For information about specifying a date and time, see Date and Time Data Types and Functions (Transact-SQL).

如果變數用於 STOPAT,這個變數必須是 varcharcharsmalldatetimedatetime 資料類型。If a variable is used for STOPAT, the variable must be varchar, char, smalldatetime, or datetime data type. 只有在指定日期和時間之前寫入的交易記錄會套用至資料庫上。Only transaction log records written before the specified date and time are applied to the database.

注意

如果指定的 STOPAT 時間是在上一次 LOG 備份之後,資料庫便會停留在未復原的狀態,如同使用 NORECOVERY 執行了 RESTORE LOG 一樣。If the specified STOPAT time is after the last LOG backup, the database is left in the unrecovered state, just as if RESTORE LOG ran with NORECOVERY.

如需詳細資訊,請參閱將 SQL Server 資料庫還原至某個時間點 (完整復原模式)For more information, see Restore a SQL Server Database to a Point in Time (Full Recovery Model).

STOPATMARK = { 'mark_name' | ' lsn:lsn_number' } [ AFTER 'datetime' ]STOPATMARK = { 'mark_name' | ' lsn:lsn_number' } [ AFTER 'datetime' ]
指定復原至指定的復原點。Specifies recovery to a specified recovery point. 雖然指定的交易包含在復原中,但除非最初實際產生這項交易時已認可這項交易,否則便不會認可它。The specified transaction is included in the recovery, but it is committed only if it was originally committed when the transaction was actually generated.

RESTORE DATABASE 和 RESTORE LOG 都支援 lsn_number 參數。Both RESTORE DATABASE and RESTORE LOG support the lsn_number parameter. 這個參數會指定記錄序號。This parameter specifies a log sequence number.

只有 RESTORE LOG 陳述式才支援 mark_name 參數。The mark_name parameter is supported only by the RESTORE LOG statement. 這個參數會識別記錄備份中的交易標示。This parameter identifies a transaction mark in the log backup.

在 RESTORE LOG 陳述式中,如果省略 AFTER datetime,復原會停在具有指定名稱的第一個標記。In a RESTORE LOG statement, if AFTER datetime is omitted, recovery stops at the first mark with the specified name. 如果指定 AFTER datetime,復原會剛好在 datetime 或之後停在具有指定名稱的第一個標記。If AFTER datetime is specified, recovery stops at the first mark having the specified name exactly at or after datetime.

注意

如果指定的標記 LSN 或時間是在上一次 LOG 備份之後,資料庫便會停留在未復原的狀態,如同使用 NORECOVERY 執行了 RESTORE LOG 一樣。If the specified mark, LSN, or time is after the last LOG backup, the database is left in the unrecovered state, just as if RESTORE LOG ran with NORECOVERY.

如需詳細資訊,請參閱使用標示的異動以一致的方式復原相關資料庫 (完整復原模式)復原到記錄序號 (SQL Server)For more information, see Use Marked Transactions to Recover Related Databases Consistently (Full Recovery Model) and Recover to a Log Sequence Number (SQL Server).

STOPBEFOREMARK = { 'mark_name' | ' lsn:lsn_number' } [ AFTER 'datetime' ]STOPBEFOREMARK = { 'mark_name' | ' lsn:lsn_number' } [ AFTER 'datetime' ]
指定復原至指定的復原點。Specifies recovery up to a specified recovery point. 指定的交易不會包含在復原中,而且會在使用 WITH RECOVERY 時回復。The specified transaction is not included in the recovery, and is rolled back when WITH RECOVERY is used.

RESTORE DATABASE 和 RESTORE LOG 都支援 lsn_number 參數。Both RESTORE DATABASE and RESTORE LOG support the lsn_number parameter. 這個參數會指定記錄序號。This parameter specifies a log sequence number.

只有 RESTORE LOG 陳述式才支援 mark_name 參數。The mark_name parameter is supported only by the RESTORE LOG statement. 這個參數會識別記錄備份中的交易標示。This parameter identifies a transaction mark in the log backup.

在 RESTORE LOG 陳述式中,如果省略 AFTER datetime,復原會正好停在具有指定名稱的第一個標記之前。In a RESTORE LOG statement, if AFTER datetime is omitted, recovery stops just before the first mark with the specified name. 如果指定 AFTER datetime,復原會正好在 datetime 之前或之後停在具有指定名稱的第一個標記。If AFTER datetime is specified, recovery stops just before the first mark having the specified name exactly at or after datetime.

重要

如果部分還原順序排除任何 FILESTREAM 檔案群組,則不支援時間點還原。If a partial restore sequence excludes any FILESTREAM filegroup, point-in-time restore is not supported. 您可以強制還原順序,以繼續進行。You can force the restore sequence to continue. 但是,絕對無法還原 RESTORE 陳述式中省略的 FILESTREAM 檔案群組。However, the FILESTREAM filegroups that are omitted from the RESTORE statement can never be restored. 若要強制時間點還原,請指定 CONTINUE_AFTER_ERROR 選項,連同 STOPAT、STOPATMARK 或 STOPBEFOREMARK 選項。To force a point-in-time restore, specify the CONTINUE_AFTER_ERROR option together with the STOPAT, STOPATMARK, or STOPBEFOREMARK option. 如果您指定 CONTINUE_AFTER_ERROR,則部分還原順序會成功,而 FILESTREAM 檔案群組則會變成無法復原。If you specify CONTINUE_AFTER_ERROR, the partial restore sequence succeeds and the FILESTREAM filegroup becomes unrecoverable.

結果集Result Sets

如需結果集的詳細資訊,請參閱下列主題:For result sets, see the following topics:

RemarksRemarks

如需其他備註的詳細資訊,請參閱下列主題:For additional remarks, see the following topics:

指定備份組Specifying a Backup Set

「備份組」包含單次成功備份作業的備份。A backup set contains the backup from a single, successful backup operation. RESTORE、RESTORE FILELISTONLY、RESTORE HEADERONLY 和 RESTORE VERIFYONLY 陳述式會在位於指定之單一或多重備份裝置上媒體集內單一備份組上操作。RESTORE, RESTORE FILELISTONLY, RESTORE HEADERONLY, and RESTORE VERIFYONLY statements operate on a single backup set within the media set on the specified backup device or devices. 您應該在媒體集內指定所需的備份。You should specify the backup you need from within the media set. 您可以使用 RESTORE HEADERONLY 陳述式來取得備份組的 backup_set_file_numberYou can obtain the backup_set_file_number of a backup set by using the RESTORE HEADERONLY statement.

用於指定要還原之備份組的選項為:The option for specifying the backup set to restore is:

FILE ={ backup_set_file_number | @backup_set_file_number }FILE ={ backup_set_file_number | @backup_set_file_number }

其中,backup_set_file_number 表示媒體集中的備份位置。Where backup_set_file_number indicates the position of the backup in the media set. backup_set_file_number 為 1 (FILE = 1),表示備份媒體的第一個備份組;backup_set_file_number 為 2 (FILE = 2),表示第二個備份組,依此類推。A backup_set_file_number of 1 (FILE = 1) indicates the first backup set on the backup medium and a backup_set_file_number of 2 (FILE = 2) indicates the second backup set, and so on.

這個選項的行為會隨陳述式而不同,如下表中所述:The behavior of this option varies depending on the statement, as described in the following table:

引數Statement 備份組 FILE 選項的行為Behavior of backup-set FILE option
RESTORERESTORE 預設的備份組檔案編號為 1。The default backup set file number is 1. RESTORE 陳述式中只允許使用一個備份組 FILE 選項。Only one backup-set FILE option is allowed in a RESTORE statement. 依序指定備份組很重要。It is important to specify backup sets in order.
RESTORE FILELISTONLYRESTORE FILELISTONLY 預設的備份組檔案編號為 1。The default backup set file number is 1.
RESTORE HEADERONLYRESTORE HEADERONLY 依預設會處理媒體集中的所有備份組。By default, all backup sets in the media set are processed. RESTORE HEADERONLY 結果集會傳回每個備份組的相關資訊,包括它在媒體集中的 [位置]。The RESTORE HEADERONLY results set returns information about each backup set, including its Position in the media set. 若要傳回指定備份組的相關資訊,請使用它的位置編號作為 FILE 選項中的 backup_set_file_number 值。To return information on a given backup set, use its position number as the backup_set_file_number value in the FILE option.

注意:針對磁帶媒體,RESTORE HEADER 只會處理已載入之磁帶上的備份組。Note: For tape media, RESTORE HEADER only processes backup sets on the loaded tape.
RESTORE VERIFYONLYRESTORE VERIFYONLY backup_set_file_number 預設值為 1。The default backup_set_file_number is 1.

注意

用來指定備份組的這個 FILE 選項和用來指定資料庫檔案的 FILE 選項無關,FILE = { logical_file_name_in_backup | @logical_file_name_in_backup_var }。The FILE option for specifying a backup set is unrelated to the FILE option for specifying a database file, FILE = { logical_file_name_in_backup | @logical_file_name_in_backup_var }.

WITH 選項的支援摘要Summary of Support for WITH Options

只有 RESTORE 陳述式支援下列 WITH 選項:BLOCKSIZE、BUFFERCOUNT、MAXTRANSFERSIZE、PARTIAL、KEEP_REPLICATION、{ RECOVERY | NORECOVERY | STANDBY }、REPLACE、RESTART、RESTRICTED_USER 和 { STOPAT | STOPATMARK | STOPBEFOREMARK }The following WITH options are supported by only the RESTORE statement: BLOCKSIZE, BUFFERCOUNT, MAXTRANSFERSIZE, PARTIAL, KEEP_REPLICATION, { RECOVERY | NORECOVERY | STANDBY }, REPLACE, RESTART, RESTRICTED_USER, and { STOPAT | STOPATMARK | STOPBEFOREMARK }

注意

只有 RESTORE DATABASE 支援 PARTIAL 選項。The PARTIAL option is supported only by RESTORE DATABASE.

下表列出一或多個陳述式所用的 WITH 選項,指出哪些陳述式支援各個選項。The following table lists the WITH options that are used by one or more statements and indicates which statements support each option. 核取記號 (√) 表示支援選項;破折號 (—) 表示不支援選項。A check mark (√) indicates that an option is supported; a dash (—) indicates that an option is not supported.

WITH 選項WITH option RESTORERESTORE RESTORE FILELISTONLYRESTORE FILELISTONLY RESTORE HEADERONLYRESTORE HEADERONLY RESTORE LABELONLYRESTORE LABELONLY RESTORE REWINDONLYRESTORE REWINDONLY RESTORE VERIFYONLYRESTORE VERIFYONLY
{ CHECKSUM{ CHECKSUM

| NO_CHECKSUM }| NO_CHECKSUM }
{ CONTINUE_AFTER_ERROR{ CONTINUE_AFTER_ERROR

| STOP_ON_ERROR }| STOP_ON_ERROR }
FILE1FILE1
LOADHISTORYLOADHISTORY
MEDIANAMEMEDIANAME
MEDIAPASSWORDMEDIAPASSWORD
MOVEMOVE
PASSWORDPASSWORD
{ REWIND | NOREWIND }{ REWIND | NOREWIND } 只有 REWINDOnly REWIND 只有 REWINDOnly REWIND 只有 REWINDOnly REWIND
STATSSTATS
{ UNLOAD | NOUNLOAD }{ UNLOAD | NOUNLOAD }

1 FILE =backup_set_file_number,這有別於 {FILE | FILEGROUP}。1 FILE =backup_set_file_number, which is distinct from {FILE | FILEGROUP}.

PermissionsPermissions

如需權限的詳細資訊,請參閱下列主題:For permissions, see the following topics:

範例Examples

如需範例,請參閱下列主題:For examples, see the following topics:

另請參閱See Also

BACKUP (Transact-SQL) BACKUP (Transact-SQL)
RESTORE (Transact-SQL) RESTORE (Transact-SQL)
RESTORE FILELISTONLY (Transact-SQL) RESTORE FILELISTONLY (Transact-SQL)
RESTORE HEADERONLY (Transact-SQL) RESTORE HEADERONLY (Transact-SQL)
RESTORE LABELONLY (Transact-SQL) RESTORE LABELONLY (Transact-SQL)
RESTORE REWINDONLY (Transact-SQL) RESTORE REWINDONLY (Transact-SQL)
RESTORE VERIFYONLY (Transact-SQL) RESTORE VERIFYONLY (Transact-SQL)
SQL Server 資料庫的備份與還原 Back Up and Restore of SQL Server Databases
FILESTREAM (SQL Server)FILESTREAM (SQL Server)