通过sql删除了mdf文件怎么办_sql删除了mdf文件恢复方法
时间:2023-04-30 16:02:01
有不少的小伙伴在遇到mdf文件的时候不小心用sql把他删了,那么遇到这样的情况该怎么办呢?今天就为大家带来了sql删除了mdf文件的恢复方法,一起看看吧。
通过sql删除了mdf文件怎么办:
方法一、用Recover NT 恢复:
它能自动搜索并列出磁盘上有已被完来全删除的文件的目录,而没有被删除文件的目录则不被列出,只需要点四下鼠标就可以了:
1、点击被自删文件所在的驱动器。
2、点击目录。
3、点击文件。
4、点击工具条上的“Recover”按钮,被删文件若没被百覆盖的话,就被恢复了。
方法二、
1.新建同名数据库。
2.删除其日志文件test_Data.LDF,不删除后边的过程执行通不过。
3.把test数据设置为脱机。
4.在查询分析器中以超级用户登入,执行以下百存储过程,必须以超级用户登入,这是系统级存储过程。
EXEC sp_detach_db @dbname = "test"
EXEC sp_attach_single_file_db @dbname = "test", @physname = "E:WebDemoest_Data.MDF"
5.把test数据设置为联机。
6.刷新数据库,数据恢复。
还有其他问题的小伙伴可以看看【mdf文件常见问题大全】了解更多有关mdf文件的问题~
标签:sql删除了mdf文件恢复方法
![](/images/zang.png)
![](/images/jiucuo.png)
猜你喜欢
win10录屏快捷键按了没反应解决方法
2023-05-07 07:57:23
![](https://img.aspxhome.com/file/2023/4/a308140_0s.jpg)
excel 有的姓名有三个字,有的姓名只有两个字,怎样快速对齐?
2023-02-03 23:15:30
![](https://img.aspxhome.com/file/2023/3/a141243_0s.jpg)
Win10 1909显卡内存提示不足怎么办?显卡内存提示不足解决方法
2022-12-11 14:52:08
![](https://img.aspxhome.com/file/2023/26/a224359_0s.jpg)
win7offic2010老是安装出错-win7offic2010老是安装出错解决方法
2023-06-18 02:04:59
![](https://img.aspxhome.com/file/2023/4/a306195_0s.png)
wps水印怎么去掉
2022-07-23 00:49:46
![](https://img.aspxhome.com/file/2023/6/a164256_0s.jpg)
AirPods 2 使用技巧(进阶篇)| AirPods 丢失后如何查找?
2023-10-17 19:23:28
![](https://img.aspxhome.com/file/2023/6/a198116_0s.jpg)
360怎么一键整理桌面图标?360安全卫士怎么整理桌面软件?
2022-07-10 05:19:37
![](https://img.aspxhome.com/file/2023/7/a328030_0s.png)
Win10系统提示sxstrace.exe无法启动的解决方法介绍
2022-06-04 14:06:14
![](https://img.aspxhome.com/file/2023/4/a307409_0s.png)
win10系统开机蓝屏 代码电脑蓝屏错误0x00000001e怎么办?
2022-03-14 14:58:53
![](https://img.aspxhome.com/file/2023/28/a249557_0s.jpg)
windows11打不开visual c++ 6.0的解决方法
2022-04-29 12:16:37
![](https://img.aspxhome.com/file/2023/30/a269599_0s.jpg)
Windows 9最新版Build 9844曝光 预览版已被锁定 IE12和语音助手不会出现
2022-07-23 20:30:22
![](https://img.aspxhome.com/file/2023/29/a253653_0s.jpg)
tessafe.sys是病毒吗?tessafe.sys不兼容驱动程序的解决方法
2022-12-06 03:03:55
![](https://img.aspxhome.com/file/2023/30/a269828_0s.png)
怎么在wps演示中制作卷轴打开动画
2022-06-20 22:33:28
win7系统c盘空间不够怎么释放补丁空间?
2022-05-07 08:00:30
![](https://img.aspxhome.com/file/2023/28/a250275_0s.jpg)
Win10开机密码忘记了的办法
2023-02-08 09:36:38
![](https://img.aspxhome.com/file/2023/4/a311500_0s.jpg)
Ps怎样将线稿颜色加深
2022-09-22 14:54:56
![](https://img.aspxhome.com/file/2023/9/a342381_0s.jpg)
Excel中DGET函数用法和实例教程
2022-01-22 01:12:12
![](https://img.aspxhome.com/file/2023/1/a163271_0s.gif)
如何重装戴尔灵越16Pro笔记本?戴尔灵越16Pro重装的方法
2023-01-09 21:44:15
![](https://img.aspxhome.com/file/2023/25/a216845_0s.png)
小日常如何添加提醒 小日常设置提醒的方法
2023-06-30 16:31:37
Win10玩使命召唤17错误代码887A0005怎么办?
2023-09-29 16:02:55
![](https://img.aspxhome.com/file/2023/6/51476_0s.jpg)