CN106155839B - A kind of method and apparatus for Backup Data - Google Patents

A kind of method and apparatus for Backup Data Download PDF

Info

Publication number
CN106155839B
CN106155839B CN201510210001.3A CN201510210001A CN106155839B CN 106155839 B CN106155839 B CN 106155839B CN 201510210001 A CN201510210001 A CN 201510210001A CN 106155839 B CN106155839 B CN 106155839B
Authority
CN
China
Prior art keywords
page
readable
mark
equipment
breakage problem
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.)
Active
Application number
CN201510210001.3A
Other languages
Chinese (zh)
Other versions
CN106155839A (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.)
Alibaba Cloud Computing Ltd
Original Assignee
Alibaba Group Holding Ltd
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 Alibaba Group Holding Ltd filed Critical Alibaba Group Holding Ltd
Priority to CN201510210001.3A priority Critical patent/CN106155839B/en
Publication of CN106155839A publication Critical patent/CN106155839A/en
Application granted granted Critical
Publication of CN106155839B publication Critical patent/CN106155839B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The purpose of the application is to provide a kind of method and apparatus for Backup Data.Specifically, it reads and the page of detection data file whether there is page breakage problem;And will be present page breakage problem page locking be it is only readable can not modify state, and re-read and the page copied into backup set, the only readable of the page that unlocks thereafter can not modify state.Compared with prior art, the method and apparatus of herein described Backup Data whether there is page breakage problem by reading the page of simultaneously detection data file, to being locked as only readable to modify state using preemptive type mode there are the page of page breakage problem, temporarily to prevent follow-up data from continuing to write process to the page, the page be quickly completed current data write process after, it re-reads again and the page is copied into the page described in backup set, to well solve the page breakage problem in backup procedure, backup success rate is greatly improved.

Description

A kind of method and apparatus for Backup Data
Technical field
The present invention relates to computer field more particularly to a kind of technologies for Backup Data.
Background technique
To prevent hardware or other unnecessary losses of failure bring, it usually needs carried out to the data in database standby Part, restore data to be able to use backup set after the failure occurred, reduces loss of data.Existing backup tool is to presence The page of page breakage problem waits the method for aggravating examination using limited times, so attempts to will lead to after failing several times entire Backup procedure failure, and the cost of failure is larger, needs to re-initiate backup.Because can not preferably handle the page in backup procedure The backup success rate of breakage problem, existing method is lower.
Summary of the invention
The purpose of the application is to provide a kind of method and apparatus for improving Backup Data success rate.
According to an aspect of the invention, there is provided a kind of method for Backup Data, wherein the described method includes: It reads and the page of detection data file whether there is page breakage problem;It is only readable that the page locking of page breakage problem, which will be present, Not modifiable state, and re-read and the page is copied into backup set, the page that unlocks thereafter it is only readable not Modifiable state.
Further, the method also includes: there will be no the pages of page breakage problem to be copied directly to backup set.
Further, it includes: according to the page that the page for reading simultaneously detection data file, which whether there is page breakage problem, Mark is write in interior beginning of the page and page footing write mark consistency detection data file the page with the presence or absence of page breakage problem.
Further, if in the page beginning of the page write mark and page footing to write mark inconsistent, that there are pages is disconnected for the page Problem is split, if beginning of the page writes mark and page footing and writes that mark is consistent, and page breakage problem is not present in the page in the page.
It further, is that only the readable state that can not modify includes: to increase shared lock to the page by the page locking, The page locking can not be modified state to be only readable.
Further, increasing sharing lock to the page includes: to initiate shared lock preemption instructions by access interface, with right The page increases shared lock.
Further, unlock the page it is only readable can not modify state include: by access interface initiation release The instruction of the shared lock is put, only readable with the page that unlocks can not modify state.
Further, the method also includes: read and detection data file the page whether there is page breakage problem Before, archive log and its log-sequence numbers are copied in backup set.
Further, the data file is the data file of relevant database.
According to the another aspect of the application, a kind of equipment for Backup Data is additionally provided, wherein the equipment packet It includes: first device, for reading the page of simultaneously detection data file with the presence or absence of page breakage problem;Second device, for that will deposit State can not be modified to be only readable in the page locking of page breakage problem, and re-reads and the page is copied into backup set, Thereafter the only readable of the page that unlock can not modify state.
Further, the equipment further include: 3rd device is directly replicated for the page there will be no page breakage problem To backup set.
Further, the first device includes: first unit, for writing mark and page footing according to beginning of the page in the page The page of the consistency detection data file of mark is write with the presence or absence of page breakage problem.
Further, if in the page beginning of the page write mark and page footing to write mark inconsistent, that there are pages is disconnected for the page Problem is split, if beginning of the page writes mark and page footing and writes that mark is consistent, and page breakage problem is not present in the page in the page.
Further, the second device includes: second unit, will be described for increasing shared lock to the page Page locking can not modify state to be only readable.
Further, the second unit includes: the second subelement, seizes finger for initiating shared lock by access interface It enables, to increase shared lock to the page.
Further, the second device includes: third unit, discharges the shared lock for initiating by access interface Instruction, only readable with the page that unlocks can not modify state.
Further, the equipment further include: the 4th device, for whether being deposited in the page for reading simultaneously detection data file Before page breakage problem, archive log and its log-sequence numbers are copied in backup set.
Further, the data file is the data file of relevant database.
Compared with prior art, the method and apparatus of herein described Backup Data is by reading and detection data file The page whether there is page breakage problem, be locked as only readable to repair using preemptive type mode to there are the pages of page breakage problem Change state, temporarily to prevent follow-up data from continuing the process of writing to the page, the page is quickly completed writing for current data It process and then re-reads the page is copied into the page described in backup set, to well solve in backup procedure Page breakage problem, greatly improve backup success rate.
Detailed description of the invention
By reading a detailed description of non-restrictive embodiments in the light of the attached drawings below, of the invention other Feature, objects and advantages will become more apparent upon:
Fig. 1 shows a kind of equipment schematic diagram for Backup Data according to the application one aspect;
Fig. 2 shows the second device schematic diagrames according to a preferred embodiment of the application one aspect;
Fig. 3 shows a kind of method flow diagram for Backup Data according to the application other side.
The same or similar appended drawing reference represents the same or similar component in attached drawing.
Specific embodiment
Present invention is further described in detail with reference to the accompanying drawing.
Fig. 1 shows a kind of equipment 1 for Backup Data according to the application one aspect, wherein equipment 1 includes first Device 11 and second device 12.
Specifically, the first device 11 is read and the page of detection data file whether there is page breakage problem;It is described The page locking of page breakage problem, which will be present, in second device 12 can not modify state to be only readable, and re-read the page Backup set is copied to, after the Backup end of the page, the only readable of the page that unlocks can not modify state.
Here, the equipment 1 includes but is not limited to that user equipment, the network equipment or user equipment and the network equipment pass through Network is integrated constituted equipment.The user equipment its include but is not limited to any one can with user by touch tablet into Mobile electronic product of row human-computer interaction, such as smart phone, PDA etc., the mobile electronic product can use any operation System, such as android operating system, iOS operating system.Wherein, the network equipment includes that one kind can be according to setting in advance Fixed or storage instruction, the automatic electronic equipment for carrying out numerical value calculating and information processing, hardware includes but is not limited to micro process Device, specific integrated circuit (ASIC), programmable gate array (FPGA), digital processing unit (DSP), embedded device etc..The net Network equipment its include but is not limited to computer, network host, single network server, multiple network server collection or multiple services The cloud that device is constituted;Here, cloud is made of a large number of computers or network servers based on cloud computing (Cloud Computing), Wherein, cloud computing is one kind of distributed computing, a virtual supercomputing consisting of a loosely coupled set of computers Machine.The network includes but is not limited to internet, wide area network, Metropolitan Area Network (MAN), local area network, VPN network, wireless self-organization network (Ad Hoc network) etc..Those skilled in the art will be understood that above equipment 1 is only for example, other are existing or are likely to occur from now on Equipment 1 is such as applicable to the application, should also be included within the application protection scope, and be incorporated herein by reference.
It constantly works between above-mentioned each device, here, it will be understood by those skilled in the art that " lasting " refers to State each device respectively in real time or according to setting or real-time adjustment operating mode requirement, such as the first device 11 holds It resumes studies and takes the page of simultaneously detection data file with the presence or absence of page breakage problem, the second device 12 persistently will be present page fracture and ask The page locking of topic can not modify state to be only readable, and re-read the page copying to backup set, release lock thereafter Fixed the only readable of the page can not modify state etc., until the equipment 1 stops working.
The first device 11 is read and the page of detection data file is asked with the presence or absence of page fracture (partial write) Topic.Here, the page fracture refers to partial write operation, the i.e. intermediate state of unfinished write operation.
Specifically, the first device 11 may include first unit (not shown).The first unit is according to institute State beginning of the page in the page write mark and page footing write mark consistency detection data file the page with the presence or absence of page breakage problem.
Specifically, if mark is write in beginning of the page in the page and page footing writes that mark is inconsistent, and there are pages for the page of data Breakage problem, if beginning of the page writes mark and page footing and writes that mark is consistent, and there is no page fractures to ask for the page of data in the page Topic.
Here, each page has, mark is write in beginning of the page and page footing writes mark, beginning of the page write mark and page footing write mark can To be number or other forms, to record page write state and write-in number etc..Mark is write using beginning of the page in the page The page for writing the consistency detection data file of mark with page footing whether there is page breakage problem, and occupancy resource is small and speed is fast, And without increasing additional markers.
For example, respectively having a mark in the beginning of the page of the page and page footing, i.e., mark is write in beginning of the page and page footing writes mark, the beginning of the page It writes mark and page footing writes the initial value of mark and is set as 1, whenever the page starts to be written into, then the numerical value of mark is write in the beginning of the page Add 1, after the page completes write-in, then the page footing writes mark plus 1, therefore when the page is written into and does not complete writing process, institute State beginning of the page write mark and the page footing write mark content it is inconsistent, then first unit can write mark according to beginning of the page in the page Know and page footing write mark consistency detection data file the page whether be in the state for being written into and not completing writing process, And then the page is detected with the presence or absence of page breakage problem.Certainly, those skilled in the art are it should be understood that above-mentioned beginning of the page is write Mark and page footing write the initial value of mark and numerical value variation pattern is only for example, and what is be likely to occur from now on is able to record that the page is written State and mark calculation method, the content of write-in number etc. can be included within thought range of the invention.
The page locking of page breakage problem, which will be present, in the second device 12 can not modify state to be only readable, and read again It takes and the page is copied into backup set, the only readable of the page that unlocks thereafter can not modify state.
Specifically, as shown in Fig. 2, the second device 12 may include second unit 122.
Wherein, the second unit 122 increases shared lock (share lock) to the page, is by the page locking It is only readable to modify state.
Here, needing to lock to the concurrently access of internal storage structure, there is shared lock (share here to protect internal storage structure Lock) and two kinds of locks of exclusive lock (exclusive lock) it is available, wherein shared lock can concurrently access to the page, exclusive Lock can only modify to the page and cannot access.
For example, can be indicated by a memory bits internal storage structure locking, it is assumed that this memory bits is lock_word, If lock_word is equal to 0, then it represents that this page is not locked;If lock_word be greater than 0, then it represents that this page have one or Multiple shared locks;If lock_word is less than 0, then it represents that this page has an exclusive lock.When some request is shared After lock, also available shared lock, i.e. lock_word can be incremented by for other requests.If there is request will modify this page, Exclusive lock must be then obtained, but (i.e. not any shared lock and exclusive lock is in this page on condition that lock_word is necessary for 0 On).When having shared lock not to be released, lock_word is not 0, can only wait and retry at this time, and can not be obtained solely Zhan Suo also can not just modify the page, so that the page locking can not be modified state to be only readable.
Therefore, the second unit 122 is by increasing shared lock (share lock) to the page, by the page locking State can not be modified to be only readable, those skilled in the art should be understood that, shared lock can prevent subsequent in memory The data of request modification respective page enter page writing process, and (data of request modification respective page are temporary in a manner of queue It is stored in memory and waits), page process is currently written without influencing, that is, the data that the page is currently written will continue to Write-in, until current page all writes.
Specifically, the second unit 122 may include the second subelement (not shown).Second subelement is logical It crosses access interface and initiates shared lock preemption instructions, to increase shared lock to the page.
For example, connecting example, it is assumed that by space_id, the two numbers of page_no uniquely position buffer pool (buffer Pool a page in).By SQL statement lock innobase_pagespace_id=xx, page_no=yy access is connect Mouthful, it attempts to space_id=xx, this page of page_no=yy adds shared lock.Use atom (the compare and of CPU Swap, CAS) lock_word of the change page is instructed, if changing successfully (lock_word is incremented by), that is, lock successfully;If Change failure, then retry after waiting several microseconds, until taking lock.
The second device 12 further includes third unit 123, wherein the third unit 123 is initiated by access interface The instruction of the shared lock is discharged, only readable with the page that unlocks can not modify state.
For example, connecting example, after completing to page backup, using commit/rollback/disconnect, this is several A SQL syntax can complete the release of shared lock, i.e. update lock_word subtracts 1, can be completed and unlock.
Shared lock preemption instructions are initiated by second unit 122 and third unit 123 and shared lock releases instruction, in this phase Between the page is backed up, since the time backed up to a page is very of short duration, the time that shared lock is locked is not Can have an impact to data queue to be written, not will cause the excessive of data queue and overstock, therefore in the case where smooth backup, protect Card page writing process is gone on smoothly.
In addition, can be by the 3rd device (not shown) of the equipment 1 for the page there is no page breakage problem It is copied directly to backup set, to complete full backup process.
Specifically, the equipment 1 can also include the 4th device (not shown).4th device is reading and is examining Before the page of measured data file whether there is page breakage problem, archive log and its log-sequence numbers are copied in backup set.
For affairs storage engines, common physical backup is all the online data file of backup, while backing up entire mistake The redo log (redo log and archive log) generated in journey and No. LSN (log-sequence numbers), need when online equipment breaks down When replying data, according to archive log and its log-sequence numbers and the data file of backup, so that it may so that database recovery arrives One consistent time point realizes effective recovery of data.
Further, in a preferred embodiment, in the equipment 1, the data file is the number of relevant database According to file.The relevant database can include but is not limited to: MySQL, Oracle, DB2, SQL Server etc., due to closing It is that type data database needs constantly to provide the write-in and reading of data, therefore its backup procedure is easily rushed with writing process Prominent, that is, when backuping to a certain page in the data file of database, which constantly has data entrance, leads to the continuous weight of the page It makes carbon copies into herein described device can effectively avoid backing up failure under above situation.
Fig. 3 shows a kind of method flow diagram for Backup Data according to the application other side.
The method comprising the steps of S31 and step S32.Specifically, in step S31, equipment 1 is read and detection data file The page whether there is page breakage problem;In step s 32, it is only readable that the page locking of page breakage problem, which will be present, in equipment 1 Not modifiable state, and re-read and the page is copied into backup set, after the Backup end of the page, unlock The only readable of the page can not modify state.
Here, the equipment 1 includes but is not limited to that user equipment, the network equipment or user equipment and the network equipment pass through Network is integrated constituted equipment.The user equipment its include but is not limited to any one can with user by touch tablet into Mobile electronic product of row human-computer interaction, such as smart phone, PDA etc., the mobile electronic product can use any operation System, such as android operating system, iOS operating system.Wherein, the network equipment includes that one kind can be according to setting in advance Fixed or storage instruction, the automatic electronic equipment for carrying out numerical value calculating and information processing, hardware includes but is not limited to micro process Device, specific integrated circuit (ASIC), programmable gate array (FPGA), digital processing unit (DSP), embedded device etc..The net Network equipment its include but is not limited to computer, network host, single network server, multiple network server collection or multiple services The cloud that device is constituted;Here, cloud is made of a large number of computers or network servers based on cloud computing (Cloud Computing), Wherein, cloud computing is one kind of distributed computing, a virtual supercomputing consisting of a loosely coupled set of computers Machine.The network includes but is not limited to internet, wide area network, Metropolitan Area Network (MAN), local area network, VPN network, wireless self-organization network (Ad Hoc network) etc..Those skilled in the art will be understood that above equipment 1 is only for example, other are existing or are likely to occur from now on Equipment 1 is such as applicable to the application, should also be included within the application protection scope, and be incorporated herein by reference.
It constantly works between each step of equipment 1.Specifically, in step S31, equipment 1 is persistently read And the page of detection data file whether there is page breakage problem, in step s 32, a page breakage problem persistently will be present in equipment 1 Page locking be it is only readable can not modify state, and re-read and the page copied into backup set, unlock thereafter The only readable of the page can not modify state etc., until the equipment 1 stops working.
In step S31, equipment 1 is read and the page of detection data file is with the presence or absence of page fracture (partial Write) problem.Here, the page fracture refers to partial write operation, the i.e. intermediate state of unfinished write operation.
Specifically, in step S31, equipment 1 writes mark according to beginning of the page in the page and page footing writes the consistency of mark The page of detection data file whether there is page breakage problem.
Specifically, if mark is write in beginning of the page in the page and page footing writes that mark is inconsistent, and there are pages for the page of data Breakage problem, if beginning of the page writes mark and page footing and writes that mark is consistent, and there is no page fractures to ask for the page of data in the page Topic.
Here, each page has, mark is write in beginning of the page and page footing writes mark, beginning of the page write mark and page footing write mark can To be number or other forms, to record page write state and write-in number etc..Mark is write using beginning of the page in the page The page for writing the consistency detection data file of mark with page footing whether there is page breakage problem, and occupancy resource is small and speed is fast, And without increasing additional markers.
For example, respectively having a mark in the beginning of the page of the page and page footing, i.e., mark is write in beginning of the page and page footing writes mark, the beginning of the page It writes mark and page footing writes the initial value of mark and is set as 1, whenever the page starts to be written into, then the numerical value of mark is write in the beginning of the page Add 1, after the page completes write-in, then the page footing writes mark plus 1, therefore when the page is written into and does not complete writing process, institute State beginning of the page write mark and the page footing write mark content it is inconsistent, then first unit can write mark according to beginning of the page in the page Know and page footing write mark consistency detection data file the page whether be in the state for being written into and not completing writing process, And then the page is detected with the presence or absence of page breakage problem.Certainly, those skilled in the art are it should be understood that above-mentioned beginning of the page is write Mark and page footing write the initial value of mark and numerical value variation pattern is only for example, and what is be likely to occur from now on is able to record that the page is written State and mark calculation method, the content of write-in number etc. can be included within thought range of the invention.
In step s 32, the page locking of page breakage problem, which will be present, in equipment 1 can not modify state to be only readable, lay equal stress on The page is copied to backup set by new read, and the only readable of the page that unlocks thereafter can not modify state.
Specifically, in step s 32, equipment 1 increases shared lock (share lock) to the page, and the page is locked Being set to only readable can not modify state.
Here, needing to lock to the concurrently access of internal storage structure, there is shared lock (share here to protect internal storage structure Lock) and two kinds of locks of exclusive lock (exclusive lock) it is available, wherein shared lock can concurrently access to the page, exclusive Lock can only modify to the page and cannot access.
For example, can be indicated by a memory bits internal storage structure locking, it is assumed that this memory bits is lock_word, If lock_word is equal to 0, then it represents that this page is not locked;If lock_word be greater than 0, then it represents that this page have one or Multiple shared locks;If lock_word is less than 0, then it represents that this page has an exclusive lock.When some request is shared After lock, also available shared lock, i.e. lock_word can be incremented by for other requests.If there is request will modify this page, Exclusive lock must be then obtained, but (i.e. not any shared lock and exclusive lock is in this page on condition that lock_word is necessary for 0 On).When having shared lock not to be released, lock_word is not 0, can only wait and retry at this time, and can not be obtained solely Zhan Suo also can not just modify the page, so that the page locking can not be modified state to be only readable.
Therefore, in step s 32, equipment 1 is locked the page by increasing shared lock (share lock) to the page Be set to it is only readable can not modify state, those skilled in the art should be understood that, after shared lock can prevent in memory The data of continuous request modification respective page enter page writing process, and (data of request modification respective page are temporary in a manner of queue When be stored in memory wait), page process is currently written without influencing, that is, the data that the page is currently written can be after It continues into until current page all writes.
Specifically, in step s 32, equipment 1 initiates shared lock preemption instructions by access interface, to increase to the page Add shared lock.
For example, connecting example, it is assumed that by space_id, the two numbers of page_no uniquely position buffer pool (buffer Pool a page in).By SQL statement lock innobase_pagespace_id=xx, page_no=yy access is connect Mouthful, it attempts to space_id=xx, this page of page_no=yy adds shared lock.Use atom (the compare and of CPU Swap, CAS) lock_word of the change page is instructed, if changing successfully (lock_word is incremented by), that is, lock successfully;If Change failure, then retry after waiting several microseconds, until taking lock.
Specifically, in step s 32, equipment 1 is initiated to discharge the instruction of the shared lock by access interface, to release lock Fixed the only readable of the page can not modify state.
For example, connecting example, after completing to page backup, using commit/rollback/disconnect, this is several A SQL syntax can complete the release of shared lock, i.e. update lock_word subtracts 1, can be completed and unlock.
In step s 32, shared lock preemption instructions are initiated by equipment 1 and shared lock releases instruction, during this period to page Face is backed up, and since the time backed up to a page is very of short duration, the time that shared lock is locked can't be treated Write-in data queue has an impact, and not will cause the excessive of data queue and overstocks, therefore in the case where smooth backup, guarantees the page Writing process is gone on smoothly.
In addition, backup set can be copied directly to by the equipment 1 for the page there is no page breakage problem, to complete Full backup process.
Specifically, the method can also include step S33 (not shown).Advance of the step S33 in step S31 Row, in step S33, equipment 1 copies to archive log and its log-sequence numbers in backup set.
For affairs storage engines, common physical backup is all the online data file of backup, while backing up entire mistake The redo log (redo log and archive log) generated in journey and No. LSN (log-sequence numbers), need when online equipment breaks down When replying data, according to archive log and its log-sequence numbers and the data file of backup, so that it may so that database recovery arrives One consistent time point realizes effective recovery of data.
Further, in a preferred embodiment, in the method, the data file is the data of relevant database File.The relevant database can include but is not limited to: MySQL, Oracle, DB2, SQL Server etc., due to relationship Type data database needs constantly to provide the write-in and reading of data, therefore its backup procedure is easily clashed with writing process, When backuping to a certain page in the data file of database, which constantly has data entrance, leads to the continuous repetition of the page Write-in, herein described device can effectively avoid backing up failure under above situation.
In addition, in a typical configuration of this application, terminal, the equipment of service network and trusted party include one or Multiple processors (CPU), input/output interface, network interface and memory.
Memory may include the non-volatile memory in computer-readable medium, random access memory (RAM) and/or The forms such as Nonvolatile memory, such as read-only memory (ROM) or flash memory (flash RAM).Memory is computer-readable medium Example.
Computer-readable medium includes permanent and non-permanent, removable and non-removable media can be by any method Or technology come realize information store.Information can be computer readable instructions, data structure, the module of program or other data. The example of the storage medium of computer includes, but are not limited to phase change memory (PRAM), static random access memory (SRAM), moves State random access memory (DRAM), other kinds of random access memory (RAM), read-only memory (ROM), electric erasable Programmable read only memory (EEPROM), flash memory or other memory techniques, read-only disc read only memory (CD-ROM) (CD-ROM), Digital versatile disc (DVD) or other optical storage, magnetic cassettes, magnetic tape disk storage or other magnetic storage devices or Any other non-transmission medium, can be used for storage can be accessed by a computing device information.As defined in this article, computer Readable medium does not include non-temporary computer readable media (transitory media), such as the data-signal and carrier wave of modulation.
Obviously, those skilled in the art can carry out various modification and variations without departing from the essence of the application to the application Mind and range.In this way, if these modifications and variations of the application belong to the range of the claim of this application and its equivalent technologies Within, then the application is also intended to include these modifications and variations.
It should be noted that the application can be carried out in the assembly of software and/or software and hardware, for example, can adopt With specific integrated circuit (ASIC), general purpose computer or any other realized similar to hardware device.In one embodiment In, the software program of the application can be executed to implement the above steps or functions by processor.Similarly, the application Software program (including relevant data structure) can be stored in computer readable recording medium, for example, RAM memory, Magnetic or optical driver or floppy disc and similar devices.In addition, hardware can be used to realize in some steps or function of the application, example Such as, as the circuit cooperated with processor thereby executing each step or function.
In addition, a part of the application can be applied to computer program product, such as computer program instructions, when its quilt When computer executes, by the operation of the computer, it can call or provide according to the present processes and/or technical solution. And the program instruction of the present processes is called, it is possibly stored in fixed or moveable recording medium, and/or pass through Broadcast or the data flow in other signal-bearing mediums and transmitted, and/or be stored according to described program instruction operation In the working storage of computer equipment.Here, including a device according to one embodiment of the application, which includes using Memory in storage computer program instructions and processor for executing program instructions, wherein when the computer program refers to When enabling by processor execution, method and/or skill of the device operation based on aforementioned multiple embodiments according to the application are triggered Art scheme.
It is obvious to a person skilled in the art that the application is not limited to the details of above-mentioned exemplary embodiment, Er Qie In the case where without departing substantially from spirit herein or essential characteristic, the application can be realized in other specific forms.Therefore, no matter From the point of view of which point, the present embodiments are to be considered as illustrative and not restrictive, and scope of the present application is by appended power Benefit requires rather than above description limits, it is intended that all by what is fallen within the meaning and scope of the equivalent elements of the claims Variation is included in the application.Any reference signs in the claims should not be construed as limiting the involved claims.This Outside, it is clear that one word of " comprising " does not exclude other units or steps, and odd number is not excluded for plural number.That states in device claim is multiple Unit or device can also be implemented through software or hardware by a unit or device.The first, the second equal words are used to table Show title, and does not indicate any particular order.

Claims (18)

1. a kind of method of Backup Data, wherein the described method includes:
It reads and the page of detection data file whether there is page breakage problem;And
The page locking of page breakage problem, which will be present, can not modify state to be only readable, in current data after the completion of writing process, It re-reads and the page is copied into backup set, the only readable of the page that unlocks thereafter can not modify state.
2. according to the method described in claim 1, wherein, the method also includes:
There will be no the pages of page breakage problem to be copied directly to backup set.
3. according to the method described in claim 1, wherein, reading and the page of detection data file whether there is page breakage problem Include:
Write mark according to beginning of the page in the page and page footing write mark consistency detection data file the page with the presence or absence of page Breakage problem.
4. according to the method described in claim 3, wherein, if in the page beginning of the page write mark and page footing to write mark inconsistent, Then there are page breakage problems for the page, if beginning of the page writes mark and writes that mark is consistent, and the page is not with page footing in the page There are page breakage problems.
5. according to the method described in claim 1, being that only the readable state that can not modify includes: by the page locking wherein
Shared lock is increased to the page, the page locking can not be modified into state to be only readable.
6. according to the method described in claim 5, wherein, increasing sharing lock to the page includes:
Shared lock preemption instructions are initiated by access interface, to increase shared lock to the page.
7. according to the method described in claim 5, wherein, the only readable state that can not modify for the page that unlocks includes:
The instruction of the release shared lock is initiated by access interface, only readable with the page that unlocks can not modify shape State.
8. method according to any one of claim 1 to 7, wherein the method also includes:
Before the page for reading simultaneously detection data file is with the presence or absence of page breakage problem, archive log and its log-sequence numbers are answered It makes in backup set.
9. method according to any one of claim 1 to 7, the data file is the data text of relevant database Part.
10. a kind of equipment of Backup Data, wherein the equipment includes:
First device, for reading the page of simultaneously detection data file with the presence or absence of page breakage problem;And
Second device can not modify state for the page locking of page breakage problem to will be present to be only readable, in current data It after the completion of writing process, re-reads and the page is copied into backup set, the only readable of the page that unlocks thereafter can not Modification state.
11. equipment according to claim 10, wherein the equipment further include:
3rd device is copied directly to backup set for the page there will be no page breakage problem.
12. equipment according to claim 10, wherein the first device includes:
First unit, for mark is write according to beginning of the page in the page and page footing write mark consistency detection data file page Face whether there is page breakage problem.
13. equipment according to claim 12, wherein if in the page beginning of the page write mark and page footing to write mark different It causes, then there are page breakage problems for the page, if mark and page footing consistent, the page of writing mark are write in beginning of the page in the page There is no page breakage problems.
14. equipment according to claim 10, wherein the second device includes:
The page locking can not be modified state for increasing shared lock to the page to be only readable by second unit.
15. equipment according to claim 14, wherein the second unit includes:
Second subelement, for initiating shared lock preemption instructions by access interface, to increase shared lock to the page.
16. equipment according to claim 14, wherein the second device includes:
Third unit, for initiating the instruction of the release shared lock by access interface, with for the page that unlocks Readable not modifiable state.
17. equipment described in any one of 0 to 16 according to claim 1, wherein the equipment further include:
4th device, for reading and the page of detection data file is with the presence or absence of before page breakage problem, by archive log And its log-sequence numbers copy in backup set.
18. equipment described in any one of 0 to 16 according to claim 1, the data file is the data of relevant database File.
CN201510210001.3A 2015-04-28 2015-04-28 A kind of method and apparatus for Backup Data Active CN106155839B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510210001.3A CN106155839B (en) 2015-04-28 2015-04-28 A kind of method and apparatus for Backup Data

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510210001.3A CN106155839B (en) 2015-04-28 2015-04-28 A kind of method and apparatus for Backup Data

Publications (2)

Publication Number Publication Date
CN106155839A CN106155839A (en) 2016-11-23
CN106155839B true CN106155839B (en) 2019-07-30

Family

ID=57347906

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510210001.3A Active CN106155839B (en) 2015-04-28 2015-04-28 A kind of method and apparatus for Backup Data

Country Status (1)

Country Link
CN (1) CN106155839B (en)

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109117303B (en) * 2018-03-02 2019-03-29 深圳海天力电子商务有限公司 Computer shared file emergency backup platform
CN108959548B (en) * 2018-07-02 2023-04-18 创新先进技术有限公司 Service request processing method and device
CN108958984B (en) * 2018-08-13 2022-02-11 深圳市证通电子股份有限公司 Double-active synchronous online hot standby method based on CEPH
CN109271452B (en) * 2018-10-19 2021-04-13 武汉达梦数据库有限公司 DB2 database data synchronous updating method and device
CN111125040B (en) * 2018-10-31 2023-09-08 华为技术有限公司 Method, device and storage medium for managing redo log
CN112685222A (en) * 2019-10-17 2021-04-20 伊姆西Ip控股有限责任公司 Method, apparatus and computer program product for managing backup data
CN111159156B (en) * 2019-12-31 2023-04-28 杭州迪普科技股份有限公司 Backup method and device for SQLite database

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5418940A (en) * 1993-08-04 1995-05-23 International Business Machines Corporation Method and means for detecting partial page writes and avoiding initializing new pages on DASD in a transaction management system environment
US5455942A (en) * 1992-10-01 1995-10-03 International Business Machines Corporation Partial page write detection for a shared cache using a bit pattern written at the beginning and end of each page
CN104156361A (en) * 2013-05-13 2014-11-19 阿里巴巴集团控股有限公司 Method and system for achieving data synchronization

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7689607B2 (en) * 2005-04-15 2010-03-30 Microsoft Corporation Database page mirroring

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5455942A (en) * 1992-10-01 1995-10-03 International Business Machines Corporation Partial page write detection for a shared cache using a bit pattern written at the beginning and end of each page
US5418940A (en) * 1993-08-04 1995-05-23 International Business Machines Corporation Method and means for detecting partial page writes and avoiding initializing new pages on DASD in a transaction management system environment
CN104156361A (en) * 2013-05-13 2014-11-19 阿里巴巴集团控股有限公司 Method and system for achieving data synchronization

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
"Disk Read-Write Optimizationsand Data Integrity in Transaction Systems Using Write-Ahead Logging";C. MOHAN;《Proceedings of the Eleventh International Conference on Data Engineering》;20020806;324-331

Also Published As

Publication number Publication date
CN106155839A (en) 2016-11-23

Similar Documents

Publication Publication Date Title
CN106155839B (en) A kind of method and apparatus for Backup Data
US20220413706A1 (en) Data Storage Method, Apparatus and Storage System
US9367598B2 (en) Merging an out of synchronization indicator and a change recording indicator in response to a failure in consistency group formation
US9152474B2 (en) Context aware synchronization using context and input parameter objects associated with a mutual exclusion lock
US20160203201A1 (en) Data backup method and apparatus
JP2022013854A (en) Method and device for updating database by using two-phase commit distributed transaction
BR112015019280B1 (en) Method to recover application and system specific data
US10049020B2 (en) Point in time recovery on a database
US20170083419A1 (en) Data management method, node, and system for database cluster
US10503601B2 (en) Method and apparatus for tracking objects in a first memory
AU2018214032A1 (en) Systems and methods for maintaining group membership records
US11132351B2 (en) Executing transactions based on success or failure of the transactions
US10620872B2 (en) Replicating data in a data storage system
US20150113244A1 (en) Concurrently accessing memory
WO2017107828A1 (en) Method and device for processing data after restart of node
KR102123616B1 (en) Method and apparatus for parallel journaling using conflict page list
US9424261B2 (en) Techniques to take clean database file snapshot in an online database
CN109271277B (en) Access method, device and system after database downtime
US20210124608A1 (en) System and method for weak lock allowing force preemption by high priority thread
WO2020107352A1 (en) Log sequence number generation method and apparatus and readable storage medium
US10303680B2 (en) Data processing apparatus and data processing method
US9727426B2 (en) Using an overinclusive write record to track and write changes to a storage system
CN116257531B (en) Database space recovery method
CN107862095B (en) Data processing method and device
KR101758792B1 (en) Method and apparatus for data logging based on data structure of nonvoltile memory and recovering based on transaction log

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20231215

Address after: Room 1-2-A06, Yungu Park, No. 1008 Dengcai Street, Sandun Town, Xihu District, Hangzhou City, Zhejiang Province

Patentee after: Aliyun Computing Co.,Ltd.

Address before: Box 847, four, Grand Cayman capital, Cayman Islands, UK

Patentee before: ALIBABA GROUP HOLDING Ltd.