还原数据库(“选项”页)Restore Database (Options Page)

适用对象: yesSQL ServeryesAzure SQL 数据库noAzure SQL 数据仓库no并行数据仓库APPLIES TO: yesSQL Server noAzure SQL Database noAzure SQL Data Warehouse 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 Arguments (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_ownerdbcreatorsysadmin的成员使用。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.

提示Prompt

还原每个备份之前进行提示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)