回覆列表
  • 1 # qwerty1997

    恢復資料庫到之前的某個時間點,必須要有日誌備份。下面是一個使用日誌的示例: create database db1 go alter database db1 set recovery full go backup database db1 to disk="db1.bak" with init--首先要對資料庫進行全備份,否則checkpoint會階段inactive的日誌(類似於simple recovery) go use db1 go create table t(col int) go ---一些資料庫操作 ---一些資料庫操作 ---一些資料庫操作 --假設你在15點15分以後刪除了這個表 drop table t --如果想恢復這個表,需要對資料庫進行日誌備份 use master go backup log db1 to disk="db1.trn" with norecovery go ---然後執行以下操作 use master go restore database db1 from disk="db1.bak" with norecovery go restore log db1 from disk="db1.trn" with recovery,stopat="2009-03-08 15:15:00"--這時,資料庫恢復到15:15的狀態。

  • 中秋節和大豐收的關聯?
  • 模擬計算的特點是什麼?