从mdf文件中恢复数据(缺少ndf) [英] recover data from mdf files (ndf being missing)
问题描述
我们客户的服务器损坏了,包含NDF和LDF文件的驱动器也消失了。唯一幸存的驱动器是带有MDF文件的驱动器。
Our client's server got corrupted and the drives containing NDF and LDF files were gone. The only drive that survived was the one with MDF files.
没有任何备份。他们通过创建新数据库(我想是从旧数据库)恢复了数据库(据我所知),并应用了bcp实用程序将数据复制到新数据库中。但是,他们不会发布有关如何实际恢复的信息。
There were no backups of any sort. They recovered the database, which I know just a gist of, by creating new database (from a old database, I guess) and applied bcp utility to copy data over to the new one. But, they would not release the information how they actually recovered.
所以,我很想知道当NDF文件丢失/丢失时,如何仅能从MDF文件中恢复数据。
So, I was just curious to find how it is possible to recover data from MDF files only, when the NDF files are lost/missing.
推荐答案
您将需要使用 sp_attach_single_file_db 系统存储过程。像这样...
You will need to restore your database by using sp_attach_single_file_db system stored procedure. Something like this...
USE [master]
GO
EXECUTE sp_attach_single_file_db @dbname='DB_Name',
@physname=N'C:\Path_To_Your_MDF_FILE\DB_Name.mdf'
GO
编辑
USE [master]
GO
CREATE DATABASE DB_Name
ON (FILENAME = N'C:\Path_To_Your_MDF_FILE\DB_Name.mdf')
FOR ATTACH ;
GO
这篇关于从mdf文件中恢复数据(缺少ndf)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!