如何在Sql 2008中使用mdf和ldf文件恢复数据库? [英] How to restore a database using mdf and ldf files in Sql 2008?

查看:251
本文介绍了如何在Sql 2008中使用mdf和ldf文件恢复数据库?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,

请求专家意见。发生了一件非常不幸的事。我们的一台电脑几天前就崩溃了。该PC安装了SQL Server 2008。不幸的是,该服务器上没有运行备份。我们将磁盘发送到数据恢复位置,看起来他们可以恢复一些mdf和ldf文件。我们对一个特定的数据库特别感兴趣。我的问题是:

1.是否可以使用相应的mdf和ldf文件恢复特定数据库?

2.我们是否需要从系统数据库获取任何mdfs ?我们需要请求数据恢复公司寻找的任何其他文件?

3.将该数据库恢复到新机器的步骤和/或最佳实践。

感谢您的光临提前帮助。

Hello,
Asking for expert opinion. A very unfortunate event happened. One of our PCs crashed few days ago. That PC had SQL Server 2008 installed. Unfortunately no backup was running on that server. We sent the disk to a data recovery place and looks like they can recover some of the mdf and ldf files. We are particularly interested in 1 particular database. My questions are:
1. Is this possible to restore a particular database using corresponding mdf and ldf files?
2. Do we need to have any mdfs from the system databases? Any other files we need to ask data recovery company t look for?
3. Steps and/or or best practices to restore that database into a new machine.
Thanks for your help in advance.

推荐答案

如果你有mdf'和ldfs,你可以将数据库文件附加到另一个实例(即使你可以附加mdf)

系统数据库主包含用户信息,msdb包含作业和其他信息;如果你无法恢复这些文件,你需要手动添加它们

ssms - >右键单击数据库 - >附上;选择文件并附上



您可能必须对新连接的数据库运行'DBCC CHECKDB()'语句
You can attach the database files to another instance if you have the mdf' and ldfs ( even with mdf you will be able to attach )
System database master contains the user info, and msdb contains the jobs and other info; if you couldn't recover these files, you need to add them manually
ssms -> rightclick database -> attach ; choose the files and attach
OR
You may have to run a 'DBCC CHECKDB()' statement against the newly attached database


2)
您可以将.mdf和.ldf文件复制到其他服务器并只需将它们附加。

https://msdn.microsoft.com/en-us/library/ ms190209.aspx

您将丢失在实例级别创建的任何服务器范围的登录,但您将保留数据库用户。
2) You can copy the .mdf and .ldf files to a different server and just Attach them.
https://msdn.microsoft.com/en-us/library/ms190209.aspx
You will lose any server-wide logins created at the instance level but you will retain your database users.


3)
如果数据库没有打开,那么我认为文件可能已损坏。看看微软的这篇支持文章。 https://support.microsoft.com/en-us/kb/288809 [ ^ ]

如果这没有帮助,那么只能选择尝试第三方程序。可以在Market中查找或者可以像SQL Server Recovery Toolbox一样使用。我作为专家推荐给你。或者可以使用您已知的任何其他工具。 http://www.oemailrecovery.com/sql_repair.html

所以我告诉了你们所有人可能的方法。)
3) If the database is not open, then I think the files could be damaged. see this support article from microsoft. https://support.microsoft.com/en-us/kb/288809[^]
If this does not help, then only have the option to try third-party program. Can in the Market to look for or can use like SQL Server Recovery Toolbox. I as the expert recommend it to you. Or can use any other tool known to you. http://www.oemailrecovery.com/sql_repair.html
So I told you all the possible ways.)


这篇关于如何在Sql 2008中使用mdf和ldf文件恢复数据库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆