CN109753382A - A kind of restoration methods and system of database deletion record - Google Patents
A kind of restoration methods and system of database deletion record Download PDFInfo
- Publication number
- CN109753382A CN109753382A CN201811504797.3A CN201811504797A CN109753382A CN 109753382 A CN109753382 A CN 109753382A CN 201811504797 A CN201811504797 A CN 201811504797A CN 109753382 A CN109753382 A CN 109753382A
- Authority
- CN
- China
- Prior art keywords
- slot pointer
- offset address
- record
- deletion
- slot
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/21—Design, administration or maintenance of databases
Landscapes
- Engineering & Computer Science (AREA)
- Databases & Information Systems (AREA)
- Theoretical Computer Science (AREA)
- Data Mining & Analysis (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The present invention provides information processing method, system and the computer storage medium of a kind of recovery of database deletion record, this method comprises: obtaining slot pointer value;At least one deletion record is obtained according to the slot pointer value and current offset address;It parses at least one described deletion record and restores at least one described deletion record.According to the method for the present invention, system and computer storage medium carry out deleting data recovery according to situation of change of the real data after deletion record, and resume speed is quickly and recovery data are comprehensive.
Description
Technical field
This application involves field of computer technology, in particular to information security.
Background technique
SQLSERVER is the relevant database of Microsoft's exploitation, due to Microsoft
The fabulous compatibility of the universal and SQLSERVER database and WINDOWS operating system of WINDOWS operating system and
Stability, so that SQLSERVER database becomes most popular one of database.Therefore, in information security field pair
The recovery of the deletion record of SQLSERVER database is always the hot spot being concerned.Only have minority currently on the market to be based on
The manual restoration methods of online restoration methods or database administrator of log, without related skill in terms of offline recovery
Art.
Therefore, the defect for the record that can not undelete offline exists in the prior art.
Summary of the invention
The present invention is proposed in view of the above problem.The present invention provides a kind of recovery sides of database deletion record
Method, system and computer storage medium are restored by parsing data file method, service without operation data library, do not depend on day
Whether will file and affairs open the record that can undelete.
According to an aspect of the present invention, the restoration methods of a database deletion record are provided, which comprises
Obtain slot pointer value;
At least one deletion record is obtained according to the slot pointer value and current offset address;
It parses at least one described deletion record and restores at least one described deletion record.
Optionally, data slot pointer list is obtained;Traverse all slot pointers in the slot pointer list.
Optionally, described at least one deletion record is obtained according to the slot pointer value and current offset address to include:
Compare the size of the slot pointer value and current offset address, if the current offset address is less than the slot and refers to
Needle value, then confirming has deletion record before the slot pointer value;
The current offset address is set by offset address, and reads the offset address and obtains the first deletion record.
It is optionally, described that at least one deletion record is obtained according to the slot pointer value and current offset address further include:
If parsing the first deletion record success, repeat to judge whether there is also other deletion records before the slot pointer.
Optionally, described to judge before the slot pointer value whether there is also other deletion records and include:
The length that current offset address adds the current record is set by offset address;
Compare the size of the slot pointer value and the offset address, if the offset address is less than current slot pointer value
Size, read the offset address and obtain other deletion records before the pointer value.
It is optionally, described that at least one deletion record is obtained according to the slot pointer value and current offset address further include:
When other deletion records before the slot pointer value parse unsuccessful or offset address not less than the slot pointer value, stop
The repetition judges whether there is also other deletion records before the slot pointer.
It is optionally, described that at least one deletion record is obtained according to the slot pointer value and current offset address further include:
If it is not small that other deletion records before first deletion record or the slot pointer value parse unsuccessful or offset address
In the slot pointer value, then judge whether the slot pointer value is cleared;
If the slot pointer value is 0, the slot pointer value is set by offset address;
If the slot pointer value is not 0, judge whether the slot pointer is first slot pointer;If the slot refers to
Needle is first slot pointer, then the offset address initial value is set by offset address, if the slot pointer is not first
A slot pointer then sets offset address to the offset address of the previous slot pointer of the slot pointer plus the previous slot
The record length of pointer;
It reads the offset address and obtains the second deletion record.
It is optionally, described that at least one deletion record is obtained according to the slot pointer value and current offset address further include:
Judge whether the slot pointer is the last one slot pointer, if the slot pointer is not the last one slot pointer,
It then obtains next slot pointer and at least one deletion record is obtained according to next slot pointer value and current offset address.
It is optionally, described that at least one deletion record is obtained according to the slot pointer value and current offset address further include:
If the slot pointer is the last one slot pointer, current offset address is set plus current by offset address
The length of record;
Judge whether the offset address is greater than or equal to page-size, if the offset address is greater than or equal to the page
Size then terminates, and reads the offset address if the offset address is less than page-size and obtains third deletion record.
It is optionally, described that at least one deletion record is obtained according to the slot pointer value and current offset address further include:
If parse the third deletion record it is unsuccessful if terminate;If parsing the third deletion record success,
Repetition judges to whether there is other deletion records after the slot pointer.
Optionally, whether there is other deletion records after the judgement slot pointer includes:
The length that current offset address adds current record is set by offset address;
Judge whether the offset address is greater than or equal to page-size, if the offset address is greater than or equal to the page
Size then terminates, and is read after the offset address obtains the slot pointer if the offset address is less than page-size
Other deletion records.
It is optionally, described that at least one deletion record is obtained according to the slot pointer value and current offset address further include:
When other deletion records after the slot pointer value parse unsuccessful or offset address more than or equal to page-size, stop
The repetition judges whether there is also other deletion records after the slot pointer.
According to a further aspect of the invention, a kind of recovery system of database deletion record, including memory, processing are provided
Device and it is stored in the computer program run on the memory and on the processor, which is characterized in that the processor
The step of realizing preceding claim method when executing the computer program.
According to a further aspect of the invention, a kind of computer storage medium is provided, computer program is stored thereon with, it is special
The step of sign is, the above method is realized when the computer program is computer-executed.
Restoration methods, system and the computer storage medium of database deletion record according to an embodiment of the present invention, pass through
It parses data file method to restore, is serviced without operation data library, do not depend on journal file and whether affairs are opened and can be restored
Deletion record.
Detailed description of the invention
The embodiment of the present invention is described in more detail in conjunction with the accompanying drawings, the above and other purposes of the present invention,
Feature and advantage will be apparent.Attached drawing is used to provide to further understand the embodiment of the present invention, and constitutes explanation
A part of book, is used to explain the present invention together with the embodiment of the present invention, is not construed as limiting the invention.In the accompanying drawings,
Identical reference label typically represents same parts or step.
Fig. 1 is the schematic diagram of data file structure according to an embodiment of the present invention;
Fig. 2 is the schematic diagram of data page structure according to an embodiment of the present invention;
Fig. 3 is the schematic diagram of data recording structure according to an embodiment of the present invention;
Fig. 4 is a kind of schematic flow chart of the restoration methods of database deletion record according to an embodiment of the present invention;
Fig. 5 is a kind of exemplary schematic flow of restoration methods of database deletion record according to an embodiment of the present invention
Figure;
Fig. 6-Figure 13 is a kind of exemplary signal of the restoration methods of database deletion record according to an embodiment of the present invention
Figure.
Specific embodiment
In order to enable the object, technical solutions and advantages of the present invention become apparent, root is described in detail below with reference to accompanying drawings
According to example embodiments of the present invention.Obviously, described embodiment is only a part of the embodiments of the present invention, rather than this hair
Bright whole embodiments, it should be appreciated that the present invention is not limited by example embodiment described herein.Based on described in the present invention
The embodiment of the present invention, those skilled in the art's obtained all other embodiment in the case where not making the creative labor
It should all fall under the scope of the present invention.
SQLSERVER is the relevant database of Microsoft's exploitation, SQLSERVER field type can by regular length and
Variable-length is divided, and fixed length word segment type main Types have TinyInt, SmallInt, Int, BigInt, Float,
Real, DateTime, Date, Time, Money, SamllMoney, Char, nChar, Binary etc., variable field type are main
There are VarChar, nVarChar, VarBinary, Text, nText, Image etc..Field includes field name, field type, field
Length etc.;Table structure is by table name, major key, the composition such as index and several fields.
SQLSERVER data file is usually named by suffix of mdf or ndf, and file internal is substantially single with page (Page)
Position composition, and page is arranged in data file by page number (Page No) from small to large, as shown in Figure 1, Fig. 1 shows the present invention
The schematic diagram of the data file structure of embodiment.
And data page is the basic unit of composition data file, and the size PageSize of page is usually 8192 bytes, and one
Data file generally comprises a plurality of types of pages, such as file header page, starts page, data page, index page etc..Wherein data page is used
In the page of storage record.
Data page is made of three parts: 96 byte top margins (PageHeader), records (Record) list, is directed toward record
The slot (slot) of position, wherein has recorded Solt number in top margin portion;As shown in Fig. 2, Fig. 2 shows the numbers of the embodiment of the present invention
According to the schematic diagram of page structure.
Wherein, as shown in figure 3, Fig. 3 shows the schematic diagram of the data recording structure of the embodiment of the present invention.SQLSERVER
Interrecord structure includes:
Mode bit A: a byte, the record type comprising the record are accounted for, if having NULL bitmap, if include variable length
Column information.
Mode bit B: a byte is accounted for.
Fixed-length data length: two bytes are accounted for.
Fixed-length data content: fixed length column data length (FixDataLen) is the sum of each fixed-length field length.
Total columns (ColCount): two bytes are accounted for.
NULL bitmap: length is ((ColCount+7)/8).
Elongated columns (VarColCount): two bytes are accounted for.
Elongated line skew matrix: length is (VarColCount*2).
Elongated column data content: elongated column data length (VarDataLen) is that the end position of elongated line skew matrix subtracts
The initial position of elongated line skew matrix.
If bNullBit has indicated whether NULL bitmap, the bNullBit=1 when there is NULL bitmap, when without NULL bitmap
BNullBit=0.If bVarCol has indicated whether elongated column, when there is elongated column, bVarCol=1, when without elongated column
bVarCol.Then record length (RecordLength) calculation formula:
RecordLength=FixDataLen+VarDataLen+ (VarColCount*2)+bNullBit*
((ColCount+7)/8)+6+bVarCol*2。
It includes: master record (Primary Record), including data record that SQLSERVER, which records main Types,;Index note
It records (Index Record), the record including index data record;Row migration record (Forwoared Record), including by more
New content leads to record of the field data except the record;Ghost records (Gohst Record), including real labeled as deleting
The also not deleted record in border.
SQLSERVER in order to accelerate the rolling back action after record deletion and record deletion, delete by the logic for introducing record,
It records and is first marked as deleting, then execute physics deletion, these are marked as the record deleted i.e. ghost and record;Execute record
Physics deletes practical and track is reset, and there is no delete for real data;Page end tail is executed after physics is deleted and is written again
Data manipulation, real data is simultaneously uncovered, but slot pointer can be capped.
Based on the above principles, the embodiment of the invention provides a kind of restoration methods of database deletion record, pass through parsing
Data file method is restored, and services without operation data library, does not depend on journal file and whether affairs open and can undelete
Record.
Firstly, being described with reference to Figure 4 a kind of showing for the restoration methods of database deletion record for the embodiment of the present invention
Meaning flow chart, comprising:
Firstly, obtaining slot pointer value in step S410;
In step S420, at least one deletion record is obtained according to the slot pointer value and current offset address;
Finally, parsing at least one described deletion record in step S430 and restoring at least one described deletion record.
Optionally, data slot pointer list is obtained;Traverse all slot pointers in the slot pointer list.Traversal is all
Slot pointer can guarantee to obtain the comprehensive of deletion record, prevent from omitting the recovery for deleting data.
Deletion record can be obtained by different modes according to different record type, ghost be recorded, only
It is to be deleted not yet labeled as deleting, deletion record position directly can be obtained by slot pointer and parse the record;It is right
It is cleared situation in slot pointer, only track is reset, real data can pass through previous record position there is no deleting
It sets and gets the position that the slot corresponds to deletion record plus previous record length, read and parse the record;For slot pointer
Capped situation, real data is simultaneously uncovered, but slot pointer is capped, can analyze position and the record length of current record
Degree, record length has deletion record after judging current record if being less than next record position before current recording position sovolin,
Simultaneously read parsing in positioning deletion record position.
Optionally, described at least one deletion record is obtained according to the slot pointer value and current offset address to include:
Compare the size of the slot pointer value and current offset address, if the current offset address is less than the slot and refers to
Needle value, then confirming has deletion record before the slot pointer value;
The current offset address is set by offset address, and reads the offset address and obtains the first deletion record.
Wherein, not in the initial data of deletion record, the slot pointer value is identical as offset address, if some slot refers to
There are deletion records before the value of needle, then offset address becomes smaller, that is to say, that when offset address is less than the slot pointer value,
Illustrate that again there are deletion records before some slot pointer.After reading first deletion record before some slot pointer
Further repeat to judge whether there is also other deletion records before some slot pointer, until judge all this certain
Other existing deletion records or deletion record parsing are unsuccessful before a slot pointer.
And deletion record successfully resolved include: total columns in interrecord structure need it is consistent with table structure Field Count, record and tie
Variable length word number of segment is consistent with variable length word number of segment in table structure in structure, fixed-length data length and table structure are each fixed in interrecord structure
The sum of long field length is at least one of consistent.
It is optionally, described that at least one deletion record is obtained according to the slot pointer value and current offset address further include:
If parsing the first deletion record success, repeat to judge whether there is also other deletion records before the slot pointer.
Optionally, described to judge before the slot pointer value whether there is also other deletion records and include:
The length that current offset address adds the current record is set by offset address;
Compare the size of the slot pointer value and the offset address, if the offset address is less than current slot pointer value
Size, read the offset address and obtain other deletion records before the pointer value.
It is optionally, described that at least one deletion record is obtained according to the slot pointer value and current offset address further include:
When other deletion records before the slot pointer value parse unsuccessful or offset address not less than the slot pointer value, stop
The repetition judges whether there is also other deletion records before the slot pointer.
It is 0, then before passing through when reading slot pointer if the slot pointer value is cleared but real data is there is no deleting
One record position gets the position that the slot corresponds to deletion record plus previous record length, reads and parses the record;
It can also further judge that groove pin refers to whether first slot pointer then then leads to described in judgement if not first slot pointer
It crosses previous record position and gets the position that the slot corresponds to deletion record plus previous record length, read and parse the note
Record;If when first slot pointer and if first slot pointer be cleared, the position of the deletion record is 96 byte top margins
(PageHeader) start after, so offset address initial value can be 96.
It is optionally, described that at least one deletion record is obtained according to the slot pointer value and current offset address further include:
If it is not small that other deletion records before first deletion record or the slot pointer value parse unsuccessful or offset address
In the slot pointer value, then judge whether the slot pointer value is cleared;
If the slot pointer value is 0, the slot pointer value is set by offset address;
If the slot pointer value is not 0, judge whether the slot pointer is first slot pointer;If the slot refers to
Needle is first slot pointer, then the offset address initial value is set by offset address, if the slot pointer is not first
A slot pointer then sets offset address to the offset address of the previous slot pointer of the slot pointer plus the previous slot
The record length of pointer;
It reads the offset address and obtains the second deletion record.
Optionally, the offset address initial value is 96.Further, if first slot pointer is said if more than 96
The bright record for having deletion before the first slot pointer position.
It is optionally, described that at least one deletion record is obtained according to the slot pointer value and current offset address further include:
Judge whether the slot pointer is the last one slot pointer, if the slot pointer is not the last one slot pointer,
It then obtains next slot pointer and at least one deletion record is obtained according to next slot pointer value and current offset address.
Write-in data manipulation is carried out again since page end tail executes after physics is deleted, and real data is simultaneously uncovered, but slot
Pointer can be capped, so analyzing position and the record of current record when confirming the slot pointer is the last one slot pointer
Length, record length has deletion to remember after judging current record if being less than next record position before current recording position sovolin
Record positions deletion record position and reads parsing.
It is optionally, described that at least one deletion record is obtained according to the slot pointer value and current offset address further include:
If the slot pointer is the last one slot pointer, current offset address is set plus current by offset address
The length of record;
Judge whether the offset address is greater than or equal to page-size, if the offset address is greater than or equal to the page
Size then terminates, and reads the offset address if the offset address is less than page-size and obtains third deletion record.
It is optionally, described that at least one deletion record is obtained according to the slot pointer value and current offset address further include:
If parse the third deletion record it is unsuccessful if terminate;If parsing the third deletion record success,
Repetition judges to whether there is other deletion records after the slot pointer.
Optionally, whether there is other deletion records after the judgement slot pointer includes:
The length that current offset address adds current record is set by offset address;
Judge whether the offset address is greater than or equal to page-size, if the offset address is greater than or equal to the page
Size then terminates, and is read after the offset address obtains the slot pointer if the offset address is less than page-size
Other deletion records.
It is optionally, described that at least one deletion record is obtained according to the slot pointer value and current offset address further include:
When other deletion records after the slot pointer value parse unsuccessful or offset address more than or equal to page-size, stop
The repetition judges whether there is also other deletion records after the slot pointer.
It is further described referring to restoration methods of the Fig. 5 to the database deletion record of the embodiment of the present invention, Fig. 5 is shown
The exemplary schematic flow chart of restoration methods of database deletion record of the embodiment of the present invention a kind of.
Step S51 reads data page, and analyzes data page header information;And offset address Offset=96 is set;
Step S52 reads the slot pointer list of current data page, wherein setting slot pointer sum as N, first slot pointer is opened
Begin traversal, and is currently i-th of slot pointer;
Step S53 reads i-th of slot pointer, that is, current slot pointer value Slot;
Step S54, judges whether the current slot pointer value Slot is greater than offset address Offset, if the current slot
Pointer value Slot is greater than Offset, then illustrates that there are deletion records before i-th of slot pointer, execute step S55;If described work as
Preceding slot pointer value Slot is not more than Offset, executes step S56;
Step S55 reads the offset address offset and obtains the position of the deletion record, and parses the deletion note
Record:
Offset address Offset=Offset+Length is set if successfully resolved, Length is current record length,
To judge that whether there is also other deletion records before current i-th of slot pointer, repeat step S54;If parsing not at
Function thens follow the steps S56;
Step S56, judges whether i.e. i-th of the slot pointer of current slot pointer value Slot is cleared, and specifically includes: judgement
Whether Slot is 0, if Slot is 0, thens follow the steps S57;If Slot is not 0, Offset=Slot is set and is executed
Step S58;
Step S57 judges whether i-th of slot pointer is first slot, is specifically included: judging whether i is 1, if i is
1 is arranged offset address Offset=96, and offset address Offset=Offset+Length is arranged if i is not 1, wherein
Length is the length of current record, executes step S58;
Step S58 reads and parses current record, and obtains current record length Length;
Step S59 judges whether i-th of slot pointer is the last one slot, and specifically include: whether i is greater than or equal to
N;If i-th of slot pointer is the last one slot, S510 is executed, if i-th of slot pointer is not the last one
Slot, then i=i+1 and repeatedly step 53;
Step S510 is arranged Offset=Offset+Length, judges whether Offset is more than or equal to a page size
PageSize terminates if Offset is more than or equal to page size PageSize, no to then follow the steps S511;
Step S511 reads the position Offset and solves new record and obtain current record length Length;If be parsed into
Function then repeats step S510, terminates if parsing failure.
In one embodiment, it shows database according to an embodiment of the present invention referring to Fig. 6-Figure 13, Fig. 6-Figure 13 and deletes
Recovery except the exemplary schematic diagram of the restoration methods of record, with specific example to the database deletion record of the embodiment of the present invention
Method further illustrates.It is specific as follows:
Firstly, creation test database test.mdf;
Secondly, creating a test table student in test.mdf database.Table student includes three fields: the
One field name ID, field type Int, second field Name, field type VarChar, third field name Age,
Field type is SamllInt, as shown in Figure 6;
Again, several records are inserted into table student, as shown in Figure 7: deleting the 2nd and 3 article of record.Table after deletion
Data are as shown in Figure 8;The restoration methods of database deletion record according to an embodiment of the present invention are restored, and restoration result is as schemed
Shown in 9;
Then, all records of table student are deleted, table data are as shown in Figure 10 after deletion;It is according to an embodiment of the present invention
The restoration methods of database deletion record are restored, and restoration result is as shown in figure 11;
Then 2 datas, then into table are inserted into, are inserted into after data as shown in figure 12: data according to an embodiment of the present invention
The restoration methods of library deletion record are restored, and restoration result is as shown in figure 13.
It follows that the restoration methods of data deletion record according to an embodiment of the present invention, by parsing data file side
Method is restored, and services without operation data library, does not depend on journal file and whether affairs open the record that can undelete.
Those of ordinary skill in the art may be aware that list described in conjunction with the examples disclosed in the embodiments of the present disclosure
Member and algorithm steps can be realized with the combination of electronic hardware or computer software and electronic hardware.These functions are actually
It is implemented in hardware or software, the specific application and design constraint depending on technical solution.Professional technician
Each specific application can be used different methods to achieve the described function, but this realization is it is not considered that exceed
The scope of the present invention.
According to another aspect of the present invention, a kind of recovery system of database deletion record is provided, including storage device, with
And processor;
In restoration methods of the storage device storage for realizing database deletion record according to an embodiment of the present invention
Corresponding steps program code;
The processor is for running the program code stored in the storage device, to execute above according to of the invention real
Apply the corresponding steps of the restoration methods of the database deletion record of example.
In one embodiment, it executes when said program code is run by the processor and implements above according to the present invention
The corresponding steps of the restoration methods of the aforementioned data library deletion record of example.
In addition, according to embodiments of the present invention, additionally providing a kind of storage medium, storing program on said storage
Instruction, when described program instruction is run by computer or processor for executing the database deletion record of the embodiment of the present invention
Restoration methods corresponding steps, and for realizing the recovery system of database deletion record according to an embodiment of the present invention.
The computer readable storage medium can be any combination of one or more computer readable storage mediums, such as a meter
Calculation machine readable storage medium storing program for executing includes the computer-readable program code for being randomly generated action command sequence, another meter
Calculation machine readable storage medium storing program for executing includes the computer-readable program code for carrying out the recovery of database deletion record.
In one embodiment, the computer program instructions may be implemented real according to the present invention when being run by computer
Apply the restoration methods of the aforementioned data library deletion record of example.
In conclusion it is according to an embodiment of the present invention it is a kind of by the restoration methods of database deletion record, system and based on
Calculation machine storage medium is restored by parsing data file method, services without operation data library, do not depend on journal file and affairs
Whether unlatching can undelete record.
Although describing example embodiment by reference to attached drawing here, it should be understood that above example embodiment are only exemplary
, and be not intended to limit the scope of the invention to this.Those of ordinary skill in the art can carry out various changes wherein
And modification, it is made without departing from the scope of the present invention and spiritual.All such changes and modifications are intended to be included in appended claims
Within required the scope of the present invention.
The above description is merely a specific embodiment or to the explanation of specific embodiment, protection of the invention
Range is not limited thereto, and anyone skilled in the art in the technical scope disclosed by the present invention, can be easily
Expect change or replacement, should be covered by the protection scope of the present invention.Protection scope of the present invention should be with claim
Subject to protection scope.
Claims (14)
1. a kind of restoration methods of database deletion record, which is characterized in that the described method includes:
Obtain slot pointer value;
At least one deletion record is obtained according to the slot pointer value and current offset address;
It parses at least one described deletion record and restores at least one described deletion record.
2. the method as described in claim 1, which is characterized in that the method also includes:
Obtain data slot pointer list;Traverse all slot pointers in the slot pointer list.
3. the method as described in claim 1, which is characterized in that described to be obtained according to the slot pointer value and current offset address
At least one deletion record includes:
Compare the size of the slot pointer value and current offset address, if the current offset address is less than the slot pointer
Value, then confirming has deletion record before the slot pointer value;
The current offset address is set by offset address, and reads the offset address and obtains the first deletion record.
4. method as claimed in claim 3, which is characterized in that described to be obtained according to the slot pointer value and current offset address
At least one deletion record further include: if parsing first deletion record success, before repeating to judge the slot pointer
Whether there is also other deletion records.
5. method as claimed in claim 4, which is characterized in that described to judge whether there is also other before the slot pointer value
Deletion record includes:
The length that current offset address adds the current record is set by offset address;
Compare the size of the slot pointer value and the offset address, if the offset address is less than the big of current slot pointer value
It is small, it reads the offset address and obtains other deletion records before the pointer value.
6. method as claimed in claim 5, which is characterized in that described to be obtained according to the slot pointer value and current offset address
At least one deletion record further include: other deletion records before the slot pointer value parse unsuccessful or offset address not
When less than the slot pointer value, stops the repetition and judge whether there is also other deletion records before the slot pointer.
7. method as claimed in claim 6, which is characterized in that described to be obtained according to the slot pointer value and current offset address
At least one deletion record further include: if other deletion record solutions before first deletion record or the slot pointer value
Unsuccessful or offset address is analysed not less than the slot pointer value, then judges whether the slot pointer value is cleared;
If the slot pointer value is 0, the slot pointer value is set by offset address;
If the slot pointer value is not 0, judge whether the slot pointer is first slot pointer;If the slot pointer is
First slot pointer then sets the offset address initial value for offset address, if the slot pointer is not first slot
Pointer then sets offset address to the offset address of the previous slot pointer of the slot pointer plus the previous slot pointer
Record length;
It reads the offset address and obtains the second deletion record.
8. the method for claim 7, which is characterized in that described to be obtained according to the slot pointer value and current offset address
At least one deletion record further include:
Judge whether the slot pointer is that the last one slot pointer obtains if the slot pointer is not the last one slot pointer
It takes next slot pointer and at least one deletion record is obtained according to next slot pointer value and current offset address.
9. method according to claim 8, which is characterized in that described to be obtained according to the slot pointer value and current offset address
At least one deletion record further include:
If the slot pointer is the last one slot pointer, current offset address is set plus current record by offset address
Length;
Judge whether the offset address is greater than or equal to page-size, if the offset address is greater than or equal to page-size
Then terminate, reads the offset address if the offset address is less than page-size and obtain third deletion record.
10. method as claimed in claim 9, which is characterized in that described to be obtained according to the slot pointer value and current offset address
Take at least one deletion record further include:
If parse the third deletion record it is unsuccessful if terminate;If parsing the third deletion record success, repeat
Judge to whether there is other deletion records after the slot pointer.
11. method as claimed in claim 10, which is characterized in that deleted after the judgement slot pointer with the presence or absence of other
Except record includes:
The length that current offset address adds current record is set by offset address;
Judge whether the offset address is greater than or equal to page-size, if the offset address is greater than or equal to page-size
Then terminate, the offset address is read if the offset address is less than page-size and obtains other after the slot pointer
Deletion record.
12. method as claimed in claim 11, which is characterized in that described to be obtained according to the slot pointer value and current offset address
Take at least one deletion record further include: other deletion records after the slot pointer value parse unsuccessful or offset address
When more than or equal to page-size, stops the repetition and judge whether there is also other deletion records after the slot pointer.
13. a kind of recovery system of database deletion record, including memory, processor and be stored on the memory and
The computer program run on the processor, which is characterized in that the processor realizes power when executing the computer program
Benefit requires the step of any one of 1 to 12 the method.
14. a kind of computer storage medium, is stored thereon with computer program, which is characterized in that the computer program is counted
The step of calculation machine realizes any one of claims 1 to 12 the method when executing.
Priority Applications (3)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811504797.3A CN109753382B (en) | 2018-12-10 | 2018-12-10 | Recovery method and system for database deleted records |
EP19797973.5A EP3798842A4 (en) | 2018-12-10 | 2019-08-02 | Database deleted record recovery method and system |
PCT/CN2019/099121 WO2020119143A1 (en) | 2018-12-10 | 2019-08-02 | Database deleted record recovery method and system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811504797.3A CN109753382B (en) | 2018-12-10 | 2018-12-10 | Recovery method and system for database deleted records |
Publications (2)
Publication Number | Publication Date |
---|---|
CN109753382A true CN109753382A (en) | 2019-05-14 |
CN109753382B CN109753382B (en) | 2022-01-07 |
Family
ID=66403676
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201811504797.3A Active CN109753382B (en) | 2018-12-10 | 2018-12-10 | Recovery method and system for database deleted records |
Country Status (3)
Country | Link |
---|---|
EP (1) | EP3798842A4 (en) |
CN (1) | CN109753382B (en) |
WO (1) | WO2020119143A1 (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111104259A (en) * | 2019-12-23 | 2020-05-05 | 厦门市美亚柏科信息股份有限公司 | Database recovery method and device and storage medium |
WO2020119143A1 (en) * | 2018-12-10 | 2020-06-18 | 厦门市美亚柏科信息股份有限公司 | Database deleted record recovery method and system |
CN112650725A (en) * | 2020-12-30 | 2021-04-13 | 四川效率源信息安全技术股份有限公司 | Method for recovering DM8 database log file |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112307303A (en) * | 2020-10-29 | 2021-02-02 | 扆亮海 | Efficient and accurate network page duplicate removal system based on cloud computing |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1556483A (en) * | 2003-12-31 | 2004-12-22 | ����ͨѶ�ɷ�����˾ | Method of quickly locating record in data gage in data base |
CN101315628A (en) * | 2007-06-01 | 2008-12-03 | 华为技术有限公司 | Internal memory database system and method and device for implementing internal memory data base |
US20140330829A1 (en) * | 2011-04-27 | 2014-11-06 | Verisign, Inc. | Systems and methods for a cache-sensitive index using partial keys |
CN106970859A (en) * | 2017-03-31 | 2017-07-21 | 青岛海信移动通信技术股份有限公司 | Method and apparatus of the backup of offline mail with recovering |
CN108009049A (en) * | 2017-11-28 | 2018-05-08 | 厦门市美亚柏科信息股份有限公司 | The offline restoration methods of MYISAM storage engines deletion records, storage medium |
CN108062358A (en) * | 2017-11-28 | 2018-05-22 | 厦门市美亚柏科信息股份有限公司 | The offline restoration methods of innodb engine deletion records, storage medium |
Family Cites Families (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US5682513A (en) * | 1995-03-31 | 1997-10-28 | International Business Machines Corporation | Cache queue entry linking for DASD record updates |
CN101504660A (en) * | 2009-03-06 | 2009-08-12 | 清华大学 | Query management method and system of pure extensible markup language database |
WO2015163696A1 (en) * | 2014-04-23 | 2015-10-29 | 고려대학교 산학협력단 | Method and apparatus for recovering data in microsoft sql server database |
CN104199888B (en) * | 2014-08-25 | 2017-08-01 | 厦门市美亚柏科信息股份有限公司 | The data reconstruction method and device of Resilient file system |
CN109753382B (en) * | 2018-12-10 | 2022-01-07 | 厦门市美亚柏科信息股份有限公司 | Recovery method and system for database deleted records |
-
2018
- 2018-12-10 CN CN201811504797.3A patent/CN109753382B/en active Active
-
2019
- 2019-08-02 EP EP19797973.5A patent/EP3798842A4/en active Pending
- 2019-08-02 WO PCT/CN2019/099121 patent/WO2020119143A1/en unknown
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1556483A (en) * | 2003-12-31 | 2004-12-22 | ����ͨѶ�ɷ�����˾ | Method of quickly locating record in data gage in data base |
CN101315628A (en) * | 2007-06-01 | 2008-12-03 | 华为技术有限公司 | Internal memory database system and method and device for implementing internal memory data base |
US20140330829A1 (en) * | 2011-04-27 | 2014-11-06 | Verisign, Inc. | Systems and methods for a cache-sensitive index using partial keys |
CN106970859A (en) * | 2017-03-31 | 2017-07-21 | 青岛海信移动通信技术股份有限公司 | Method and apparatus of the backup of offline mail with recovering |
CN108009049A (en) * | 2017-11-28 | 2018-05-08 | 厦门市美亚柏科信息股份有限公司 | The offline restoration methods of MYISAM storage engines deletion records, storage medium |
CN108062358A (en) * | 2017-11-28 | 2018-05-22 | 厦门市美亚柏科信息股份有限公司 | The offline restoration methods of innodb engine deletion records, storage medium |
Non-Patent Citations (1)
Title |
---|
李爱武: "《SQL Server 2008数据库技术内幕》", 31 August 2012, 中国铁道出版社 * |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2020119143A1 (en) * | 2018-12-10 | 2020-06-18 | 厦门市美亚柏科信息股份有限公司 | Database deleted record recovery method and system |
CN111104259A (en) * | 2019-12-23 | 2020-05-05 | 厦门市美亚柏科信息股份有限公司 | Database recovery method and device and storage medium |
CN111104259B (en) * | 2019-12-23 | 2022-08-12 | 厦门市美亚柏科信息股份有限公司 | Database recovery method and device and storage medium |
CN112650725A (en) * | 2020-12-30 | 2021-04-13 | 四川效率源信息安全技术股份有限公司 | Method for recovering DM8 database log file |
Also Published As
Publication number | Publication date |
---|---|
CN109753382B (en) | 2022-01-07 |
EP3798842A4 (en) | 2022-04-13 |
EP3798842A1 (en) | 2021-03-31 |
WO2020119143A1 (en) | 2020-06-18 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109753382A (en) | A kind of restoration methods and system of database deletion record | |
CN111680634B (en) | Document file processing method, device, computer equipment and storage medium | |
CN108062358A (en) | The offline restoration methods of innodb engine deletion records, storage medium | |
US7483911B2 (en) | Sending log records directly from log buffer | |
US8065557B2 (en) | Apparatus for managing data backup | |
CN108388569A (en) | A kind of system and method for building up of quick key value database | |
CN108009049B (en) | MYISAM storage engine deleted record offline recovery method and storage medium | |
CN106445815A (en) | Automated testing method and device | |
DE112013001108B4 (en) | A METHOD, DEVICE, CONTROLLER, COMPUTER PROGRAM, AND COMPUTER PROGRAM PRODUCT FOR WRITING NEW DATA OF A FIRST BLOCK SIZE INTO A SECOND BLOCK SIZE USING A WRITE-WRITE MODE | |
CN109992476B (en) | Log analysis method, server and storage medium | |
CN108984337A (en) | A kind of restorative procedure of data synchronous abnormality, prosthetic device, medium and calculate equipment | |
CN102073554B (en) | Method and device for recovering files closed abnormally | |
US10311033B2 (en) | Alleviation of index hot spots in data sharing environment with remote update and provisional keys | |
US7801866B1 (en) | Systems and methods for reading only durably committed data in a system that otherwise permits lazy commit of transactions | |
CN104978241B (en) | A kind of data reconstruction method and device of COW type file systems | |
CN106897174B (en) | Fragment recovery method for MYSQL database | |
CN112395401A (en) | Adaptive negative sample pair sampling method and device, electronic equipment and storage medium | |
CN110263060A (en) | A kind of ERP electronic accessories management method and computer equipment | |
CN106371770B (en) | Method for writing data and device | |
Cho et al. | Finding forensic information on creating a folder in $ logfile of ntfs | |
CN113434734A (en) | Method, device, equipment and storage medium for generating file and reading file | |
WO2010038481A1 (en) | Computer-readable recording medium containing a sentence extraction program, sentence extraction method, and sentence extraction device | |
CN112749093A (en) | Test case management method, device, equipment and storage medium | |
CN105787098B (en) | A kind of oracle database table data history track store method and system | |
Freiling et al. | Reconstructing people's lives: A case study in teaching forensic computing |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |