--backup database test to disk=N'd:\backup\test.bak'
backup log test to disk=N'd:\backup\test.trn' with norecovery
restore database test from disk=N'd:\backup\test.bak' with norecovery,replace
restore log test from disk=N'd:\backup\test.trn' with stopat=N'2013-06-20 21:41:00',recovery以上代码在SQL Server2000/2008测试通过,再强调一次,误删数据可以恢复的条件是数据库做过完整备份且恢复模式为完整。
常见问题
问:为什么在SQL Server2008执行backup log后数据库显示为正在还原且无法使用?
答:这是由于使用norecovery参数的缘故,待执行restore log(带recovery参数)后即可恢复正常,也可以单独执行下边语句让数据库恢复正常:
restore database test with recovery
评论(0)
暂无评论。