還原資料庫至標示的異動 (SQL Server Management Studio)Restore a Database to a Marked Transaction (SQL Server Management Studio)

適用於: 是SQL Server 否Azure SQL Database 否Azure SQL 資料倉儲 否平行處理資料倉儲 APPLIES TO: yesSQL Server noAzure SQL Database noAzure SQL Data Warehouse 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 Database EngineSQL Server Database Engine執行個體之後,在 [物件總管] 中按一下伺服器名稱展開伺服器樹狀目錄。After connecting to the appropriate instance of the MicrosoftMicrosoft SQL Server Database EngineSQL 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 ReplTest1Value
    <空白><blank> 顯示選取標示的核取方塊。Displays a checkbox for selecting the mark.
    交易標示Transaction Mark 在認可交易時,由使用者所指定之標示交易的名稱。Name of the marked transaction specified by the user when the transaction was committed.
    日期Date 認可交易的日期和時間。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.
    [資料庫備份]Database 認可標示的交易之資料庫的名稱。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)