当前位置:网站首页>【数据库数据恢复】SQL Server数据库数据恢复案例
【数据库数据恢复】SQL Server数据库数据恢复案例
2022-06-09 19:18:00 【北亚数据恢复】
SQL Server数据库故障情况:
某公司一台存储损坏,SQL Server数据库崩溃。管理员重组存储,恢复数据库文件,发现有四个ndf文件大小变为0KB。管理员联系我们数据恢复中心进行数据恢复。

SQL Server数据库故障分析:
SQL Server数据库大小约80TB,SQL Server数据库中有1223个文件,SQL Server数据库每10天生成一个NDF文件,每个NDF大约500GB,数据库总共包含两个LDF文件。存储损坏,NDF文件大小变为0KB,NDF文件在磁盘上可能存在。可以通过编写数据库扫描碎片程序,扫描数据库碎片、拼接碎片恢复NDF文件,修复数据库。

SQL Server数据库数据恢复过程:
1、磁盘扫描数据库碎片。
2、拼接碎片。根据NDF文件的页面特征,按照文件号、页号拼接碎片,重组生成出这些0kb的NDF文件。
3、检测数据库文件。使用北亚自主研发的MSSQL文件检测工具对所有数据文件进行检测,发现拼接出的4个NDF文件有少量的空页,其他文件正常。
4、进一步对损坏的lun进行分析,发现这些数据页在存储层面已经不存在了,这些数据页无法恢复,即这4个文件不能完全恢复。
5、数据恢复工程师尝试附加数据库,出现报错: “处理数据库的日志时出错,如果可能请从备份还原。如果没有可用的备份,可能需要重新生成日志”。
6、无日志附加数据库。修改系统表,从系统表剔除掉最后添加的LDF文件,计算并修改校验。进行无日志附加数据库,报错:数据库存在一致性错误。
7、修改系统表中这4个损坏的NDF文件的块数量,使其和恢复出来的文件的块数量一致。同时更改这4个NDF文件首页,使得数据库中记录的文件的块数量和拼接出来的NDF的块数量一致,计算并修改校验值。
8、无日志附加数据库,报错数据库存在一致性错误。
9、逐个修改系统表中这4个损坏的NDF文件的块数量,使其值等于报错块前一页。分析报错,由于空页都出现在这4个NDF后面十几个块中,截断文件对数据完整性影响不大。重新修改系统表和NDF文件,将数据库中记录NDF块数量的值改至报错的前一页,计算并修改校验。
10 、重新进行无日志附加数据库,报错:“由于数据库没有完全关闭,无法重新生成日志”。
11、修改MDF文件中的数据库的状态值,让数据库认为是完全关闭的。重新附加数据库成功。
SQL Server数据库数据恢复结果:
数据库文件成功附加后,管理员通过数据库中的对象进行初步查询、验证,表中信息基本完整,数据恢复完成。

边栏推荐
- 投资5.5亿元!默克宣布在中国张家港建先进半导体一体化基地
- Have you established an internal wiki?
- SQL exercise 4: string processing function
- Left hand technology, right hand ecology! Can Intel win this "data" war?
- Krypton Evening News - Apple won the lawsuit, and the US judge rejected the class action on iPhone and iPad security defects; It is reported that JD will pilot the catering takeout business
- 国联期货开户安全吗?国联期货公司开户方法是什么?
- 摩根大通期货这家公司怎么样?期货开户办理安全吗?
- What does software testing do? Specific work content?
- 中职网络安全 系统漏洞 隐藏信息探索 解析
- Low code analysis and inventory: two misunderstandings need to be avoided in the application of low code in the banking industry
猜你喜欢

前美联储高级经济学家胡捷:从USDD升级看未来金融趋势

2022年xx地 信息安全管理与评估赛题

散列表 分布式散列表(DHT)哈希表

Convenience bee was notified of its illegal collection of personal information, and its affiliated companies repeatedly received fines
windows下mysql 8.0.27 安装配置图文教程

Download and install node using NVM
MySQL optimization tutorial: slow query log practice

中职网络安全 系统漏洞 隐藏信息探索 解析

2020年“磐云杯”网络空间安全技能竞赛全国拉赛

学习WMX3,运动控制
随机推荐
Investment of 550million yuan! Merck announced to build an advanced semiconductor integration base in Zhangjiagang, China
被疑违反禁令为华为海思提供技术支持,新思科技称正配合美国政府调查
The problem of the longest valid bracket
Fast finding the number of nodes in a complete binary tree
Pro 后台子管理员 403 问题分析
俄罗斯宣布将限制氖气等惰性气体出口!芯片行业或受影响
Convenience bee was notified of its illegal collection of personal information, and its affiliated companies repeatedly received fines
Former senior economist of the Federal Reserve Hujie: usdd high mortgage rate is good for users
10 common high-frequency business scenarios that trigger IO bottlenecks
深度学习与CV教程(13) | 目标检测 (SSD,YOLO系列)
How to adjust the font size of SQL editor in dbaver
5 sous - chaîne palindrome la plus longue (intervalle DP)
散列表 分布式散列表(DHT)哈希表
How to generate a QR code picture (add a Chinese logo) and save it to the specified picture static service address, so as to solve the problem that there are no QR code Chinese characters.
What does software testing do? Specific work content?
摩根大通期货这家公司怎么样?期货开户办理安全吗?
一季度全球TWS耳机出货6820万部:苹果份额第一,小米第三
Krypton Evening News - Apple won the lawsuit, and the US judge rejected the class action on iPhone and iPad security defects; It is reported that JD will pilot the catering takeout business
一季度全球PC GPU出货量下滑6.2%,疫情创造大量需求至此结束
【时序】TFT:具有可解释性的时间序列多步直接预测 Transformers[学习中...,亟待解决]