還原資料庫 (選項頁面)Restore Database (Options Page)

適用於: 是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

使用 [還原資料庫] 對話方塊的 [選項] 頁面,即可修改還原作業的行為和結果。Use the Options page of the Restore Database dialog box to modify the behavior and outcome of the restore operation.

若要使用 SQL Server Management Studio 還原資料庫備份To use SQL Server Management Studio to restore a database backup

注意

使用 SQL Server Management StudioSQL Server Management Studio指定還原工作時,可以針對這個還原作業產生包含 RESTORE 陳述式的對應 Transact-SQLTransact-SQL 指令碼。When you specify a restore task by using SQL Server Management StudioSQL Server Management Studio, you can generate a corresponding Transact-SQLTransact-SQL script containing the RESTORE statements for this restore operation. 若要產生指令碼,請按一下 [指令碼] ,然後選取指令碼的目的地。To generate the script, click Script and then select a destination for the script. 如需 RESTORE 語法的資訊,請參閱 RESTORE (Transact-SQL)For information about the RESTORE syntax, see RESTORE (Transact-SQL).

選項。Options

還原選項Restore options

若要修改還原作業的行為方面,可以使用 [還原選項] 面板的選項。To modify aspects of the behavior of the restore operation, use the options of the Restore options panel.

覆寫現有的資料庫 [WITH REPLACE]Overwrite the existing database [WITH REPLACE]
還原作業將會覆寫目前正在使用資料庫名稱 (在 [還原資料庫] 對話方塊之 一般 頁面的 [還原至] 欄位中指定) 的任何資料庫檔案。The restore operation will overwrite the files of any database that is currently using the database name that you are specifying in the Restore tofield on the General page of the Restore Database dialog box. 即使是將備份從不同的資料庫還原為現有的資料庫名稱,現有資料庫的檔案也會遭到覆寫。The files of the existing database will be overwritten even if you are restoring backups from a different database to the existing database name. 選取此選項相當於使用 RESTORE 陳述式 (Transact-SQLTransact-SQL) 的 REPLACE 選項。Selecting this option is equivalent to using the REPLACE option in a RESTORE statement ( Transact-SQLTransact-SQL).

警告

請仔細考慮之後再使用這個選項。Use this option only after careful consideration. 如需詳細資訊,請參閱 RESTORE 引數 (Transact-SQL)For more information, see RESTORE Arguments (Transact-SQL).

保留複寫設定 [WITH KEEP_REPLICATION]Preserve the replication settings [WITH KEEP_REPLICATION]
將發行資料庫還原至並非建立該資料庫的伺服器時,就會保留複寫設定。Preserves the replication settings when restoring a published database to a server other than the server where the database was created. 只有在建立備份時複寫了資料庫,這個選項才會相關。This option is relevant only if the database was replicated when the backup was created.

這個選項只能搭配 [回復未認可的交易,讓資料庫保持備妥可用] 選項 (本資料表稍後會描述) 使用,這相當於使用 RECOVERY 選項來還原備份。This option is available only with the Leave the database ready for use by rolling back the uncommitted transactions option (described later in this table), which is equivalent to restoring a backup with the RECOVERY option.

選取此選項相當於使用 RESTORE 陳述式中的 KEEP_REPLICATION 選項。Selecting this option is equivalent to using the KEEP_REPLICATION option in a RESTORE statement.

如需詳細資訊,請參閱 備份及還原複寫的資料庫For more information, see Back Up and Restore Replicated Databases.

限制對還原資料庫的存取 [WITH RESTRICTED_USER]Restrict access to the restored database [WITH RESTRICTED_USER]
僅有 db_ownerdbcreator系統管理員的成員可以使用還原資料庫。Makes the restored database available only to the members of db_owner, dbcreator, or sysadmin.

選取此選項相當於使用 RESTORE 陳述式的 RESTRICTED_USER 選項。Selecting this option is synonymous to using the RESTRICTED_USER option in a RESTORE statement.

復原狀態Recovery state

若要在存放區作業之後判斷資料庫的狀態,則必須選取 [復原狀態] 面板的其中一個選項。To determine the state of the database after the store operation, you must select one of the options of the Recovery state panel.

RESTORE WITH RECOVERYRESTORE WITH RECOVERY
透過還原 [一般] 頁面之 [要還原的備份組] 方格中所核取的最後一個備份來復原資料庫。Recovers the database after restoring the final backup checked in the Backup sets to restoregrid on the General page. 這是預設選項,且相當於在 RESTORE 陳述式 (Transact-SQLTransact-SQL) 中指定 WITH RECOVERY。This is the default option and is equivalent to specifying WITH RECOVERY in a RESTORE statement ( Transact-SQLTransact-SQL).

注意

在完整復原模式或大量記錄復原模式下時,只有在需要立即還原所有記錄檔時才選擇此選項。Under the full recovery model or bulk-logged recovery model, choose this option only if you are restoring all the log files now.

RESTORE WITH NORECOVERYRESTORE WITH NORECOVERY
讓資料庫保持在還原狀態。Leaves the database in the restoring state. 這樣可讓您還原目前復原路徑中的其他備份。This allows you to restore additional backups in the current recovery path. 若要復原資料庫,必須使用 RESTORE WITH RECOVERY 選項 (請參閱先前選項) 執行還原作業。To recover the database, you will have to perform a restore operation by using the RESTORE WITH RECOVERY option (see the preceding option).

此選項相當於在 RESTORE 陳述式中指定 WITH NORECOVERY。This option is equivalent to specifying WITH NORECOVERY in a RESTORE statement.

如果選取此選項,將無法使用 [保留複寫設定] 選項。If you select this option, the Preserve replication settings option is unavailable.

RESTORE WITH STANDBYRESTORE WITH STANDBY
將資料庫保留為待命狀態,資料庫在此狀態下可提供有限的唯讀存取。Leaves the database in a standby state, in which the database is available for limited read-only access. 此選項相當於在 RESTORE 陳述式中指定 WITH STANDBY。This option is equivalent to specifying WITH STANDBY in a RESTORE statement.

若要選擇此選項,則必須在 [待命資料庫檔案] 文字方塊中指定待命資料庫檔案。Choosing this option requires that you specify a standby file in the Standby file text box. 待命資料庫檔案可以恢復復原效果。The standby file allows the recovery effects to be undone.

待命資料庫檔案Standby file
指定待命資料庫檔案。Specifies a standby file. 您可以瀏覽待命資料庫檔案,或者在文字方塊中直接輸入其路徑名稱。You can browse for the standby file or enter its pathname directly in the text box.

結尾記錄備份Tail-Log backup

可讓您指定在資料庫還原時一併執行結尾記錄備份。Allows you to designate that a tail-log backup be performed along with the database restore.

還原前建立結尾記錄備份Take tail-Log backup before restoring
核取此方塊,即可指定應該執行結尾記錄備份。Check this box to designate that a tail-log backup should be performed.

注意

如果您在 [備份時間表] 對話方塊中選取的時間點需要結尾記錄備份,系統就會選取這個方塊,而且您無法進行編輯。If the point-in-time you have selected in the Backup Timeline dialog box requires a tail-log backup, this box will be selected and you will not be able to edit it.

[備份檔案]Backup file
指定記錄結尾的備份檔案。Specifies a backup file for the tail of the log. 您可以瀏覽備份檔案,也可以直接在文字方塊中輸入其名稱。You can browse for the backup file or enter its name directly in the text box.

伺服器連線Server connections

可讓您關閉現有的資料庫連接。Allows you to close existing database connections.

關閉現有的連接Close existing connections
若資料庫有使用中的連接,還原作業可能會失敗。Restore operations may fail if there are active connections to the database. 核取 [關閉現有的連接選項] ,確定已關閉 Management StudioManagement Studio 與資料庫之間的所有使用中連接。Check the Close existing connections option to ensure that all active connections between Management StudioManagement Studio and the database are closed. 這個核取方塊會在執行還原作業之前將資料庫設定為單一使用者模式,並在完成後將資料庫設定為多使用者模式。This check box sets the database to single user mode before performing the restore operations, and sets the database to multi-user mode when complete.

PromptPrompt

還原每個備份之前先提示Prompt before restoring each backup
指定在還原每個備份之後顯示 [繼續還原] 對話方塊,以便詢問是否還要繼續還原順序。Specifies that after each backup is restored, the Continue with Restore dialog box will be displayed to inquire whether you want to continue the restore sequence. 這個對話方塊會顯示下一個媒體集的名稱 (如果知道),以及下一個備份組的名稱和描述。This dialog box displays the name of the next media set (if known) and the name and description of the next backup set.

這個選項可讓您在還原任何備份之後暫停還原順序。This option allows you to pause a restore sequence after restoring any of the backups. 您必須為不同的媒體集交換磁帶時,這個選項特別有用,例如當伺服器只有一個磁帶裝置時。This option is particularly useful when you must swap tapes for different media sets; for example, when your server has only one tape device. 當您準備繼續時,請按一下 [確定] 。When you are ready to proceed, click OK.

您可以按一下 [否] 中斷還原順序。You can interrupt a restore sequence by clicking No. 這會使資料庫處於還原狀態。This leaves the database is in the restoring state. 您可以依您的方便,稍後再繼續 [繼續還原] 對話方塊中描述的下一項備份,以繼續進行還原順序。At your convenience, you can later continue the restore sequence by resuming with the next backup described in the Continue with Restore dialog box. 還原下一項備份的程序是依照該備份是否包含資料或交易記錄而定,如下所示:The procedure restoring the next backup depends on whether it contains data or transaction log, as follows:

  • 如果下一個備份是完整備份或差異備份,請再次使用 [還原資料庫] 工作。If the next backup is a full or differential backup, use the Restore Database task again.

  • 如果下一個備份是檔案備份,請使用 [還原檔案和檔案群組] 工作。If the next backup is a file backup, use the Restore Files and Filegroups task. 如需詳細資訊,請參閱還原檔案和檔案群組 (SQL Server)For more information, see Restore Files and Filegroups (SQL Server).

  • 如果下一個備份是記錄檔備份,請使用 [還原交易記錄檔] 工作。If the next backup is a log backup, use the Restore Transaction Log task. 如需藉由還原交易記錄來繼續還原順序的資訊,請參閱 還原交易記錄備份 (SQL Server)For information about resuming a restore sequence by restoring a transaction log, see Restore a Transaction Log Backup (SQL Server).

另請參閱See Also

RESTORE (Transact-SQL) RESTORE (Transact-SQL)
從裝置還原備份 (SQL Server) Restore a Backup from a Device (SQL Server)
還原交易記錄備份 (SQL Server) Restore a Transaction Log Backup (SQL Server)
媒體集、媒體家族與備份組 (SQL Server) Media Sets, Media Families, and Backup Sets (SQL Server)
套用交易記錄備份 (SQL Server) Apply Transaction Log Backups (SQL Server)
還原資料庫 (一般頁面)Restore Database (General Page)