CN101078999A - Method and system for accomplishing data backup and recovery - Google Patents

Method and system for accomplishing data backup and recovery Download PDF

Info

Publication number
CN101078999A
CN101078999A CN 200610078430 CN200610078430A CN101078999A CN 101078999 A CN101078999 A CN 101078999A CN 200610078430 CN200610078430 CN 200610078430 CN 200610078430 A CN200610078430 A CN 200610078430A CN 101078999 A CN101078999 A CN 101078999A
Authority
CN
China
Prior art keywords
snapshot
data
unit
constantly
snapshot unit
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
Application number
CN 200610078430
Other languages
Chinese (zh)
Other versions
CN100464307C (en
Inventor
任永坚
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
HANGZHOU XINHE DATA TECHNOLOGY CO LTD
Original Assignee
Individual
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Individual filed Critical Individual
Priority to CNB2006100784300A priority Critical patent/CN100464307C/en
Publication of CN101078999A publication Critical patent/CN101078999A/en
Application granted granted Critical
Publication of CN100464307C publication Critical patent/CN100464307C/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Techniques For Improving Reliability Of Storages (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses a method to realize data backup and recovery, which is characterized by the following: arranging trigger snapshot event; choosing the time of trigger snapshot event as the snapshot time; recording the trigger snapshot event; distributing the address and the present value of the recorded data unit if receiving the modified order for the data unit before next event; executing the order; reading the snapshot unit between the present time and the recovery time; basing on the time order of distribution snapshot unit; writing the recorded data into the data unit of the snapshot unit recording address. This invention also discloses a system to realize data backup and recovery. This invention is fit for continuous protection of data.

Description

A kind of method and system that realize data backup and recovery
Technical field
The present invention relates to data storage technology, particularly relate to a kind of method and system that realize data backup and recovery.
Background technology
The data of computing machine are to be stored on the storage medium of computing machine.It is to cover former data with new data on storage medium that data are made amendment, and like this, if there are not special means, former data are that a lot of application in the still reality that can't be resumed all need to recover former data.For example, PC user is carried out some operation and is caused system crash, at this time just need to recover to carry out these operations original system data before, usually realize that it is the method that adopts schedule backup that data are recovered, be regular data are backuped on the backup storage medium, recover if desired, again data are imported former storage medium from backup storage medium.The shortcoming of this method is when no matter carrying out data backup or carrying out the data recovery, no matter whether data change, and carry out back up or restore without exception, cause the waste of backup storage medium on the one hand, take the processing power of system on the other hand.
The prior art solution to this problem is the method that is called snapshot that adopts as shown in Figure 1, and the core concept of this method is only to write down the data that change.The process flow diagram of this method as shown in Figure 1, the store status synoptic diagram of storage medium is as shown in Figure 2 when adopting this method.
Step 101: with snapshot constantly the data of data storage area as the reference data.
Set in advance the incident that triggers snapshot, when these incidents take place, just trigger snapshot one time, execution in step 101 is to step 111 then.Here, the moment of the incident generation of triggering snapshot is called snapshot constantly.
Step 102: set up new snapshot district, the state flag bit of all snapshot unit, snapshot district is and does not change.
In Fig. 2, the first snapshot district sets up constantly at first snapshot, and the second snapshot district sets up constantly at second snapshot, and the 3rd snapshot district sets up constantly at the 3rd snapshot.The snapshot unit in snapshot district and the data cell of data storage area are one to one.In inside, snapshot district, be state flag bit of each snapshot configuration of cells, state flag bit is used for representing that whether corresponding with it snapshot unit is through revising.Described state flag bit can be a bit, represents to revise when this binary digit is 1, represents unmodified when this binary digit is 0.The state flag bit of all snapshot unit, newly-established snapshot district all is unmodified.
Step 103: judge whether to receive the instruction that the data cell of data memory area is made amendment, if execution in step 104 then, otherwise execution in step 110.
The instruction that the data cell of a data memory area is made amendment should comprise two parts at least: the address of the data cell that revise and the data that will write.
Step 104 is to step 108: according to the address of the described data cell that will revise, determine this data cell corresponding respectively snapshot unit in all snapshot districts that set up; Then to determined each snapshot unit, judge respectively whether its state flag bit is unmodified, if then the currency of the data cell that will revise writes this snapshot unit, and the state flag bit of this snapshot unit is set to revise, otherwise keeps the currency of this snapshot unit.
For example in Fig. 2, at first snapshot constantly, in the newly-established first snapshot district, the state flag bit of all snapshot unit all is unmodified.Data in the comparison diagram 2 (a) after reference data and the variation are carved into second snapshot between the moment as can be seen during from first snapshot, the described instruction of being made amendment in the data unit, and 0001 data cell and 0002 data cell of data memory area are revised.Therefore at second snapshot constantly, the first snapshot district is shown in Fig. 2 (a).
When second snapshot snapshot constantly is triggered, the state flag bit of the snapshot unit corresponding with 0001 data cell of data storage area and 0002 data cell is for revising in the first snapshot district, and the state flag bit of the snapshot unit corresponding with 0003 data cell, 0004 data cell of data storage area all is unmodified; According to step 102, the second snapshot district is newly-built snapshot district, and the state flag bit of all snapshot unit all is unmodified.
From to reference data Fig. 2 (b) and change the back data more as can be seen, when second snapshot, be carved into the 3rd snapshot constantly between, 0002 data cell and 0003 data cell of the described instruction data memory area of being made amendment in the data unit are revised.For the first snapshot district, because the state flag bit of the snapshot unit corresponding with 0002 data cell for revising, therefore keeps the currency of this snapshot unit; And the state flag bit of the snapshot unit corresponding with 0003 data cell is unmodified, therefore the currency A with 0003 data cell writes in the snapshot unit corresponding with 0003 data cell in the first snapshot district, and this pairing state flag bit in snapshot unit is set to revise.For the second snapshot district, then the currency B with 0002 data cell writes in the snapshot unit corresponding with 0002 data cell in the second snapshot district, and this pairing state flag bit in snapshot unit is set to revise; The currency A of 0003 data cell is write in the snapshot unit corresponding with 0003 data cell in the second snapshot district, and this pairing state flag bit in snapshot unit is set to revise.Therefore, at the 3rd snapshot constantly, the first snapshot district and the second snapshot district are shown in Fig. 2 (b).
Step 109: carry out the instruction that described data memory area is made amendment.
Step 110: judge whether to arrive next snapshot constantly, if arrive, then execution in step 111, otherwise execution in step 103.
Step 111: finish this snapshot flow process.
In fact, the operation of next snapshot after the moment is exactly that repeating step 101 is to step 111.
Carrying out data when recovering, return to a certain snapshot if desired constantly, only need this snapshot constantly in the pairing snapshot district, state flag bit is written to corresponding data cell respectively and gets final product for the value of the snapshot unit revised.
From above description to prior art as can be seen, prior art just part solved in data backup and the problem of a large amount of occupying system resources when recovering.This be because, when data backup, be triggered at a plurality of snapshots, set up under the situation in a plurality of snapshots district, whenever receive the instruction that the data cell of a data memory area is made amendment, need set up in the snapshot district all, carry out verification with waiting the state flag bit of revising the corresponding snapshot unit of data cell; Then, the currency write state zone bit of the data cell that will revise is unmodified snapshot unit; And the state flag bit that upgrades these snapshot unit is for revising.Like this, in a write operation, repeatedly described state flag bit is read and write and verification with regard to needs, and repeatedly the data of snapshot unit are carried out write operation the data unit, thereby still can take the processing power of system in a large number, reduce the operational efficiency of system.The snapshot district that has set up is many more, and the reduction of running efficiency of system is just serious more.
And, prior art does not solve waste backup storage medium problem of resource, because in each snapshot moment, all need to distribute with the data storage area to have the fixed storage resource of same capability or certain proportion relation to set up this snapshot pairing snapshot district constantly.The snapshot district that sets up is many more, and the backup storage medium resource that takies is just many more.
Just because of above-mentioned technical restriction, in existing snapping technique, the quantity in snapshot district is restricted, and is difficult to realize the lasting protection of data.
Summary of the invention
In view of this; fundamental purpose of the present invention is to provide a kind of method and system that realize data backup and recovery; can either reduce system handles resource shared when data backup and data recovery; running efficiency of system when improving the recovery of data backup and data; can reduce the realization data again and recover needed backup storage medium, thereby realize the lasting protection of data.
In order to achieve the above object, of the present inventionly provide a kind of realization method of data backup, it is characterized in that, the incident that triggers snapshot is set, after the incident that at every turn triggers snapshot took place, this method comprised:
A, moment of taking place with the incident that triggers snapshot are write down the incident that this triggers snapshot as snapshot constantly;
B, judge whether to receive the instruction of being made amendment in the data unit, if receive, then distribute the snapshot unit record to wait to revise the address and the currency of data cell, carry out the described instruction of being made amendment in the data unit, execution in step C then, otherwise direct execution in step C;
C, judge whether to take place to trigger the incident of snapshot next time,, then finish current flow process, otherwise return execution in step B if take place.
Wherein, step B further comprises before distributing the snapshot unit:
Whether judgement is describedly waited to revise data cell and was modified after this incident that triggers snapshot takes place, if then directly carry out the described instruction of being made amendment in the data unit, otherwise distribute described snapshot unit.
Wherein, described snapshot unit comprises address area and data field, wherein the address area is used to write down the address of waiting to revise data cell, the data field is used to write down the currency of waiting to revise data cell, whether described judgement is describedly waited to revise data cell and had been modified and is after this incident that triggers snapshot takes place:
In the address area of the snapshot unit that judgement distributes after this incident that triggers snapshot takes place, whether write down the address of waiting to revise data cell, if think that then waiting to revise data cell was modified, otherwise think that waiting to revise data cell was not modified.
Wherein, this method further is included as state flag bit of each data cell configuration, and steps A further comprises:
The state flag bit that all data cells are set is unmodified;
Step B further comprises after receiving the instruction of being made amendment in the data unit:
Setting waits to revise the pairing state flag bit of data cell for revising;
Whether described judgement is describedly waited to revise data cell and had been modified and is after this incident that triggers snapshot takes place:
Judge after this incident that triggers snapshot takes place according to described state flag bit, describedly wait to revise data cell and whether be modified.
Wherein, step C takes a step forward and comprises finishing current flow process after the incident that next time triggers snapshot takes place:
Judge whether to trigger between the incident of snapshot, receive the instruction of cleaning snapshot unit,, then clear up the snapshot unit that has distributed, otherwise finish current flow process if receive in described incident and described next time that this triggers snapshot.
The snapshot unit that wherein said cleaning has distributed is:
The snapshot unit that has distributed is copied on the off-line store, discharge the shared storage space in snapshot unit that has distributed then;
Or
Set threshold value, the snapshot unit that described cleaning has distributed is:
Release is corresponding to the inferior shared storage space in snapshot unit that triggers the snapshot incident of threshold value the earliest;
Or
Set threshold value, the snapshot unit that described cleaning has distributed is:
To copy on the off-line store corresponding to the inferior snapshot unit that triggers the snapshot incident of threshold value the earliest, discharge its shared storage space then.
In order to achieve the above object, the present invention also provides a kind of method that realizes data backup and recovery, it is characterized in that, the incident that triggers snapshot is set, and after the incident that at every turn triggers snapshot took place, this method comprised:
U, moment of taking place with the incident that triggers snapshot are write down the incident that this triggers snapshot as snapshot constantly; Before triggering the incident generation of snapshot next time, if receive the instruction of being made amendment in the data unit, then distribute the snapshot unit, the address and the currency of data cell waited to revise in record, carries out the described instruction of being made amendment in the data unit then;
When data were recovered, this method also comprised:
V, read current time to the snapshot unit that is distributed between waiting to recover constantly, the time sequencing according to distributing described snapshot unit is written to recorded data in the snapshot unit in the data cell of snapshot unit institute recording address.
Wherein, described snapshot unit comprises address area and data field, wherein the address area is used to write down the address of waiting to revise data cell, the data field is used to write down the currency of waiting to revise data cell, described according to the time sequencing of distributing described snapshot unit, recorded data in the snapshot unit is written in the data cell of snapshot unit institute recording address and is:
V11, with current time and from snapshot unit that the nearest snapshot of current time distributes constantly as the snapshot unit that is untreated;
In V12, the untreated snapshot of the selection unit, the snapshot unit of close current time, with the data field recorded data of described snapshot unit, be written in the recorded data unit, address area of described snapshot unit, described snapshot unit is labeled as handles the snapshot unit then;
V13, judge current time and whether all be to have handled the snapshot unit from the snapshot unit of the nearest snapshot of current time between constantly, if, execution in step V14 then, otherwise return execution in step V12;
V14, judge describedly whether to recover constantly from the nearest snapshot of current time constantly,, otherwise will return execution in step V11 from the nearest snapshot of current time constantly as new current time if then finish current flow process for waiting;
Or
V21, be that each data cell distributes corresponding temporary storage location, and the data in the data cell are copied in the corresponding temporary storage location;
V22, with current time and from snapshot unit that the nearest snapshot of current time distributes constantly as the snapshot unit that is untreated;
In V23, the untreated snapshot of the selection unit, the snapshot unit of close current time, data field recorded data with described snapshot unit, be written in the temporary storage location corresponding, described snapshot unit be labeled as handle the snapshot unit then with the recorded data unit, address area of described snapshot unit;
V24, judge current time and whether all be to have handled the snapshot unit from the snapshot unit of the nearest snapshot of current time between constantly, if, execution in step V25 then, otherwise return execution in step V22;
V25, judge describedly whether to recover constantly from the nearest snapshot of current time constantly,, otherwise will return execution in step V21 from the nearest snapshot of current time constantly as new current time if then finish current flow process for waiting.
Wherein, step U further comprises before distributing the snapshot unit:
Whether judgement is describedly waited to revise data cell and was modified after this incident that triggers snapshot takes place, if then directly carry out the described instruction of being made amendment in the data unit, otherwise distribute described snapshot unit.
Wherein, described snapshot unit comprises address area and data field, wherein the address area is used to write down the address of waiting to revise data cell, the data field is used to write down the currency of waiting to revise data cell, described according to the time sequencing of distributing described snapshot unit, recorded data in the snapshot unit is written in the data cell of snapshot unit institute recording address and is:
V31, with current time and from snapshot unit that the nearest snapshot of current time distributes constantly as the snapshot unit that is untreated;
Any one snapshot unit in V32, the untreated snapshot of the selection unit, data field recorded data with described snapshot unit, be written in the recorded data unit, address area of described snapshot unit, described snapshot unit be labeled as handle the snapshot unit then;
V33, judge current time and whether all be to have handled the snapshot unit from the snapshot unit of the nearest snapshot of current time between constantly, if, execution in step V34 then, otherwise return execution in step V32;
V34, judge describedly whether to recover constantly from the nearest snapshot of current time constantly,, otherwise will return execution in step V31 from the nearest snapshot of current time constantly as new current time if then finish current flow process for waiting;
Or
V41, be that each data cell distributes corresponding temporary storage location, and the data in the data cell are copied in the corresponding temporary storage location;
V42, with current time and from snapshot unit that the nearest snapshot of current time distributes constantly as the snapshot unit that is untreated;
Any one snapshot unit in V43, the untreated snapshot of the selection unit, data field recorded data with described snapshot unit, be written in the temporary storage location corresponding, described snapshot unit be labeled as handle the snapshot unit then with the recorded data unit, address area of described snapshot unit;
V44, judge current time and whether all be to have handled the snapshot unit from the snapshot unit of the nearest snapshot of current time between constantly, if, execution in step V45 then, otherwise return execution in step V42;
V45, judge describedly whether to recover constantly from the nearest snapshot of current time constantly,, otherwise will return execution in step V41 from the nearest snapshot of current time constantly as new current time if then finish current flow process for waiting.
Wherein, when data are recovered, before step V, further comprise:
Be provided with the data recovered unit of wanting for making amendment by the described instruction of being made amendment in the data unit.
Wherein, described snapshot unit comprises address area and data field, wherein the address area is used to write down the address of waiting to revise data cell, the data field is used to write down the currency of waiting to revise data cell, described according to the time sequencing of distributing described snapshot unit, snapshot unit recorded data is written in the data cell of snapshot unit institute recording address and is:
V51, with remaining restore data unit as the untreatment data unit, with current time and the snapshot unit that distributes between waiting to recover constantly as the snapshot unit that is untreated;
In V52, the snapshot unit of selecting to be untreated,, judge whether the recorded data unit, address area of described snapshot unit is the untreatment data unit from the snapshot unit of waiting to recover constantly nearest, if, execution in step V53 then, otherwise execution in step V54;
V53, with the data field recorded data of described snapshot unit, be written in the recorded data unit, address area of described snapshot unit, the recorded data unit, address area of described snapshot unit is labeled as handles then;
V54, described snapshot unit is labeled as handles the snapshot unit, and whether the snapshot unit that distributes between judging current time and waiting to recover constantly if then finish current flow process, otherwise returns execution in step V52 all for handling the snapshot unit;
Or
V61, be that each data cell distributes corresponding temporary storage location, and the data in the data cell are copied in the corresponding temporary storage location;
V62, with remaining restore data unit as the untreatment data unit, with current time and the snapshot unit that distributes between waiting to recover constantly as the snapshot unit that is untreated;
In V63, the snapshot unit of selecting to be untreated,, judge whether the recorded data unit, address area of described snapshot unit is the untreatment data unit from the snapshot unit of waiting to recover constantly nearest, if, execution in step V64 then, otherwise execution in step V65;
V64, with the data field recorded data of described snapshot unit, be written in the temporary storage location corresponding with the recorded data unit, address area of described snapshot unit, the recorded data unit, address area of described snapshot unit is labeled as handles then;
V65, described snapshot unit is labeled as handles the snapshot unit, and whether the snapshot unit that distributes between judging current time and waiting to recover constantly if then finish current flow process, otherwise returns execution in step V63 all for handling the snapshot unit.
Wherein, after the incident that next time triggers snapshot took place, step U further comprised:
Judge whether to trigger between the incident of snapshot, receive the instruction of cleaning snapshot unit,, then clear up the snapshot unit that has distributed, otherwise finish current flow process if receive in described incident and described next time that this triggers snapshot.
Wherein, the snapshot unit that distributed of described cleaning is:
The snapshot unit that has distributed is copied on the off-line store, discharge the shared storage space in snapshot unit that has distributed then;
Or
To copy on the off-line store corresponding to the inferior snapshot unit that triggers the snapshot incident of threshold value the earliest, discharge its shared storage space then.
Wherein, when data are recovered, before step V, further comprise:
Judge and to wait to recover constantly whether pairing snapshot unit copies on the off-line store, if then with on the off-line store, the snapshot unit that is distributed after waiting to recover constantly copies on the on-line memory, execution in step V then, otherwise directly carry out V.
In order to achieve the above object, the present invention also provides a kind of system that realizes data backup and recovery, comprises the data storage area, it is characterized in that, this system further comprises:
Backup manager is used for according to the incident that triggers snapshot, and the instruction of making amendment of the data cell of data memory area, finishes data backup alternately with data storage area and snapshot district;
The snapshot district is used to write down the incident that triggers snapshot, and the address of the data cell that changes of data storage area and the currency of described data cell;
RMAN is used for carrying out the data recovery according to the current data of data storage area and the data in snapshot district, and recovered data is write the data storage area.
Wherein, this system further comprises:
Snapshot district manager is used for according to predefined operating strategy, and the data in management snapshot district, and mutual with the offline storage district back up the data in snapshot district;
The offline storage district is used for the data in backup snapshots district.
Wherein, described backup manager comprises:
The snapshot trigger module is used to detect the incident that triggers snapshot, and the information relevant with the incident that triggers snapshot is sent to snapshot district modified module;
The instruction interface module is used to receive the instruction that the data cell of data memory area is made amendment, and will wait that address and the currency of revising data cell send to snapshot district modified module, and carries out described instruction;
Snapshot district modified module, be used for the snapshot trigger module is sent with the relevant information of incident that triggers snapshot, and/or wait address and the currency of revising data cell that the instruction interface module is sent write the snapshot district.
Wherein, described instruction interface module further comprises:
The logic determines submodule is used for judging whether that needs will wait that address and the currency of revising data cell are recorded in the snapshot district.
Wherein, this system further comprises:
The working area is used for the intermediate data of store data rejuvenation;
Described RMAN further comprises:
The working area interface module is used for when data are recovered beginning, and the data of data storage area are copied to the working area; Carrying out data when recovering, the intermediate data of rejuvenation is being written to the working area; After recovery is finished, the working area data are copied to the data storage area.
Adopt technical scheme provided by the present invention, the snapshot district is the storage area of a dynamic expansion, and the storage resources in snapshot district is the needs according to data recording, dynamic assignment.At each snapshot constantly, do not allocate in advance have same capability or certain proportion relation with whole data storage area storage resources as the snapshot district, and just in the snapshot district, distribute a snapshot unit, note the incident that triggers current snapshot.Then when receiving the instruction that data memory area is made amendment, only under the situation that this data cell was not taking place behind this snapshot to change, just can in the snapshot district, distribute a snapshot unit, with the address of the described data cell that will revise, and the currency of the data cell that will revise is recorded in the newly assigned snapshot unit.Between the moment, the data cell that only changes is just understood corresponding maximum snapshot unit in the snapshot district at two snapshots.So just saved taking to the backup storage medium resource.
And, with respect to existing snapping technique, after new snapshot is triggered, the snapshot unit that new snapshot was distributed constantly can further store on the such offline storage medium of tape, thereby discharge the shared online resources of storage media in these snapshot unit, further reduce taking online resources of storage media.
And aspect the taking of system handles resource, under the situation that a plurality of snapshots are triggered, whenever receive the instruction that the data cell of a data memory area is made amendment, the operation that technical scheme of the present invention will be carried out, in the snapshot unit that is distributed after just this snapshot is triggered in the snapshot district, carry out once traversal and comparison at data cell region, add at most once therefore the write operation of newly assigned snapshot unit, the required system handles resource that takies of finishing of a data modification has nothing to do with the snapshot number that has been triggered, thereby saved the processing power of system, improved the treatment effeciency of system.
Because this all is improved aspect two taking the system handles resource and take the backup storage medium resource in the present invention, so the quantity of snapshot can set as required, helps realizing the lasting protection of data.
Description of drawings
Fig. 1 is the process flow diagram of existing snapshot technology;
Fig. 2 is the store status synoptic diagram of existing snapshot technology storage medium;
Fig. 3 is the process flow diagram of realization data back up method provided by the present invention;
Fig. 4 is the store status synoptic diagram of realization data back up method storage medium provided by the present invention;
Fig. 5 is the process flow diagram of the method embodiment one of realization data recovery provided by the present invention;
Fig. 6 is the store status synoptic diagram of method embodiment one storage medium of realization data recovery provided by the present invention;
Fig. 7 is the process flow diagram of the method embodiment two of realization data recovery provided by the present invention;
Fig. 8 is the method embodiment two storage medium stores view that realization data provided by the present invention are recovered;
Fig. 9 is the block scheme of the system of realization data backup provided by the invention and recovery.
Embodiment
Core concept of the present invention is: adopt data backup and recovery technology based on snapshot, wherein when data backup, data cell region and the preceding value of variation with changing first behind the snapshot are recorded in the snapshot unit in the snapshot district; When data were recovered, all snapshot unit between reading current time and waiting to recover constantly carried out data according to the time sequencing data memory area and recover.
For making the purpose, technical solutions and advantages of the present invention clearer, the present invention is described in further detail below in conjunction with drawings and the specific embodiments.
Please refer to Fig. 3 and Fig. 4, Fig. 3 is the process flow diagram of realization data back up method provided by the present invention, and Fig. 4 is the store status synoptic diagram of realization data back up method storage medium provided by the present invention.This method may further comprise the steps when data backup:
Step 301: with this snapshot constantly the data of data storage area and in the snapshot district, write down trigger event as the reference data.
Set in advance the incident that triggers snapshot, when these incidents take place, just trigger snapshot one time, execution in step 301 is to step 309 then.Described triggering snapshot incident can be to arrive the predefined moment, also can be to receive predefined instruction, perhaps is about to carry out preset operation.Can index of reference number expression trigger the incident of snapshot, for example arriving the predefined moment is 001, the snapshot instruction that receives the user is 010, being about to system is carried out great change is 011 or the like.And,, can also add different information as required for the incident of different triggering snapshots.For example the snapshot that triggers for the predefined moment of arrival can further write down the moment that is arrived; For soon system being carried out great change, can also further write down the type of the change of being carried out, these additional informations also can be represented with call number.
Snapshot district and data storage area can be positioned on the same physical storage medium, also can lay respectively on the different physical storage mediums, but must be online storage mediums.So-called online storage medium is exactly that system can directly carry out read-write operation to this storage medium, and need not earlier this storage medium be linked in the system, just can carry out read-write operation then.Relative, the storage medium that needs first connecting system just can carry out read-write operation then is called the offline storage medium.
Step 302: judge whether to receive the instruction that the data cell of data memory area is made amendment, if receive, then execution in step 303, otherwise execution in step 306.
Step 303: whether data cell specified in the decision instruction is carrying out overwriting behind this snapshot in the snapshot district, if carried out overwriting, then execution in step 305, otherwise execution in step 304.
As previously mentioned, in the instruction that the data cell of described data memory area is made amendment, comprise the address of the data cell that will revise and the data that will write this data cell at least.And what write down in the snapshot district is the address of the data cell that will revise, and the currency of this data cell.Therefore, as long as relatively in the recorded data element address of being distributed behind this snapshot, snapshot unit, whether the address that is comprised in the described instruction has been arranged, just can judge the specified data cell of described instruction and in the snapshot district, carry out overwriting behind this snapshot.If in the recorded data element address of being distributed behind this snapshot, snapshot unit, the address that is comprised in the described instruction has been arranged, so just think that the specified data cell of described instruction carrying out overwriting behind this snapshot in the snapshot district.
Another judges that data cell specified in the described instruction in the method for whether having carried out overwriting behind this snapshot in the snapshot district is, be state flag bit of each data cell configuration, state flag bit is used for representing that whether corresponding with it data cell is through revising.Described state flag bit can be a bit, represents to revise when this binary digit is 1, represents unmodified when this binary digit is 0.After a snapshot was triggered, the state flag bit that all data cells are set was unmodified; After specific data cell being carried out modification according to described instruction, the pairing shape will of this data cell zone bit is set for revising.
Step 304: in the snapshot district, distribute a snapshot unit, write down the data cell region that comprised in the described instruction and the currency of this data cell.
Described snapshot unit comprises address area and data field at least, and wherein the address area is used for writing down the data cell region that described instruction comprises, and the data field is used to write down the currency of this data cell.
Step 305: carry out the instruction that the described data cell that receives data memory area is made amendment.
In fact this step is exactly with the data to be written that comprised in the described instruction, is written to the specified data cell of described instruction.
Step 306: judge whether to arrive next snapshot constantly, if execution in step 307 then, otherwise return execution in step 302.
This step is actually the incident that judges whether to take place next time to trigger snapshot.
Step 307: judge whether to receive the instruction of cleaning snapshot unit, if receive, then execution in step 308, otherwise execution in step 309.
Here said instruction of receiving cleaning snapshot unit refers to and be carved into described next snapshot of step 306 was received cleaning snapshot unit constantly instruction when described this snapshot of step 301.
Because the data in snapshot district can increase in time gradually, if do not clear up, can take too much online storage resources.Therefore, can set the maximum storage capacity in snapshot district, if the data in current snapshot district during near the maximum storage capacity in snapshot district, the instruction of just sending cleaning snapshot unit; Also can be provided with a cleaning room every, when since last time cleaning, institute's elapsed time arrive cleaning room every after, just send the instruction of clearing up the snapshot unit.
Step 308: the data in the snapshot district are copied on the off-line store, and empty the snapshot district.
As a kind of replacement scheme, can set in advance a threshold value.When execution in step 308, not that all the snapshot unit in the snapshot district are duplicated and empty the snapshot district, but with in the snapshot district, the snapshot of threshold value the earliest pairing snapshot unit constantly copies on the off-line store, discharges a described threshold value the earliest snapshot shared storage space in pairing snapshot unit constantly then.Certainly, also can directly discharge described in the snapshot district the earliest a threshold value snapshot shared storage space in pairing snapshot unit constantly.Because snapshot is one to one with the incident that triggers snapshot constantly, the therefore described snapshot of threshold value the earliest is pairing snapshot unit constantly, just the pairing snapshot of the incident unit of time triggering snapshot of threshold value the earliest.
For example, in Fig. 4, if first snapshot is the snapshot moment the earliest constantly, and described threshold value is 1, and received the instruction of clearing up the snapshot district constantly in second snapshot moment and the 3rd snapshot, so when the 3rd snapshot arrives, just will be used to write down the snapshot unit of the incident of the first time trigger snapshot, and first snapshot constantly and two snapshot unit being distributed constantly of second snapshot copy on the off-line store, discharge this three storage spaces that the snapshot unit is shared then.If received the instruction of clearing up the snapshot district constantly once more in the 3rd snapshot moment and the 4th snapshot, so when the 4th snapshot arrives, just will be used to write down the snapshot unit of the incident of the second time trigger snapshot, and second snapshot constantly and two snapshot unit being distributed constantly of the 3rd snapshot copy on the off-line store, discharge this three storage spaces that the snapshot unit is shared then.
Certainly, step 307 and step 308 all are optional.
Step 309: finish current flow process.
In fact, the operation of next snapshot after the moment is exactly that repeating step 301 is to step 309.
As first kind of replacement scheme, can omit step 303.When receiving the instruction that the data cell of data memory area makes amendment, whether revise by process after this snapshot is triggered for data cell specified in no matter instructing, all distribute a snapshot unit in the snapshot district, the address and the currency of data cell waited to revise in record.
As second kind of replacement scheme, when the incident of described triggering snapshot was set, the instruction that the data cell of receiving data memory area can be made amendment was set to trigger the incident of snapshot.That is to say, whenever receive the instruction that the data cell of a data memory area is made amendment, just trigger snapshot one time, record triggers the snapshot incident, and distributes a snapshot unit record to wait to revise the address and the currency of data cell.In this case, the judgement that step 303 is done, its result is always not, so step 303 also can be omitted.
In Fig. 4 (a), first snapshot is after the moment, and at first execution in step 301, record first snapshot trigger event constantly in the snapshot district.Suppose first snapshot constantly after, arrive second snapshot constantly before, receive the instruction that the data cell of two data memory area is made amendment.Article one, instruction is the value with data cell 0001, is revised as B from current A.Like this, after the judgement through step 302 and step 303, execution in step 304, distribute a snapshot unit, note the address of data cell 0001 and the currency A of data cell 0001, execution in step 305 is revised as B with the value of data cell 0001 then, because next snapshot of no show constantly, returns execution in step 302.
The instruction that the data cell of second data memory area is made amendment is the value with data cell 0002, is revised as B from current A.Like this, after the judgement through step 302 and step 303, execution in step 304 is distributed a snapshot unit, notes the address of data cell 0002 and the currency A of data cell 0002, and execution in step 305 is revised as B with the value of data cell 0002 then.Next arrive next snapshot constantly, finish current flow process, re-execute step 301.If received the instruction of cleaning snapshot unit before this, then the data with the snapshot district copy on the off-line store, empty the snapshot district then.
In Fig. 4 (b), second snapshot is after the moment, and at first execution in step 301, record second snapshot trigger event constantly in the snapshot district.Suppose second snapshot constantly after, arrive the 3rd snapshot constantly before, receive the instruction that the data cell of two data memory area is made amendment.Article one, instruction is the value with data cell 0002, is revised as C from current B.Like this, after the judgement through step 302 and step 303, execution in step 304 is distributed a snapshot unit, notes the address of data cell 0002 and the currency B of data cell 0002, and execution in step 305 is revised as C with the value of data cell 0002 then.Because next snapshot of no show constantly, returns execution in step 302.
The instruction that the data cell of second data memory area is made amendment is the value with data cell 0003, is revised as C from current A.Like this, after the judgement through step 302 and step 303, execution in step 304 is distributed a snapshot unit, notes the address of data cell 0003 and the currency A of data cell 0003, and execution in step 305 is revised as C with the value of data cell 0003 then.Next arrive next snapshot constantly, finish current flow process, re-execute step 301.If received the instruction of cleaning snapshot unit before this, then the data with the snapshot district copy on the off-line store, empty the snapshot district then.
In Fig. 4 (c), the 3rd snapshot is after the moment, and at first execution in step 301, record second snapshot trigger event constantly in the snapshot district.Suppose the 3rd snapshot constantly after, arrive the 4th snapshot constantly before, receive the instruction that the data cell of three data memory area is made amendment.Article one, instruction is the value with data cell 0003, is revised as D from current C.Like this, after the judgement through step 302 and step 303, execution in step 304 is distributed a snapshot unit, notes the address of data cell 0003 and the currency C of data cell 0003, and execution in step 305 is revised as D with the value of data cell 0003 then.Because next snapshot of no show constantly, returns execution in step 302.
The instruction that the data cell of second data memory area is made amendment is the value with data cell 0004, is revised as D from current A.Like this, after the judgement through step 302 and step 303, execution in step 304 is distributed a snapshot unit, notes the address of data cell 0004 and the currency A of data cell 0004, and execution in step 305 is revised as D with the value of data cell 0004 then.Because next snapshot of no show constantly, returns execution in step 302.
Article three, the data cell of the data memory area instruction of making amendment is the value with data cell 0003, is revised as E from current C.But, through after the judgement of step 303, because data cell 0003 has been carried out overwriting in the snapshot district, therefore execution in step 304 not, direct execution in step 305 is revised as E with the value of data cell 0003.Next arrive next snapshot constantly, finish current flow process, re-execute step 301.If received the instruction of cleaning snapshot unit before this, then the data with the snapshot district copy on the off-line store, empty the snapshot district then.
Please refer to Fig. 5 and Fig. 6, Fig. 5 is the process flow diagram of the method embodiment one of realization data recovery provided by the present invention, and Fig. 6 is the store status synoptic diagram of method embodiment one storage medium of realization data recovery provided by the present invention.
Step 501: set up the working area identical, the data of current time data storage area are copied in the working area, and set up between the data cell region of the temporary storage location address in working area and data storage area relation one to one with the data storage area capacity.
In Fig. 6, close one to one between the temporary storage location address of supposing described working area and the data cell region of data storage area and be: data cell region adds that 1000 are corresponding temporary storage location address.Certainly, in actual applications, can adopt various corresponding relation.
Step 502: read in the snapshot district, from the nearest snapshot of current time constantly after, up to the snapshot unit that current time write down.
In Fig. 6, be current time to change the back for the third time among Fig. 4 (c), the 3rd snapshot among Fig. 4 (c) is from the nearest snapshot moment of current time constantly.Then in the described snapshot of step 502 district, from the nearest snapshot of current time constantly after, be exactly in the snapshot district up to the snapshot unit that current time write down, the snapshot unit that the 3rd snapshot is write down after the incident constantly.
Step 503: with all snapshot unit of being read as the snapshot unit that is untreated.
Step 504: select any one snapshot unit from untreated snapshot unit, the data cell region according to wherein writing down according to the corresponding relation of described temporary storage location address and data cell region, calculates the address of temporary storage location.
With selected snapshot unit is in the snapshot district among Fig. 6, the 3rd snapshot first snapshot unit, back constantly is an example, this recorded data element address, snapshot unit is 0003, then according to the corresponding relation between data cell region described in the step 501 and the temporary storage location address, can obtain corresponding temporary storage location address is 1003.
If when data backup, omitted step 303, so in step 504, need to select earlier in the described untreated snapshot unit, the snapshot unit of close current time, data cell region according to wherein writing down according to the corresponding relation of described temporary storage location address and data cell region, calculates the address of temporary storage location.Just according to from current time to described from the nearest snapshot of current time sequential processes snapshot unit constantly.
Step 505: according to the temporary storage location address that obtains in the step 504, the data that write down in the selected snapshot unit in the step 504 are written to this temporary storage location, and selected snapshot unit in the step 504 is labeled as handles the snapshot unit.
With snapshot unit selected in the step 504 is in the snapshot district among Fig. 6, and the 3rd snapshot first snapshot unit, back constantly is an example, and this snapshot unit recorded data is C, and then with in the working area, the address is that the value of 1003 data cell is revised as C.
Step 506: whether all snapshot unit that read in the determining step 502 are has been handled the snapshot unit, if then execution in step 507, otherwise execution in step 504.
Step 507: the data in the working area are copied in the data storage area.
Need to prove that in the present invention, waiting to recover constantly is snapshot any one in the moment.If the data after changing for the third time from Fig. 4 (c) return to second snapshot data constantly among Fig. 4 (b), only need is current time to change the back for the third time among Fig. 4 (c) at first, execution in step 502 is to step 506, and then be current time constantly with the 3rd snapshot among Fig. 4 (c), execution in step 502 is to step 506 once more, and last execution in step 507 gets final product.
If the data after changing for the third time from Fig. 4 (c) return to first snapshot data constantly among Fig. 4 (a), only need is current time to change the back for the third time among Fig. 4 (c) at first, execution in step 502 is to step 506, be current time constantly with the 3rd snapshot among Fig. 4 (c) then, execution in step 502 is to step 506, and then be current time constantly with second snapshot among Fig. 4 (b), execution in step 502 is to step 506, and last execution in step 507 gets final product.
In aforesaid embodiment, for the data after will changing for the third time from Fig. 4 (c) return to first snapshot data constantly among Fig. 4 (a), be actually and used successively in the snapshot district, constantly later snapshot unit and the constantly later snapshot unit of first snapshot of snapshot unit, second snapshot that the 3rd snapshot is constantly later.Below among the embodiment that will describe, for the data after will changing for the third time from Fig. 4 (c) return to first snapshot data constantly among Fig. 4 (a), will use in the snapshot district constantly later snapshot unit and the constantly later snapshot unit of the 3rd snapshot of snapshot unit, second snapshot that first snapshot is constantly later successively.
Please refer to Fig. 7 and Fig. 8, Fig. 7 is the process flow diagram of the method embodiment two that recovers of realization data provided by the present invention, and Fig. 8 is the store status synoptic diagram of method data that realization data provided by the present invention are recovered embodiment two storage mediums when recovering.
Step 701: set up the working area identical with the data storage area capacity, the data of current time data storage area are copied in the working area, and set up between the data cell region of the temporary storage location address in working area and data storage area relation one to one, and with all temporary storage locations in the working area as the temporary storage location that is untreated.
In Fig. 8, close one to one between the temporary storage location address of supposing described working area and the data cell region of data storage area and be: data cell region adds that 2000 are corresponding temporary storage location address.Certainly, in the practical application, can adopt various corresponding relation.
Step 702: read in the snapshot district, be carved into all the snapshot unit between the current time when to be recovered.
In Fig. 8, the snapshot unit that is read is exactly 6 all in snapshot district snapshot unit.
Step 703: with all snapshot unit of being read as the snapshot unit that is untreated.
Step 704: select in the untreated snapshot unit, the most close snapshot unit waiting to recover the moment, the data cell region according to wherein writing down according to the corresponding relation of described temporary storage location address and data cell region, calculates the address of temporary storage location.
In Fig. 8, the most close in the untreated snapshot unit to wait to recover snapshot unit constantly be exactly first snapshot first snapshot unit after constantly.After handling first snapshot first snapshot unit after the moment, the most close snapshot unit constantly that recovers is exactly second the snapshot unit of first snapshot after the moment in the untreated snapshot unit.After handling second the snapshot unit of first snapshot after the moment, the most close snapshot unit constantly that recovers is exactly second snapshot first snapshot unit after the moment in the untreated snapshot unit.The rest may be inferred.
Step 705: whether the temporary storage location that obtains in the determining step 704 is the temporary storage location that is untreated, if then execution in step 706, otherwise execution in step 707.
Step 706: according to the temporary storage location address that obtains in the step 704, the data that write down in the selected snapshot unit in the step 704 are written to this temporary storage location, and selected snapshot unit in the step 704 is labeled as handles the snapshot unit, resulting temporary storage location in the step 704 is labeled as handles temporary storage location.
In Fig. 8, when handling first snapshot unit after constantly of first snapshot, according to this recorded data element address, snapshot unit, resulting temporary storage location address is 2001, because this temporary storage location is the temporary storage location that is untreated, then first the snapshot unit recorded data A of first snapshot after constantly write temporary storage location 2001, and temporary storage location 2001 is labeled as handles temporary storage location.
When handling second snapshot unit after constantly of first snapshot, according to this recorded data element address, snapshot unit, resulting temporary storage location address is 2002, because this temporary storage location is the temporary storage location that is untreated, then second the snapshot unit recorded data A of first snapshot after constantly write temporary storage location 2002, and temporary storage location 2002 is labeled as handles temporary storage location.
When handling first snapshot unit after constantly of second snapshot, according to this recorded data element address, snapshot unit, resulting temporary storage location address is 2002, because this temporary storage location has been marked as and has handled temporary storage location, therefore this temporary storage location is not done any operation.
The rest may be inferred for later disposal route.
Step 707: whether all snapshot unit that read in the determining step 702 are has been handled the snapshot unit, if execution in step 708 then, otherwise return execution in step 704.
Step 708: the data in the working area are copied in the data storage area.
Certainly, no matter be when the method data that the realization data that invention is provided are recovered are recovered among embodiment one or the embodiment two, the data in working area also can directly offer the user and use, and need not to copy in the data storage area, that is to say and can omit step 708.
And, no matter be when the method data that the realization data that invention is provided are recovered are recovered, among embodiment one or the embodiment two, can not set up the working area, directly carry out recovery operation to the data storage area.
Do not having under the situation in working area, among the embodiment one, step 501 and step 507 can be saved; Step 504 changes into from untreated snapshot unit and selects any one snapshot unit; Step 505 changes the data that will write down in the selected snapshot unit in the step 504 into and is written to the data cell that writes down in the selected snapshot unit in the step 504, and selected snapshot unit in the step 504 is labeled as handles the snapshot unit.
Do not having under the situation in working area, among the embodiment two, step 701 is revised as all data cells with the data storage area as the untreatment data unit; Step 704 is revised as selects in the untreated snapshot unit the most close snapshot unit waiting to recover the moment; Step 705 changes whether recorded data unit, selected snapshot unit is the unit that is untreated in the determining step 704 into; Step 706 changes the data cell region that writes down according in the selected snapshot unit in the step 704 into, the data that write down in the selected snapshot unit in the step 704 are written to this data cell, and selected snapshot unit in the step 704 is labeled as handles the snapshot unit, the data cell that writes down in the selected snapshot unit in the step 704 is labeled as the reduced data unit; Save step 708.
Need to prove, whether no matter the working area be set, before carrying out recovery operation, all need to make described data storage area for revising by external command if adopt the restoration methods of embodiment one.Here the instruction that the data cell that said external command is exactly a data memory area described in the step 302 is made amendment.
Need to prove in addition, no matter be to adopt the restoration methods of embodiment one or the restoration methods of embodiment two, before carrying out recovery operation, all snapshot unit that write down from current time to the snapshot district waiting to recover constantly must be stored on the online memory device, the data of transferring on the off-line store need at first copy on the online memory device, could carry out recovery operation then.
Please refer to Fig. 9, Fig. 9 is the block scheme of the system of realization data recovery provided by the invention.
This system comprises:
The data storage area is used to store data.When data backup, the data storage area is mutual with backup manager as data source; When data were recovered, the data storage area was mutual with RMAN as recovering target.
Backup manager, be used for according to the incident that triggers snapshot, and the instruction of making amendment of the data cell of data memory area, finish data backup alternately with data storage area and snapshot district, comprise snapshot trigger module, snapshot district modified module and instruction interface module.
The snapshot trigger module is used to detect the incident that triggers snapshot, has judged whether to take place to trigger the incident of snapshot; After the incident that triggers snapshot took place, the snapshot trigger module judged that further which kind of has taken place triggers the incident of snapshot, and the information relevant with the incident that triggers snapshot is sent to snapshot district modified module.
The instruction interface module, be used to judge whether to receive the instruction that the data cell of data memory area is made amendment, if receive, then further judging whether needs to wait that address and the currency of revising data cell are recorded in the snapshot district, if desired, will wait that then address and the currency of revising data cell send to snapshot district modified module, and carry out described instruction, if do not need, then directly carry out described instruction.
Above-mentioned judging whether needs to wait that address and the currency of revising data cell are recorded in the snapshot district and can be finished by the logic determines submodule of instruction interface module.
Snapshot district modified module, be used for the snapshot trigger module is sent with the relevant information of incident that triggers snapshot, and/or wait address and the currency of revising data cell that the instruction interface module is sent write the snapshot district.
The snapshot district is used for the address of the data cell that the record data memory block changes and the currency of described data cell, and the incident that triggers snapshot.
Snapshot district manager, be used for according to predefined operating strategy, the data in management snapshot district, be used in needs discharging the shared storage space in part snapshot unit in snapshot district, discharge snapshot unit occupation space in the snapshot district of being duplicated after perhaps the snapshot unit in snapshot district being copied to off-line store; When carrying out recovery operation, snapshot district manager is used for as required the snapshot unit in the offline storage district being copied to the snapshot district.
The offline storage district is used for the data in backup snapshots district.
RMAN is used for carrying out the data recovery according to the current data and the snapshot district data of data storage area, and recovered data is write the data storage area.
RMAN may further include the working area interface module, is used for when data are recovered beginning, and the data of data storage area are copied to the working area; Carrying out data when recovering, the intermediate data of rejuvenation is being written to the working area; After recovery is finished, the working area data are copied to the data storage area.
The working area is used for the intermediate data of store data rejuvenation.
Described data storage area, snapshot district and working area, it can be local storage medium, can also be that local virtual storage medium, external storage medium, network are shared the virtual storage medium under storage medium, the storage area network environment etc., so long as online storage medium can be realized the present invention.
In a word, the above is preferred embodiment of the present invention only, is not to be used to limit protection scope of the present invention.Within the spirit and principles in the present invention all, any modification of being done, be equal to replacement, improvement etc., all should be included within protection scope of the present invention.

Claims (20)

1, a kind of realization method of data backup is characterized in that, the incident that triggers snapshot is set, and after the incident that at every turn triggers snapshot took place, this method comprised:
A, moment of taking place with the incident that triggers snapshot are write down the incident that this triggers snapshot as snapshot constantly;
B, judge whether to receive the instruction of being made amendment in the data unit, if receive, then distribute the snapshot unit record to wait to revise the address and the currency of data cell, carry out the described instruction of being made amendment in the data unit, execution in step C then, otherwise direct execution in step C;
C, judge whether to take place to trigger the incident of snapshot next time,, then finish current flow process, otherwise return execution in step B if take place.
2, realization method of data backup according to claim 1 is characterized in that, step B further comprises before distributing the snapshot unit:
Whether judgement is describedly waited to revise data cell and was modified after this incident that triggers snapshot takes place, if then directly carry out the described instruction of being made amendment in the data unit, otherwise distribute described snapshot unit.
3, realization method of data backup according to claim 2, it is characterized in that, described snapshot unit comprises address area and data field, wherein the address area is used to write down the address of waiting to revise data cell, the data field is used to write down the currency of waiting to do to change data cell, whether described judgement is describedly waited to revise data cell and had been modified and is after this incident that triggers snapshot takes place:
In the address area of the snapshot unit that judgement distributes after this incident that triggers snapshot takes place, whether write down the address of waiting to revise data cell, if think that then waiting to revise data cell was modified, otherwise think that waiting to revise data cell was not modified.
4, realization method of data backup according to claim 2 is characterized in that, this method further is included as state flag bit of each data cell configuration, and steps A further comprises:
The state flag bit that all data cells are set is unmodified;
Step B further comprises after receiving the instruction of being made amendment in the data unit:
Setting waits to revise the pairing state flag bit of data cell for revising;
Whether described judgement is describedly waited to revise data cell and had been modified and is after this incident that triggers snapshot takes place:
Judge after this incident that triggers snapshot takes place according to described state flag bit, describedly wait to revise data cell and whether be modified.
5, realization method of data backup according to claim 1 is characterized in that, step C takes a step forward and comprises finishing current flow process after the incident that next time triggers snapshot takes place:
Judge whether to trigger between the incident of snapshot, receive the instruction of cleaning snapshot unit, if spasm is then cleared up the snapshot unit that has distributed, otherwise finished current flow process in described incident and described next time that this triggers snapshot.
6, realization method of data backup according to claim 5 is characterized in that, the snapshot unit that described cleaning has distributed is:
The snapshot unit that has distributed is copied on the off-line store, discharge the shared storage space in snapshot unit that has distributed then;
Or
Set threshold value, the snapshot unit that described cleaning has distributed is:
Release is corresponding to the inferior shared storage space in snapshot unit that triggers the snapshot incident of threshold value the earliest;
Or
Set threshold value, the snapshot unit that described cleaning has distributed is:
To copy on the off-line store corresponding to the inferior snapshot unit that triggers the snapshot incident of threshold value the earliest, discharge its shared storage space then.
7, a kind of method that realizes data backup and recovery is characterized in that, the incident that triggers snapshot is set, and after the incident that at every turn triggers snapshot took place, this method comprised:
U, moment of taking place with the incident that triggers snapshot are write down the incident that this triggers snapshot as snapshot constantly; Before triggering the incident generation of snapshot next time, if receive the instruction of being made amendment in the data unit, then distribute the snapshot unit, the address and the currency of data cell waited to revise in record, carries out the described instruction of being made amendment in the data unit then;
When data were recovered, this method also comprised:
V, read current time to the snapshot unit that is distributed between waiting to recover constantly, the time sequencing according to distributing described snapshot unit is written to recorded data in the snapshot unit in the data cell of snapshot unit institute recording address.
8, the method for realization data backup according to claim 7 and recovery, it is characterized in that, described snapshot unit comprises address area and data field, wherein the address area is used to write down the address of waiting to revise data cell, the data field is used to write down the currency of waiting to revise data cell, described according to the time sequencing of distributing described snapshot unit, recorded data in the snapshot unit is written in the data cell of snapshot unit institute recording address and is:
V11, with current time and from snapshot unit that the nearest snapshot of current time distributes constantly as the snapshot unit that is untreated;
In V12, the untreated snapshot of the selection unit, the snapshot unit of close current time, with the data field recorded data of described snapshot unit, be written in the recorded data unit, address area of described snapshot unit, described snapshot unit is labeled as handles the snapshot unit then;
V13, judge current time and whether all be to have handled the snapshot unit from the snapshot unit of the nearest snapshot of current time between constantly, if, execution in step V14 then, otherwise return execution in step V12;
V14, judge describedly whether to recover constantly from the nearest snapshot of current time constantly,, otherwise will return execution in step V11 from the nearest snapshot of current time constantly as new current time if then finish current flow process for waiting;
Or
V21, be that each data cell distributes corresponding temporary storage location, and the data in the data cell are copied in the corresponding temporary storage location;
V22, with current time and from snapshot unit that the nearest snapshot of current time distributes constantly as the snapshot unit that is untreated;
In V23, the untreated snapshot of the selection unit, the snapshot unit of close current time, data field recorded data with described snapshot unit, be written in the temporary storage location corresponding, described snapshot unit be labeled as handle the snapshot unit then with the recorded data unit, address area of described snapshot unit;
V24, judge current time and whether all be to have handled the snapshot unit from the snapshot unit of the nearest snapshot of current time between constantly, if, execution in step V25 then, otherwise return execution in step V22;
V25, judge describedly whether to recover constantly from the nearest snapshot of current time constantly,, otherwise will return execution in step V21 from the nearest snapshot of current time constantly as new current time if then finish current flow process for waiting.
9, the method for realization data backup according to claim 7 and recovery is characterized in that, step U further comprises before distributing the snapshot unit:
Whether judgement is describedly waited to revise data cell and was modified after this incident that triggers snapshot takes place, if then directly carry out the described instruction of being made amendment in the data unit, otherwise distribute described snapshot unit.
10, the method for realization data backup according to claim 9 and recovery, it is characterized in that, described snapshot unit comprises address area and data field, wherein the address area is used to write down the address of waiting to revise data cell, the data field is used to write down the currency of waiting to revise data cell, described according to the time sequencing of distributing described snapshot unit, recorded data in the snapshot unit is written in the data cell of snapshot unit institute recording address and is:
V31, with current time and from snapshot unit that the nearest snapshot of current time distributes constantly as the snapshot unit that is untreated;
Any one snapshot unit in V32, the untreated snapshot of the selection unit, data field recorded data with described snapshot unit, be written in the recorded data unit, address area of described snapshot unit, described snapshot unit be labeled as handle the snapshot unit then;
V33, judge current time and whether all be to have handled the snapshot unit from the snapshot unit of the nearest snapshot of current time between constantly, if, execution in step V34 then, otherwise return execution in step V32;
V34, judge describedly whether to recover constantly from the nearest snapshot of current time constantly,, otherwise will return execution in step V31 from the nearest snapshot of current time constantly as new current time if then finish current flow process for waiting;
Or
V41, be that each data cell distributes corresponding temporary storage location, and the data in the data cell are copied in the corresponding temporary storage location;
V42, with current time and from snapshot unit that the nearest snapshot of current time distributes constantly as the snapshot unit that is untreated;
Any one snapshot unit in V43, the untreated snapshot of the selection unit, data field recorded data with described snapshot unit, be written in the temporary storage location corresponding, described snapshot unit be labeled as handle the snapshot unit then with the recorded data unit, address area of described snapshot unit;
V44, judge current time and whether all be to have handled the snapshot unit from the snapshot unit of the nearest snapshot of current time between constantly, if, execution in step V45 then, otherwise return execution in step V42;
V45, judge describedly whether to recover constantly from the nearest snapshot of current time constantly,, otherwise will return execution in step V41 from the nearest snapshot of current time constantly as new current time if then finish current flow process for waiting.
11, according to the method for described realization data backup of claim 7 to 10 and recovery, it is characterized in that, when data are recovered, before step V, further comprise:
Be provided with the data recovered unit of wanting for making amendment by the described instruction of being made amendment in the data unit.
12, the method for realization data backup according to claim 7 and recovery, it is characterized in that, described snapshot unit comprises address area and data field, wherein the address area is used to write down the address of waiting to revise data cell, the data field is used to write down the currency of waiting to revise data cell, described according to the time sequencing of distributing described snapshot unit, snapshot unit recorded data is written in the data cell of snapshot unit institute recording address and is:
V51, with remaining restore data unit as the untreatment data unit, with current time and the snapshot unit that distributes between waiting to recover constantly as the snapshot unit that is untreated;
In V52, the snapshot unit of selecting to be untreated,, judge whether the recorded data unit, address area of described snapshot unit is the untreatment data unit from the snapshot unit of waiting to recover constantly nearest, if, execution in step V53 then, otherwise execution in step V54;
V53, with the data field recorded data of described snapshot unit, be written in the recorded data unit, address area of described snapshot unit, the recorded data unit, address area of described snapshot unit is labeled as handles then;
V54, described snapshot unit is labeled as handles the snapshot unit, and whether the snapshot unit that distributes between judging current time and waiting to recover constantly if then finish current flow process, otherwise returns execution in step V52 all for handling the snapshot unit;
Or
V61, be that each data cell distributes corresponding temporary storage location, and the data in the data cell are copied in the corresponding temporary storage location;
V62, with remaining restore data unit as the untreatment data unit, with current time and the snapshot unit that distributes between waiting to recover constantly as the snapshot unit that is untreated;
In V63, the snapshot unit of selecting to be untreated,, judge whether the recorded data unit, address area of described snapshot unit is the untreatment data unit from the snapshot unit of waiting to recover constantly nearest, if, execution in step V64 then, otherwise execution in step V65;
V64, with the data field recorded data of described snapshot unit, be written in the temporary storage location corresponding with the recorded data unit, address area of described snapshot unit, the recorded data unit, address area of described snapshot unit is labeled as handles then;
V65, described snapshot unit is labeled as handles the snapshot unit, and whether the snapshot unit that distributes between judging current time and waiting to recover constantly if then finish current flow process, otherwise returns execution in step V63 all for handling the snapshot unit.
13, the method for realization data backup according to claim 7 and recovery is characterized in that, after the incident that next time triggers snapshot took place, step U further comprised:
Judge whether to trigger between the incident of snapshot, receive the instruction of cleaning snapshot unit,, then clear up the snapshot unit that has distributed, otherwise finish current flow process if receive in described incident and described next time that this triggers snapshot.
14, the method for realization data backup according to claim 13 and recovery is characterized in that, the snapshot unit that described cleaning has distributed is:
The snapshot unit that has distributed is copied on the off-line store, discharge the shared storage space in snapshot unit that has distributed then;
Or
To copy on the off-line store corresponding to the inferior snapshot unit that triggers the snapshot incident of threshold value the earliest, discharge its shared storage space then.
15, the method for realization data backup according to claim 14 and recovery is characterized in that, when data are recovered, further comprises before step V:
Judge and to wait to recover constantly whether pairing snapshot unit copies on the off-line store, if then with on the off-line store, the snapshot unit that is distributed after waiting to recover constantly copies on the on-line memory, execution in step V then, otherwise directly carry out V.
16, a kind of system that realizes data backup and recovery comprises the data storage area, it is characterized in that, this system further comprises:
Backup manager is used for according to the incident that triggers snapshot, and the instruction of making amendment of the data cell of data memory area, finishes data backup alternately with data storage area and snapshot district;
The snapshot district is used to write down the incident that triggers snapshot, and the address of the data cell that changes of data storage area and the currency of described data cell;
RMAN is used for carrying out the data recovery according to the current data of data storage area and the data in snapshot district, and recovered data is write the data storage area.
17, the system of realization data backup according to claim 16 and recovery is characterized in that, this system further comprises:
Snapshot district manager is used for according to predefined operating strategy, and the data in management snapshot district, and mutual with the offline storage district back up the data in snapshot district;
The offline storage district is used for the data in backup snapshots district.
18, the system of realization data backup according to claim 16 and recovery is characterized in that, described backup manager comprises:
The snapshot trigger module is used to detect the incident that triggers snapshot, and the information relevant with the incident that triggers snapshot is sent to snapshot district modified module;
The instruction interface module is used to receive the instruction that the data cell of data memory area is made amendment, and will wait that address and the currency of revising data cell send to snapshot district modified module, and carries out described instruction;
Snapshot district modified module, be used for the snapshot trigger module is sent with the relevant information of incident that triggers snapshot, and/or wait address and the currency of revising data cell that the instruction interface module is sent write the snapshot district.
19, the system of realization data backup according to claim 18 and recovery is characterized in that, described instruction interface module further comprises:
The logic determines submodule is used for judging whether that needs will wait that address and the currency of revising data cell are recorded in the snapshot district.
20, the system of realization data backup according to claim 16 and recovery is characterized in that, this system further comprises:
The working area is used for the intermediate data of store data rejuvenation;
Described RMAN further comprises:
The working area interface module is used for when data are recovered beginning, and the data of data storage area are copied to the working area; Carrying out data when recovering, the intermediate data of rejuvenation is being written to the working area; After recovery is finished, the working area data are copied to the data storage area.
CNB2006100784300A 2006-05-26 2006-05-26 Method and system for accomplishing data backup and recovery Expired - Fee Related CN100464307C (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CNB2006100784300A CN100464307C (en) 2006-05-26 2006-05-26 Method and system for accomplishing data backup and recovery

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CNB2006100784300A CN100464307C (en) 2006-05-26 2006-05-26 Method and system for accomplishing data backup and recovery

Publications (2)

Publication Number Publication Date
CN101078999A true CN101078999A (en) 2007-11-28
CN100464307C CN100464307C (en) 2009-02-25

Family

ID=38906484

Family Applications (1)

Application Number Title Priority Date Filing Date
CNB2006100784300A Expired - Fee Related CN100464307C (en) 2006-05-26 2006-05-26 Method and system for accomplishing data backup and recovery

Country Status (1)

Country Link
CN (1) CN100464307C (en)

Cited By (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103019888A (en) * 2012-12-21 2013-04-03 华为技术有限公司 Backup method and device
CN103631774A (en) * 2012-08-20 2014-03-12 腾讯科技(深圳)有限公司 Data storing method and system
CN104636125A (en) * 2013-11-13 2015-05-20 联想(北京)有限公司 Information processing method and device
CN106933604A (en) * 2015-12-30 2017-07-07 中移(苏州)软件技术有限公司 A kind of method for upgrading system and device
CN107329852A (en) * 2017-06-09 2017-11-07 广州虎牙信息科技有限公司 Method, system and the terminal device of data processing based on Hive
CN107608825A (en) * 2017-09-19 2018-01-19 杭州宏杉科技股份有限公司 A kind of method and device of cloud backup snapshot data
CN107678889A (en) * 2017-09-30 2018-02-09 上海数据交易中心有限公司 The restoration methods and device of workflow task state, storage medium, computing device
CN108351821A (en) * 2016-02-01 2018-07-31 华为技术有限公司 Data reconstruction method and storage device
CN109074297A (en) * 2016-02-22 2018-12-21 Netapp股份有限公司 Data integrity inspection and faster application recovery are enabled in the data set of synchronous duplication
CN109101363A (en) * 2017-06-21 2018-12-28 中兴通讯股份有限公司 Abnormal restoring method, device, smart machine and storage medium based on android system
CN109165120A (en) * 2018-08-08 2019-01-08 华为技术有限公司 Snapshot and difference bitmap generation method and product are managed in distributed memory system
CN109324926A (en) * 2018-08-30 2019-02-12 黄疆 A kind of junk data processing system and method based on rollback
CN110134550A (en) * 2019-05-15 2019-08-16 腾讯科技(深圳)有限公司 A kind of data processing method, device and computer readable storage medium
CN111857739A (en) * 2019-04-29 2020-10-30 深圳市优必选科技有限公司 Method and device for storing Scatch measurement and control board program
CN113360495A (en) * 2021-04-20 2021-09-07 山东英信计算机技术有限公司 Database query interruption recovery method, device, equipment and readable medium
CN116610501A (en) * 2023-07-20 2023-08-18 深圳市科力锐科技有限公司 NAS data reduction method, device, equipment and storage medium

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030220948A1 (en) * 2002-01-22 2003-11-27 Columbia Data Products, Inc. Managing snapshot/backup collections in finite data storage
CN1331063C (en) * 2003-06-10 2007-08-08 联想(北京)有限公司 On-line data backup method based on data volume snapshot
JP2005332067A (en) * 2004-05-18 2005-12-02 Hitachi Ltd Backup acquisition method and disk array device
CN100359476C (en) * 2004-06-03 2008-01-02 华为技术有限公司 Snapshot backup method

Cited By (27)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103631774B (en) * 2012-08-20 2018-03-20 腾讯科技(深圳)有限公司 Date storage method and system
CN103631774A (en) * 2012-08-20 2014-03-12 腾讯科技(深圳)有限公司 Data storing method and system
CN103019888A (en) * 2012-12-21 2013-04-03 华为技术有限公司 Backup method and device
CN103019888B (en) * 2012-12-21 2016-03-30 华为技术有限公司 Backup method and device
CN104636125A (en) * 2013-11-13 2015-05-20 联想(北京)有限公司 Information processing method and device
CN104636125B (en) * 2013-11-13 2018-03-23 联想(北京)有限公司 A kind of information processing method and device
CN106933604A (en) * 2015-12-30 2017-07-07 中移(苏州)软件技术有限公司 A kind of method for upgrading system and device
CN108351821B (en) * 2016-02-01 2022-03-29 华为技术有限公司 Data recovery method and storage device
CN108351821A (en) * 2016-02-01 2018-07-31 华为技术有限公司 Data reconstruction method and storage device
CN109074297A (en) * 2016-02-22 2018-12-21 Netapp股份有限公司 Data integrity inspection and faster application recovery are enabled in the data set of synchronous duplication
CN109074297B (en) * 2016-02-22 2022-09-02 Netapp股份有限公司 Enabling data integrity checking and faster application recovery in synchronously replicated datasets
CN107329852A (en) * 2017-06-09 2017-11-07 广州虎牙信息科技有限公司 Method, system and the terminal device of data processing based on Hive
CN109101363B (en) * 2017-06-21 2023-09-22 中兴通讯股份有限公司 Exception recovery method and device based on Android system, intelligent equipment and storage medium
CN109101363A (en) * 2017-06-21 2018-12-28 中兴通讯股份有限公司 Abnormal restoring method, device, smart machine and storage medium based on android system
CN107608825A (en) * 2017-09-19 2018-01-19 杭州宏杉科技股份有限公司 A kind of method and device of cloud backup snapshot data
CN107678889B (en) * 2017-09-30 2020-06-09 上海数据交易中心有限公司 Method and device for recovering workflow task state, storage medium and computing equipment
CN107678889A (en) * 2017-09-30 2018-02-09 上海数据交易中心有限公司 The restoration methods and device of workflow task state, storage medium, computing device
CN109165120A (en) * 2018-08-08 2019-01-08 华为技术有限公司 Snapshot and difference bitmap generation method and product are managed in distributed memory system
CN109324926A (en) * 2018-08-30 2019-02-12 黄疆 A kind of junk data processing system and method based on rollback
CN111857739A (en) * 2019-04-29 2020-10-30 深圳市优必选科技有限公司 Method and device for storing Scatch measurement and control board program
CN111857739B (en) * 2019-04-29 2023-06-09 深圳市优必选科技有限公司 Method and device for storing program of Scratch measurement and control board
CN110134550A (en) * 2019-05-15 2019-08-16 腾讯科技(深圳)有限公司 A kind of data processing method, device and computer readable storage medium
CN110134550B (en) * 2019-05-15 2024-06-18 腾讯科技(深圳)有限公司 Data processing method, device and computer readable storage medium
CN113360495A (en) * 2021-04-20 2021-09-07 山东英信计算机技术有限公司 Database query interruption recovery method, device, equipment and readable medium
CN113360495B (en) * 2021-04-20 2023-02-24 山东英信计算机技术有限公司 Database query interruption recovery method, device, equipment and readable medium
CN116610501A (en) * 2023-07-20 2023-08-18 深圳市科力锐科技有限公司 NAS data reduction method, device, equipment and storage medium
CN116610501B (en) * 2023-07-20 2024-05-14 深圳市科力锐科技有限公司 NAS data reduction method, device, equipment and storage medium

Also Published As

Publication number Publication date
CN100464307C (en) 2009-02-25

Similar Documents

Publication Publication Date Title
CN101078999A (en) Method and system for accomplishing data backup and recovery
CN1288556C (en) Arithmetic processing system and control method, task management system and method
CN1129841C (en) Method and device for controlling output
CN1162788C (en) Interchangeable storage medium, method of controlling same and computer system using same
CN1315057C (en) Method of remapping flash memory
CN1276358C (en) Memory
CN1308851C (en) Data processing system including storage systems
CN1149479C (en) Data management system for a real-time system
CN1752947A (en) Memory storage, storage controlling method, and computer product
CN1648867A (en) Data processing system
CN1227589C (en) Data processing apparatus and method for saving return state
CN1596401A (en) Non-volatile storage device control method
CN1760836A (en) Information processing system, information processing method, and program
CN1906583A (en) Information processing device, interrupt processing control method, and computer program
CN1517869A (en) Processor, arithmetic processing method and priority decision method
CN1906596A (en) File recording device
CN1577278A (en) Method and system for scheduling real-time periodic tasks
CN1629815A (en) Data processing system having a plurality of storage systems
CN1967488A (en) Task allocation method and task allocation apparatus
CN1922571A (en) Data run programming
CN1190741C (en) Apparatus and method for support data affairs
CN1916962A (en) Method and device storing and back-storing state context in graphic processing unit
CN1341237A (en) Semiconductor memory card access apparatus, computer-readable recording medium, an initialization method, and semiconductor memory card
CN1731402A (en) Method and apparatus for accelerating file system operation by using coprocessor
CN1855027A (en) Storage device control apparatus

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
EE01 Entry into force of recordation of patent licensing contract

Assignee: Hangzhou Xinhe Data Technology Co.,Ltd.

Assignor: Ren Yongjian|Chen Ye

Contract record no.: 2011330000783

Denomination of invention: Method and system for accomplishing data backup and recovery

Granted publication date: 20090225

License type: Exclusive License

Open date: 20071128

Record date: 20110622

ASS Succession or assignment of patent right

Free format text: FORMER OWNER: CHEN YE

Effective date: 20131108

C41 Transfer of patent application or patent right or utility model
TR01 Transfer of patent right

Effective date of registration: 20131108

Address after: 200135, room 18, No. 910, Lane 1502, Dingxiang Road, Shanghai, Pudong New Area

Patentee after: Ren Yongjian

Address before: 200135, room 18, No. 910, Lane 1502, Dingxiang Road, Shanghai, Pudong New Area

Patentee before: Ren Yongjian

Patentee before: Chen Ye

ASS Succession or assignment of patent right

Owner name: HANGZHOU INFOCORE DATA TECHNOLOGY CO., LTD.

Free format text: FORMER OWNER: REN YONGJIAN

Effective date: 20140221

COR Change of bibliographic data

Free format text: CORRECT: ADDRESS; FROM: 200135 PUDONG NEW AREA, SHANGHAI TO: 311202 HANGZHOU, ZHEJIANG PROVINCE

TR01 Transfer of patent right

Effective date of registration: 20140221

Address after: 12, building 1038, 311202 water tower, Jincheng Road, Xiaoshan District, Zhejiang, Hangzhou

Patentee after: Hangzhou Xinhe Data Technology Co.,Ltd.

Address before: 200135, room 18, No. 910, Lane 1502, Dingxiang Road, Shanghai, Pudong New Area

Patentee before: Ren Yongjian

TR01 Transfer of patent right
C56 Change in the name or address of the patentee
CP01 Change in the name or title of a patent holder

Address after: 12, building 1038, 311202 water tower, Jincheng Road, Xiaoshan District, Zhejiang, Hangzhou

Patentee after: Hangzhou Xinhe Data Technology Co.,Ltd.

Address before: 12, building 1038, 311202 water tower, Jincheng Road, Xiaoshan District, Zhejiang, Hangzhou

Patentee before: Hangzhou Xinhe Data Technology Co.,Ltd.

CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20090225

Termination date: 20180526

CF01 Termination of patent right due to non-payment of annual fee