Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What is the SqlServer database data recovery report?

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

This article introduces what the SqlServer database data recovery report is like, the content is very detailed, interested friends can refer to, hope to be helpful to you.

1. Overview of database failure

The data in the SQL server database cannot be read.

2. Fault analysis

The SQL server database file cannot be read because the underlying File Record is truncated to 0, the beginning of the file cannot be found, and the data table structure is corrupted. The front 80m left and rear space of the mirror file, and the middle part is overwritten, causing the system table to be damaged, so it can not be read, so consider using automatic backup files to extract the table structure.

The operation record in the log:

Due to the damage of the system table, the structure of a large number of data tables can not be determined and can only be recovered by the engineer based on experience.

3. Solution

Back up user data on the lost data of the hard disk. Make a full backup to ensure the security of the data.

Analyze the database of old data in the backup file.

Look for the structure of the data table from the old database.

Extract the structure of a part of the data table from the log.

Extract intact data from logs and residual data.

Recover the corresponding data according to the log and check whether the data is correct.

Check the data and restore all the data.

4. Data recovery implementation process

4.1 backing up user data

As all the data is placed on the customer's original disk, it is first handed over to the hardware department to check whether there is a physical fault in the hard disk. After testing that there is no problem, make a full mirror of each hard disk, and use a special tool to mirror all the sectors in the hard disk to a backup hard disk.

4.2 scan the image file

Open the residual files with winhex and carefully analyze the underlying data of the hard disk. It is found that there are still many former SQL server logs and backup files in the bottom of the hard disk. After careful inspection and analysis, it is found that there are many operational records of the database including insert statements in the log, which can be considered to be extracted. There are also backup files. If you open the backup files, you will find that there are table statements and some old data.

But because the whole hard disk is too large, it will be very slow to manually search the relevant data of SQL server, so write a Mini Program to extract the relevant data of the database, scan all the existing database residues in the whole hard disk, and extract all the data.

4.3 analyze scan data

Through the analysis of all the log files scanned, it is found that there are also score pages in the log file, with a fixed beginning and end, in which each piece of data has its own object ID number in a fixed location. In the following scanning file, continue to search for data records with the same object Id, and find that the structure is the same, which can be determined to be intact data and can be extracted.

After analyzing the scanned backup files, it is found that many table-building statements can be extracted from them, and a part of the table structure can be obtained. For the rest of the table structure, because the truncation of 0 happens to be in the system table, there is no way to extract the table structure, so we can only guess the table structure and data type from the data extracted from the log.

4.4 extract data

According to the conclusion of the previous analysis, we first write a program to extract the table-building statements from the backup files, analyze the table structure and various data types according to the table-building sentences, and look for tables 22H, 07H and 05H in the residual system tables, and establish the corresponding relationship between tables and OBJECT_ID according to these. Then write a new program to extract the records in the log (I can't parse the numeric type bytecode into data at this step, so it gets stuck), correspond to the data and the table according to object ID, and insert it into the new table.

4.5 validate all data

It has been verified that the new table recovered from the data is basically consistent with the manually observed data.

The data was recovered successfully.

About how the SqlServer database data recovery report is shared here, I hope the above content can be of some help to you, can learn more knowledge. If you think the article is good, you can share it for more people to see.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report