当前位置:网站首页>Essentially a database data recovery 】 【 database cannot read data recovery case
Essentially a database data recovery 】 【 database cannot read data recovery case
2022-08-03 15:32:00 【North Asia Data Recovery】
SqlServer database failure & analysis:
The data of the SQL server database cannot be read.The administrator contacts our data recovery center for database data recovery.
The database data recovery engineer analyzed the faulty database and found that the reason why the SQL Server database file could not be read was because the underlying File Record was truncated to 0, the beginning of the file could not be found, and the data table structure was also damaged.The space of about 80M in front of the image file and a part of the space in the middle are overwritten, and the system table is damaged and cannot be read. Consider using an automatic backup file to extract the table structure.
日志中的操作记录:

Because the system table is damaged, the structure of a large number of data tables cannot be determined, and the recovery work can only be performed by database data recovery engineers based on experience.
Database data recovery plan:
After consultation with the Beiya database data recovery engineer team, the following database data recovery plan was determined:
Backup user data - analyze the database of the old data in the backup file - find the data table from the old databaseStructure——Extract the structure of a part of the data table from the log——Extract intact data from the log and residual data——Recover the corresponding data according to the log, and check whether the data is correct——Recover all data after checking that the data is correct.
SqlServer database data recovery process:
1. Backup data.
Hardware engineers first detect whether there is a physical failure of the hard drive.Make mirror backups of each hard disk after no hardware problems are found.
Backup all hard drive data with professional tools:

2. Scan image files.
Open the residual files with tools and analyze the underlying data of the hard disk, and find that there are still many SQL Server logs and backup files in the underlying hard disk.There are many operation records of database insert statements in the residual log.The table creation statement and some old data are found in the residual backup file, and try to extract the data.
In order to speed up data extraction, Beiya data recovery engineers have written a small program to extract database-related data, scan all residual database data in the entire hard disk, and extract all data.
3. Analyze scan data.
After analyzing all the scanned log files, it is found that there are data pages in the log files, which have a fixed beginning and end. Each piece of data has its own object ID number in a fixed position.Continue to search for data records with the same object Id, and find that the structure is the same. It can be determined that this is intact data and can be extracted.
After analyzing the scanned backup file, it is found that many table building statements can be extracted from it, and a part of the table structure can be obtained.For the remaining table structure, since the part truncated to 0 happens to be in the system table, there is no way to extract the table structure, and the table structure and data type can only be inferred from the data extracted from the log.
4. Extract data.
According to the previous analysis, Beiya data recovery engineer wrote a program to extract the table building statement from the backup file, analyze the table structure and various data types according to the table building statement, and search for 22H, 22H, 22H,07H, 05H table.Write a new program to extract the records in the log according to the correspondence between these established tables and OBJECT_IDs, correspond to the data and tables according to the object ID, and insert them into the new table.
5. Verify all data.
After verification by the administrator, the recovered new table is basically the same as the data observed using professional tools, and the data recovery is successful.

边栏推荐
猜你喜欢
随机推荐
【899. 有序队列】
cmd 关闭端口
DC-DC 2C(40W/30W) JD6606SX2退功率应用
Js array method is summarized
问题9:为什么有边界值的测试?
简单理解try catch和try finally
身为程序员的我们如何卷死别人?破局重生。
HDU 1029 Ignatius and the Princess IV
2021年12月电子学会图形化二级编程题解析含答案:消灭蝙蝠
一对多查询(分页)
基于牛顿方法在直流微电网潮流研究(Matlab代码实现)
FATFS | 中文显示 | 长文件名
【FPGA教程案例44】图像案例4——基于FPGA的图像中值滤波verilog实现,通过MATLAB进行辅助验证
并发编程的核心问题
您的移动端app安全吗
跨桌面端之组件化实践
夜神浏览器fiddler抓包
PHP高级面试题 - 第二天
【周报】2022年7月24日
聊聊这个SaaS领域爆火的话题









