将数据库还原到标记的事务 (SQL Server Management Studio)Restore a database to a marked transaction (SQL Server Management Studio)

适用对象:是SQL Server 否Azure SQL 数据库 否Azure Synapse Analytics (SQL DW) 否并行数据仓库 APPLIES TO: yesSQL Server noAzure SQL Database noAzure Synapse Analytics (SQL DW) noParallel Data Warehouse

数据库处于还原状态时,可以使用 “还原事务日志” 对话框将数据库还原到可用日志备份中的标记的事务。When a database is in the restoring state, you can use the Restore Transaction Log dialog box to restore the database to a marked transaction in the available log backups.

还原标记的事务To restore a marked transaction

  1. 连接到相应的 MicrosoftMicrosoft SQL Server 数据库引擎SQL Server Database Engine 实例之后,在“对象资源管理器”中,单击服务器名称以展开服务器树。After connecting to the appropriate instance of the MicrosoftMicrosoft SQL Server 数据库引擎SQL Server Database Engine, in Object Explorer, click the server name to expand the server tree.

  2. 展开 “数据库” ,然后根据数据库的不同,选择用户数据库,或展开 “系统数据库” ,再选择系统数据库。Expand Databases, and, depending on the database, either select a user database or expand System Databases and select a system database.

  3. 右键单击数据库,指向“任务” ,再单击“还原” 。Right-click the database, point to Tasks, and then click Restore.

  4. 单击 “事务日志” ,这将打开 “还原事务日志” 对话框。Click Transaction Log, which opens the Restore Transaction Log dialog box.

  5. “常规” 页上的 “还原到” 部分中,选择 “标记的事务” ,将打开 “选择标记的事务” 对话框。On the General page, in the Restore To section, select Marked transaction, which opens the Select Marked Transaction dialog box. 此对话框中将以网格列表的形式显示选择的事务日志备份中可用的标记的事务。This dialog box displays a grid listing the marked transactions available in the selected transaction log backups.

    默认情况下,将一直还原到(但不包含)标记的事务为止。By default, the restore is up to, but excluding, the marked transaction. 若要同时还原标记的事务,请选择 “包含标记的事务”To restore the marked transaction also, select Include marked transaction.

    下表列出了网格的列标题并对列值进行了说明。The following table lists the column headers of the grid and describes their values.

    标头Header Value
    <blank><blank> 显示一个用于选择标记的复选框。Displays a checkbox for selecting the mark.
    事务标记Transaction Mark 提交事务时,用户为标记的事务指定的名称。Name of the marked transaction specified by the user when the transaction was committed.
    DateDate 事务的提交日期及时间。Date and time of the transaction when it was committed. 事务日期和时间显示为 msdbgmarkhistory 表中所记录的日期和时间,而非客户端计算机的日期和时间。Transaction date and time are displayed as recorded in the msdbgmarkhistory table, not in the client computer's date and time.
    说明Description 提交事务时,用户为标记的事务指定的说明(如果有的话)。Description of marked transaction specified by the user when the transaction was committed (if any).
    LSNLSN 所标记事务的日志序列号。Log sequence number of the marked transaction.
    DatabaseDatabase 提交标记的事务时所在数据库的名称。Name of the database where the marked transaction was committed.
    用户名User Name 提交标记事务的数据库用户的名称。Name of the database user who committed the marked transaction.

另请参阅See Also

Restore a Database Backup Using SSMS Restore a Database Backup Using SSMS
还原事务日志备份 (SQL Server)Restore a Transaction Log Backup (SQL Server)