--恢复数据库1600.bak,使用with norecovery参数:
restore database test from disk='d:\db\1640.bak' with norecovery
--使用日志恢复数据库到10月15日17:59分:
restore log test
from disk='d:\1820.logs' with recovery,stopat='10/15/2004 17:59'
上面的三条transact sql语句的对应过程:
1.恢复数据库到a点;
2.执行a-b之间的log记录,把数据库恢复到b点.
这样就恢复数据库到了指定的时间点。如果恢复不成功,可能的原因是:1.未使用正确的备分数据库;2.数据库选项选中了auto shrink.