差异备份还原

-- 在服务器 a 上执行完全备份
backup  database  dbname  to  disk= 'd:\db.bak' ;
-- 在服务器 b 上还原完全备份(对应备份集 1)
restore  database  dbname  from  disk= 'e:\db.bak'  with  file=1, norecovery;
-- 在服务器 a 上执行差异备份(追加到“完全备份”后)
backup  database  dbname  to  disk= 'd:\db.bak'  with  diffrential
-- 在服务器 b 上还原差异备份(对应备份集 2)
restore  database  dbname  from  disk= 'e:\db.bak'  with  file=2, recovery;

确定如果要还原差异备份,那么在执行还原全备份时候一定要 norecovery,如果选择的是recovery,那么会出现错误:The log or differential backup cannot be restored because no files are ready to rollforward.
1.还原全备份: 右击databases -> restore database -> 输入数据库名,选择bak文件 -> 
recovery status : Leave the database non-operational, and do not roll back uncommitted transactions.Additional transaction logs can be restored(RESTORED WITH NORECOVERY) 
2.还原差异备份: 按上面步骤执行, 在recovery status : Leave the databse ready to use by rolling back uncommitted transactions. Additional transaction logs cannot be restored(RESTOR WITH RECOVERY)
不过在还原的时候,差异备份不能还原,不知道什么原因。3219错误

执行语句还原没有问题:
restore database [name] to disk='全备份' with norecovery;
restore database [name] to disk='差异备份' with recovery;
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值