简单&快速的sql server数据库备份和恢复
我正在寻找一种简单的(如果可能的话最简单的)备份和恢复数据库的方法。
我想在一种状态下进行备份,然后在执行一些操作后返回到备份状态。
尝试了数据库 -> 任务 -> 备份...,然后是数据库 -> 任务 -> 恢复,但我总是收到错误:
Restore failed for...DBName
数据库“数据库名称”的日志尾部尚未备份...
所以,我想通过一个简单的操作分别进行备份和恢复,谁能告诉我 解决方案,无论是基于 GUI 还是不基于 GUI?
I'm looking for a simple (simplest if possible) way of backing up and restoring a database.
I want to do a backup in one state and then after doing some operations get back to the backed up state.
Tried Database->Tasks->Back Up... and then Database->Tasks->Restore but I always get an error with:
Restore failed for...DBName
The tail of the log for the database "database name" has not been backed up...
So, I want to back up and restore with one simple operation each, can one advise me
to a solution, be it GUI or not GUI based?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
使用 RESTORE 的
WITH REPLACE
选项命令:MSDN 中的恶心部分也涵盖了该主题,请参阅不使用尾日志备份进行恢复< /a>,其中包含涵盖 Management Studio 方案(即您正在使用的工具)的“操作方法”文章的链接。
Use the
WITH REPLACE
option of the RESTORE command:The topic is also covered at nauseam in MSDN see Restoring Without Using a Tail-Log Backup, which contains the links for 'How to' articles that cover Management Studio scenarios (ie. the tool you're using).
您似乎已设置差异备份。它比恢复完整备份稍微复杂一些。
http://msdn.microsoft.com/en-us/library/ms175510。 aspx
通过执行完整备份,您将破坏 DBA 设置的备份链,因此在破坏 DBA 的备份集之前,最好先咨询一下 DBA。
编辑了非常有用的评论:
在进行备份时,您应该使用 COPY_ONLY 选项,这样就不会破坏备份链。
http://msdn.microsoft.com/en-us/library/ms186865。 ASPX
It looks like you have Differential Backups set up. It is slightly more complicated than restoring a Full backup.
http://msdn.microsoft.com/en-us/library/ms175510.aspx
By doing a Full backup, you are going to break the chain of backups that the DBA set up, so it would be a good idea to check first with the DBA before you break his backup set.
Edited for very helpful comments:
You should use the COPY_ONLY option when you do a backup so that you do not break the chain of backups.
http://msdn.microsoft.com/en-us/library/ms186865.aspx
恢复时需要勾选“覆盖现有数据库”选项,否则会失败。
MSSQL 2005 及更高版本功能快照,听起来它很适合您的要求。
When restoring you need to check the option to Overwrite existing database, if you are, otherwise it will fail.
MSSQL 2005 and up features snapshots, sounds like it suits your requirements nicely.