CN109144790A - The synthesized backup method and device of MySQL database - Google Patents

The synthesized backup method and device of MySQL database Download PDF

Info

Publication number
CN109144790A
CN109144790A CN201811159360.0A CN201811159360A CN109144790A CN 109144790 A CN109144790 A CN 109144790A CN 201811159360 A CN201811159360 A CN 201811159360A CN 109144790 A CN109144790 A CN 109144790A
Authority
CN
China
Prior art keywords
backup
data
database
backed
incremental
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.)
Pending
Application number
CN201811159360.0A
Other languages
Chinese (zh)
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.)
GUANGZHOU DINGJIA COMPUTER TECHNOLOGY Co Ltd
Original Assignee
GUANGZHOU DINGJIA COMPUTER TECHNOLOGY Co 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 GUANGZHOU DINGJIA COMPUTER TECHNOLOGY Co Ltd filed Critical GUANGZHOU DINGJIA COMPUTER TECHNOLOGY Co Ltd
Priority to CN201811159360.0A priority Critical patent/CN109144790A/en
Publication of CN109144790A publication Critical patent/CN109144790A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1446Point-in-time backing up or restoration of persistent data
    • G06F11/1448Management of the data involved in backup or backup restore
    • G06F11/1453Management of the data involved in backup or backup restore using de-duplication of the data

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The present invention relates to a kind of synthesized backup method of MySQL database, device, computer equipment and computer readable storage mediums, if it is to back up for the first time that wherein method, which includes: current database to be backed up, are backed up completely to database;If current database to be backed up is not to back up for the first time, the incremental data between current database to be backed up and the database of last backup is obtained, incremental data is backed up;The incremental data of backup is synthesized in the Backup Data of last backup, generates the Backup Data of current number.The synthesized backup method of above-mentioned MySQL database, backup is backed up completely for the first time, and subsequent backup only needs to be synthesized to incremental data in last Backup Data, and BACKUP TIME is shorten to the time of backup incremental data;Backing up obtained new Backup Data every time is all a virtual full backup, only stores incremental data between continuous two virtual full backups, has saved memory space.The efficiency of backup is effectively improved, and reduces the memory space that backup occupies.

Description

The synthesized backup method and device of MySQL database
Technical field
The present invention relates to DB Backup technical field, more particularly to a kind of MySQL database synthesized backup method, Device, computer equipment and computer readable storage medium.
Background technique
MySQL database is a Relational DBMS.Since performance is high, at low cost, good reliability, MySQL has become one of most popular PostgreSQL database.To prevent hardware fault, software fault, natural calamity, maloperation etc. Lead to loss of data, MySQL database is backed up very necessary.
The common backup method of MySQL database includes backup logic, physical backup and Log backup, wherein physical backup It is backed up by replicate data file, without inquiring database, only backs up file, thus there is faster backup rate. However the physical backup method of existing MySQL database, there is a problem of occupied space greatly and BACKUP TIME grow, backup efficiency Lowly.
Summary of the invention
Based on this, it is necessary to for the physical backup method occupied space of above-mentioned existing MySQL database is big and backup The technical problem of time length, synthesized backup method, device, computer equipment and the computer for providing a kind of MySQL database can Read storage medium.
A kind of synthesized backup method of MySQL database, comprising:
If current database to be backed up is to back up for the first time, database is backed up completely;
If current database to be backed up is not to back up for the first time, obtains current database to be backed up and the last time backs up Database between incremental data, incremental data is backed up;
The incremental data of backup is synthesized in the Backup Data of last backup, generates the Backup Data of current number.
The synthesized backup method of above-mentioned MySQL database, in addition to back up for the first time carry out completely backup other than, later each time into Capable backup only needs to be synthesized to incremental data in last Backup Data, and BACKUP TIME is shorten to backup incremental data Time;It is a virtual full backup that each incremental backup, which is synthesized to Backup Data new obtained in last Backup Data all, Incremental data is only stored between continuous two virtual full backups, has saved memory space.So as to effectively promote the effect of backup Rate, and reduce the memory space that backup occupies.
In one embodiment, if current database to be backed up is not to back up for the first time, current number to be backed up is obtained According to the incremental data between library and the database of last backup, incremental data is backed up, comprising:
If current database to be backed up is not that the engine that backup and database to be backed up use for the first time supports affairs day Will, it is determined that the log serial number transaction journal corresponding data big compared with Last Backup are incremental data, are carried out to incremental data Backup;If current database to be backed up is not that the engine that backup and database to be backed up use for the first time does not support affairs day Will, it is determined that the global transaction mark binary log corresponding data big compared to the Backup Data of last time backup are increment Data back up incremental data.
The technical solution of above-described embodiment, the Log Types supported for the engine that database uses are different, using difference Mode determine incremental data using the record of log, and corresponding incremental data is backed up, it is not necessary that data itself are compared To be confirmed whether it is incremental data, the confirmation and backup to incremental data can be fast implemented.
In one embodiment, the incremental data of backup is synthesized in the Backup Data of last backup, is generated current The Backup Data of number, comprising:
If incremental data uses transaction journal, submitted affairs in applied transaction log, in rollback transaction journal The affairs not yet submitted generate the Backup Data of current number;If incremental data uses binary log, by binary log It is imported into a manner of logic reduction in the Backup Data of last backup, generates the Backup Data of current number.
The technical solution of above-described embodiment, it is different for the Log Types used, log is utilized in different ways Incremental data is synthesized in the Backup Data of last backup by record, is synthesized by the record of log to Backup Data, It can more accurately determine the Backup Data of last backup and be synthesized, generate the Backup Data of current number.
In one embodiment, the synthesized backup method of MySQL database further include: if being successfully generated the standby of current number Part data then generate the snapshot of the book of storage Backup Data;If generating the Backup Data of current number, rollback not successfully The state that book is backed up to the last time.
The technical solution of above-described embodiment backs up the storage of generation when being successfully generated the Backup Data of current number The book of data generates snapshot, guarantees the integrality and consistency of Backup Data.And if the backup failure of current number, do not have There is the Backup Data for being successfully generated current number, then the state of rollback book to last time backup, to remove this backup Miss data is backed up from the state of last time backup, it is ensured that the integrality of Backup Data again again when back up next time.
In one embodiment, the synthesized backup method of MySQL database further include: before backing up for the first time, taken in storage Independent book is created in business device, for storing Backup Data.
The technical solution of above-described embodiment is backed up by the independent book created in storage server for storing Data, storage, modification and the reading of subsequent backup data can be obtained from the independent book, can be convenient to standby Part data are managed.
In one embodiment, data to be backed up are transmitted to backup clothes by network insertion storage or storage area network Business device.
The quick transmission of Backup Data may be implemented in the technical solution of above-described embodiment, promoted Backup Data storage and The efficiency of reading.
A kind of synthetic backup device of MySQL database, comprising:
Backup module for the first time carries out database completely standby if being to back up for the first time for current database to be backed up Part;
Incremental backup module obtains current to be backed up if not being to back up for the first time for current database to be backed up Incremental data between database and the database of last backup, backs up incremental data;
Backup Data generation module, it is raw for the incremental data of backup to be synthesized in the Backup Data of last backup At the Backup Data of current number.
The synthetic backup device of above-mentioned MySQL database, in addition to back up for the first time carry out completely backup other than, later each time into Capable backup only needs to be synthesized to incremental data in last Backup Data, and BACKUP TIME is shorten to backup incremental data Time;It is a virtual full backup that each incremental backup, which is synthesized to Backup Data new obtained in last Backup Data all, Incremental data is only stored between continuous two virtual full backups, has saved memory space.So as to effectively promote the effect of backup Rate, and reduce the memory space that backup occupies.
A kind of computer equipment can be run on a memory and on a processor including memory, processor and storage Computer program, processor perform the steps of when executing computer program
If current database to be backed up is to back up for the first time, the database is backed up completely;
If current database to be backed up is not to back up for the first time, obtains current database to be backed up and the last time backs up Database between incremental data, the incremental data is backed up;
The incremental data of backup is synthesized in the Backup Data of last backup, generates the backup number of current number According to.
Above-mentioned computer equipment, when processor executes program, by realizing step as above, so as to realize in addition to head Secondary backup carries out outside backup completely, and the backup carried out each time later only needs for incremental data to be synthesized to last Backup Data In, BACKUP TIME is shorten to the time of backup incremental data;Each incremental backup, which is synthesized in last Backup Data, to be obtained New Backup Data be all a virtual full backup, only store incremental data between continuous two virtual full backups, save Memory space.So as to effectively promote the efficiency of backup, and reduce the memory space that backup occupies.
A kind of computer readable storage medium is stored thereon with computer program, when computer program is executed by processor It performs the steps of
If current database to be backed up is to back up for the first time, the database is backed up completely;
If current database to be backed up is not to back up for the first time, obtains current database to be backed up and the last time backs up Database between incremental data, the incremental data is backed up;
The incremental data of backup is synthesized in the Backup Data of last backup, generates the backup number of current number According to.
Above-mentioned computer readable storage medium, the computer program of storage, by realizing step as above, so as to reality Now other than backing up carry out backup completely for the first time, the backup carried out each time later only needs incremental data being synthesized to the last time In Backup Data, BACKUP TIME is shorten to the time of backup incremental data;Each incremental backup is synthesized to last backup number The new Backup Data obtained in is all a virtual full backup, only stores incremental number between continuous two virtual full backups According to having saved memory space.So as to effectively promote the efficiency of backup, and reduce the memory space that backup occupies.
Detailed description of the invention
Fig. 1 is the applied environment figure of the synthesized backup method of MySQL database in one embodiment;
Fig. 2 is the applied environment figure of the synthesized backup method of MySQL database in another embodiment;
Fig. 3 is the flow diagram of the synthesized backup method of MySQL database in one embodiment;
Fig. 4 is the flow diagram of the synthesized backup method of MySQL database in another embodiment;
Fig. 5 is the flow diagram of the synthesized backup method of MySQL database in another embodiment;
Fig. 6 is the structural block diagram of the synthetic backup device of MySQL database in one embodiment.
Specific embodiment
In order to make the objectives, technical solutions, and advantages of the present invention clearer, with reference to the accompanying drawings and embodiments, right The present invention is further elaborated.It should be appreciated that specific embodiment described herein is only used to explain the present invention, not For limiting the present invention.
The synthesized backup method of MySQL database provided by the invention can be applied to application environment as shown in Figure 1 In.Wherein, terminal 110 is communicated by network with server 120.Server 120 is for storing Backup Data and backup Record, when needing to back up the database in terminal 110, if current database to be backed up is to back up for the first time, eventually 110 pairs of databases are held to be backed up completely, by the backup data store backed up completely in server 120;If current to be backed up Database be not to back up for the first time, then terminal 110 obtains between current database to be backed up and the database of last backup Incremental data, the incremental data is backed up;The incremental data of backup is synthesized to server 120 by terminal 110 In the Backup Data of the last backup of middle storage, generates the Backup Data of current number and be stored in server 120.Its In, terminal 110 can be, but not limited to be various personal computers, laptop, smart phone and tablet computer etc., server 120 can be realized with the server cluster of the either multiple server compositions of independent server.
In another embodiment, as shown in Fig. 2, server 120 may further include backup server 121 and storage Server 122, when backup, terminal 110 submits duplicated record to arrive backup server 121, and terminal 110 copies Backup Data to storing Server 122;When disaster recovery, terminal 110 is to the information of backup server inquiry duplicated record, and terminal 110 is from storage service Device obtains Backup Data.
In one embodiment, as shown in figure 3, providing a kind of synthesized backup method of MySQL database, in this way Applied to being illustrated for the terminal in Fig. 2, comprising the following steps:
S310 backs up database if current database to be backed up is to back up for the first time completely;
Wherein, one or more database has been can store in terminal, database to be backed up refers in the terminal The database backed up when needing to back up some database in terminal, such as can be user actively Backup request is sent by terminal to server, or can be terminal or server is preset with periodically program, every pre- If backup cycle, then can automatic trigger server to the backup operation of terminal.
Wherein, when being backed up for the first time to database, database can be backed up completely, i.e., is copied entire database Shellfish stores into server.
S320 obtains current database and upper one to be backed up if current database to be backed up is not to back up for the first time Incremental data between the database of secondary backup, backs up incremental data;
Wherein, the incremental data between current database to be backed up and the database of last backup, what is referred to is current For the database of database to be backed up compared to last time backup, increased or modification data.
The incremental data of backup is synthesized in the Backup Data of last backup, generates the backup of current number by S330 Data.
In this step, database this time to be backed up is being got compared to the upper incremental data once backed up and progress After backup, the incremental data of backup is synthesized in the Backup Data of last backup, generates the Backup Data of current number.
The synthesized backup method of above-mentioned MySQL database, in addition to back up for the first time carry out completely backup other than, later each time into Capable backup only needs to be synthesized to incremental data in last Backup Data, and BACKUP TIME is shorten to backup incremental data Time;It is a virtual full backup that each incremental backup, which is synthesized to Backup Data new obtained in last Backup Data all, Incremental data is only stored between continuous two virtual full backups, has saved memory space.So as to effectively promote the effect of backup Rate, and reduce the memory space that backup occupies.
In one embodiment, it if as shown in figure 4, current database to be backed up is not to back up for the first time in S320, obtains The incremental data between current database to be backed up and the database of last backup is taken, incremental data is backed up, is wrapped It includes:
S321, if current database to be backed up is not that the engine that backup and database to be backed up use for the first time supports thing Business log, it is determined that the log serial number transaction journal corresponding data big compared with Last Backup are incremental data, to incremental data It is backed up;
Wherein, log recording the operation that changes of all additions and deletions of database.
It specifically, can be by comparing the LSN of transaction journal if the engine that the database uses supports transaction journal (log serial number), the corresponding data of transaction journal backup LSN big compared with Last Backup.
S322, if current database to be backed up is not that the engine that backup and database to be backed up use for the first time is not supported Transaction journal, it is determined that the global transaction mark binary log corresponding data big compared to the Backup Data of last time backup For incremental data, incremental data is backed up.
Wherein, log recording the operation that changes of all additions and deletions of database.
Specifically, if the engine that the database uses does not support transaction journal, compare GTID (the global thing of binary log Be engaged in ID), the corresponding data of binary log backup GTID big compared with Last Backup.
The technical solution of above-described embodiment, the Log Types supported for the engine that database uses are different, using difference Mode determine incremental data using the record of log, and corresponding incremental data is backed up, it is not necessary that data itself are compared To be confirmed whether it is incremental data, the confirmation and backup to incremental data can be fast implemented.
In one embodiment, as shown in figure 5, the incremental data of backup is synthesized to the backup number of last backup by S330 In, the Backup Data of current number is generated, comprising:
S331, if incremental data uses transaction journal, submitted affairs, rollback affairs day in applied transaction log The affairs not yet submitted in will generate the Backup Data of current number;
Binary log is imported by S332 if incremental data uses binary log in a manner of logic reduction In the Backup Data once backed up, the Backup Data of current number is generated.
The technical solution of above-described embodiment, it is different for the Log Types used, log is utilized in different ways Incremental data is synthesized in the Backup Data of last backup by record, is synthesized by the record of log to Backup Data, It can more accurately determine the Backup Data of last backup and be synthesized, generate the Backup Data of current number.
In one embodiment, the synthesized backup method of MySQL database further include:
If being successfully generated the Backup Data of current number, the snapshot of the book of storage Backup Data is generated;
If generating the Backup Data of current number not successfully, the state of rollback book to last time backup.
The technical solution of above-described embodiment backs up the storage of generation when being successfully generated the Backup Data of current number The book of data generates snapshot, guarantees the integrality and consistency of Backup Data.And if the backup failure of current number, do not have There is the Backup Data for being successfully generated current number, then the state of rollback book to last time backup, to remove this backup Miss data is backed up from the state of last time backup, it is ensured that the integrality of Backup Data again again when back up next time.
In one embodiment, the synthesized backup method of MySQL database further include:
Before backing up for the first time, independent book is created in storage server, for storing Backup Data.Specifically, Independent book can be created using file system such as ZFS or Btrfs in storage server, back up number for storage According to.
The technical solution of above-described embodiment is backed up by the independent book created in storage server for storing Data, storage, modification and the reading of subsequent backup data can be obtained from the independent book, can be convenient to standby Part data are managed.
In one embodiment, data to be backed up are transmitted to backup clothes by network insertion storage or storage area network Business device.Specifically, Backup Data can pass through the network storages sides such as DAS (network insertion storage) or SAN (storage area network) Method is transmitted to backup server.
The quick transmission of Backup Data may be implemented in the technical solution of above-described embodiment, promoted Backup Data storage and The efficiency of reading.
It should be understood that although each step in above-described embodiment is arranged successively according to number, these steps It is not necessarily successively to be executed according to the sequence of number.Unless expressly stating otherwise herein, the execution of these steps is not Stringent sequence limitation, these steps can execute in other order.Moreover, at least part in the step of above-described embodiment Step may include that perhaps these sub-steps of multiple stages or stage are executed in synchronization to multiple sub-steps It completes, but can execute at different times, the execution sequence in these sub-steps or stage, which is also not necessarily, successively to be carried out, But it can be executed in turn or alternately at least part of the sub-step or stage of other steps or other steps.
In one embodiment, as shown in fig. 6, providing a kind of synthetic backup device 600 of MySQL database, comprising:
Backup module 610 for the first time carry out database complete if being to back up for the first time for current database to be backed up Backup;
Incremental backup module 620 obtains current to be backed up if not being to back up for the first time for current database to be backed up Database and last backup database between incremental data, incremental data is backed up;
Backup Data generation module 630, for the incremental data of backup to be synthesized in the Backup Data of last backup, Generate the Backup Data of current number.
The synthetic backup device 600 of above-mentioned MySQL database, it is each later other than backing up carry out backup completely for the first time The backup of secondary progress only needs to be synthesized to incremental data in last Backup Data, and BACKUP TIME is shorten to backup incremental number According to time;It is one virtual complete standby that each incremental backup, which is synthesized to Backup Data new obtained in last Backup Data all, Part, incremental data is only stored between continuous two virtual full backups, has saved memory space.So as to effectively promote backup Efficiency, and reduce the memory space that backup occupies.
In one embodiment, incremental backup module 620 includes:
Transaction log backup module, if not being backup for the first time and database to be backed up for current database to be backed up The engine used supports transaction journal, it is determined that the log serial number transaction journal corresponding data big compared with Last Backup are increment Data back up incremental data;
Binary log backup module, if not being backup for the first time and data to be backed up for current database to be backed up The engine that library uses does not support transaction journal, it is determined that global transaction identifies two big compared to the Backup Data of last time backup The corresponding data of system log are incremental data, are backed up to incremental data.
In one embodiment, Backup Data generation module 630 includes:
Transaction log backup data generation module, if transaction journal is used for incremental data, in applied transaction log Submitted affairs, the affairs not yet submitted in rollback transaction journal, generate the Backup Data of current number;
Binary log Backup Data generation module, if binary log is used for incremental data, by binary system day Will is imported into the Backup Data of last backup in such a way that logic restores, and generates the Backup Data of current number.
In one embodiment, the synthesized backup method of MySQL database further include:
Before backing up for the first time, independent book is created in storage server, for storing Backup Data.
In one embodiment, data to be backed up are transmitted to backup clothes by network insertion storage or storage area network Business device.
In one embodiment, the synthesized backup method of MySQL database further include:
If being successfully generated the Backup Data of current number, the snapshot of the book of storage Backup Data is generated;
If generating the Backup Data of current number not successfully, the state of rollback book to last time backup.About The specific of the synthetic backup device of MySQL database limits the synthetic backup side that may refer to above for MySQL database The restriction of method, details are not described herein.Modules in the synthetic backup device of above-mentioned MySQL database can completely or partially lead to Software, hardware and combinations thereof are crossed to realize.Above-mentioned each module can be embedded in the form of hardware or independently of in computer equipment In processor, can also be stored in a software form in the memory in computer equipment, in order to processor call execute with The corresponding operation of upper modules.
The synthesized backup method of the synthetic backup device of MySQL database of the invention and MySQL database of the invention It corresponds, it is equal in the technical characteristic and its advantages of the embodiment elaboration of the synthesized backup method of above-mentioned MySQL database Suitable for the embodiment of the synthetic backup device of MySQL database, hereby give notice that.
In one embodiment, a kind of computer equipment is provided, including memory, processor and storage are on a memory And the computer program that can be run on a processor, processor perform the steps of when executing computer program
If current database to be backed up is to back up for the first time, the database is backed up completely;
If current database to be backed up is not to back up for the first time, obtains current database to be backed up and the last time backs up Database between incremental data, the incremental data is backed up;
The incremental data of backup is synthesized in the Backup Data of last backup, generates the backup number of current number According to.
Above-mentioned computer equipment, when processor executes program, by realizing step as above, so as to realize in addition to head Secondary backup carries out outside backup completely, and the backup carried out each time later only needs for incremental data to be synthesized to last Backup Data In, BACKUP TIME is shorten to the time of backup incremental data;Each incremental backup, which is synthesized in last Backup Data, to be obtained New Backup Data be all a virtual full backup, only store incremental data between continuous two virtual full backups, save Memory space.So as to effectively promote the efficiency of backup, and reduce the memory space that backup occupies.
A kind of computer equipment provided by the embodiment of the present invention, what computer executable instructions were not limited to the described above The synthesized backup method of MySQL database operates, and MySQL database provided by any embodiment of the invention can also be performed Relevant operation in synthesized backup method, and have corresponding function and beneficial effect.
In one embodiment, a kind of computer readable storage medium is provided, computer program is stored thereon with, is calculated Machine program performs the steps of when being executed by processor
If current database to be backed up is to back up for the first time, the database is backed up completely;
If current database to be backed up is not to back up for the first time, obtains current database to be backed up and the last time backs up Database between incremental data, the incremental data is backed up;
The incremental data of backup is synthesized in the Backup Data of last backup, generates the backup number of current number According to.
Above-mentioned computer readable storage medium, the computer program of storage, by realizing step as above, so as to reality Now other than backing up carry out backup completely for the first time, the backup carried out each time later only needs incremental data being synthesized to the last time In Backup Data, BACKUP TIME is shorten to the time of backup incremental data;Each incremental backup is synthesized to last backup number The new Backup Data obtained in is all a virtual full backup, only stores incremental number between continuous two virtual full backups According to having saved memory space.So as to effectively promote the efficiency of backup, and reduce the memory space that backup occupies.
Certainly, a kind of storage medium comprising computer executable instructions, computer provided by the embodiment of the present invention The synthesized backup method for the MySQL database that executable instruction is not limited to the described above operates, and can also be performed of the invention any Relevant operation in the synthesized backup method of MySQL database provided by embodiment, and have corresponding function and beneficial effect Fruit.
Those of ordinary skill in the art will appreciate that realizing all or part of the process in above-described embodiment method, being can be with Relevant hardware is instructed to complete by computer program, the computer program can be stored in a non-volatile computer It can inquire in storage medium, the computer program is when being executed, it may include such as the process of the embodiment of above-mentioned each method.Wherein, To any reference of memory, storage, database or other media used in each embodiment provided by the present invention, Including non-volatile and/or volatile memory.Nonvolatile memory may include read-only memory (ROM), programming ROM (PROM), electrically programmable ROM (EPROM), electrically erasable ROM (EEPROM) or flash memory.Volatile memory may include Random access memory (RAM) or external cache.By way of illustration and not limitation, RAM is available in many forms, Such as static state RAM (SRAM), dynamic ram (DRAM), synchronous dram (SDRAM), double data rate sdram (DDRSDRAM), enhancing Type SDRAM (ESDRAM), synchronization link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic ram (DRDRAM) and memory bus dynamic ram (RDRAM) etc..
Each technical characteristic of above embodiments can be combined arbitrarily, for simplicity of description, not to above-described embodiment In each technical characteristic it is all possible combination be all described, as long as however, the combination of these technical characteristics be not present lance Shield all should be considered as described in this specification.
The embodiments described above only express several embodiments of the present invention, and the description thereof is more specific and detailed, but simultaneously It cannot therefore be construed as limiting the scope of the patent.It should be pointed out that coming for those of ordinary skill in the art It says, without departing from the inventive concept of the premise, various modifications and improvements can be made, these belong to protection of the invention Range.Therefore, the scope of protection of the patent of the invention shall be subject to the appended claims.

Claims (10)

1. a kind of synthesized backup method of MySQL database characterized by comprising
If current database to be backed up is to back up for the first time, the database is backed up completely;
If current database to be backed up is not to back up for the first time, the number of current database to be backed up and last backup is obtained According to the incremental data between library, the incremental data is backed up;
The incremental data of backup is synthesized in the Backup Data of last backup, generates the Backup Data of current number.
2. the synthesized backup method of MySQL database according to claim 1, which is characterized in that then obtain currently to standby Incremental data between the database of part and the database of last backup, backs up the incremental data, comprising:
If the engine that database to be backed up uses supports transaction journal, it is determined that the log serial number affairs big compared with Last Backup The corresponding data of log are incremental data, are backed up to the incremental data;
If the engine that database to be backed up uses does not support transaction journal, it is determined that global transaction mark is standby compared to last The big corresponding data of binary log of the Backup Data of part are incremental data, are backed up to the incremental data.
3. the synthesized backup method of MySQL database according to claim 1, which is characterized in that by the increasing of backup Data Synthesis is measured into the Backup Data of last time backup, generates the Backup Data of current number, comprising:
If the incremental data uses transaction journal, affairs submitted in the transaction journal, thing described in rollback are applied The affairs not yet submitted in business log, generate the Backup Data of current number;
If the incremental data uses binary log, binary log is imported into a manner of logic reduction last standby In the Backup Data of part, the Backup Data of current number is generated.
4. according to claim 1 to the synthesized backup method of MySQL database described in 3 any one, which is characterized in that also wrap It includes:
If being successfully generated the Backup Data of current number, the snapshot of the book of storage Backup Data is generated;
If generating the Backup Data of current number not successfully, the state of rollback book to last time backup.
5. according to claim 1 to the synthesized backup method of MySQL database described in 3 any one, which is characterized in that also wrap It includes:
Before backing up for the first time, independent book is created in storage server, for storing Backup Data.
6. according to claim 1 to the synthesized backup method of MySQL database described in 3 any one, which is characterized in that standby The data of part are transmitted to backup server by network insertion storage or storage area network.
7. a kind of synthetic backup device of MySQL database characterized by comprising
Backup module for the first time carries out the database completely standby if being to back up for the first time for current database to be backed up Part;
Incremental backup module obtains current data to be backed up if not being to back up for the first time for current database to be backed up Incremental data between library and the database of last backup, backs up the incremental data;
Backup Data generation module, it is raw for the incremental data of backup to be synthesized in the Backup Data of last backup At the Backup Data of current number.
8. the synthetic backup device of MySQL database according to claim 7, which is characterized in that incremental backup module packet It includes:
Transaction log backup module, if not being backup for the first time and database to be backed up use for current database to be backed up Engine support transaction journal, it is determined that the log serial number transaction journal corresponding data big compared with Last Backup be incremental number According to being backed up to the incremental data;
Binary log backup module, if not being backup for the first time for current database to be backed up and database to be backed up makes Engine does not support transaction journal, it is determined that the global transaction mark binary system big compared to the Backup Data of last time backup The corresponding data of log are incremental data, are backed up to the incremental data.
9. a kind of computer equipment, including memory, processor and it is stored on the memory and can be in the processor The computer program of upper operation, which is characterized in that the processor realized when executing the computer program as claim 1 to The step of synthesized backup method of MySQL database described in 6 any one.
10. a kind of computer readable storage medium, is stored thereon with computer program, which is characterized in that the computer program The step of the synthesized backup method of the MySQL database as described in claim 1 to 6 any one is realized when being executed by processor Suddenly.
CN201811159360.0A 2018-09-30 2018-09-30 The synthesized backup method and device of MySQL database Pending CN109144790A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811159360.0A CN109144790A (en) 2018-09-30 2018-09-30 The synthesized backup method and device of MySQL database

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811159360.0A CN109144790A (en) 2018-09-30 2018-09-30 The synthesized backup method and device of MySQL database

Publications (1)

Publication Number Publication Date
CN109144790A true CN109144790A (en) 2019-01-04

Family

ID=64814258

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811159360.0A Pending CN109144790A (en) 2018-09-30 2018-09-30 The synthesized backup method and device of MySQL database

Country Status (1)

Country Link
CN (1) CN109144790A (en)

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110083490A (en) * 2019-04-29 2019-08-02 浙江豪联信息科技有限公司 A kind of database backup method, restoring method and storage medium
CN110389937A (en) * 2019-07-26 2019-10-29 上海英方软件股份有限公司 A kind of method and system based on database in phase transmission file
CN111158958A (en) * 2019-12-31 2020-05-15 广州鼎甲计算机科技有限公司 Backup method, system, device and storage medium capable of quickly recovering data
CN111625397A (en) * 2020-04-14 2020-09-04 北京捷通华声科技股份有限公司 Service log backup method, cluster, device, electronic equipment and storage medium
CN112835918A (en) * 2021-02-19 2021-05-25 浪潮云信息技术股份公司 MySQL database increment synchronization implementation method
CN112882862A (en) * 2021-02-22 2021-06-01 广州鼎甲计算机科技有限公司 Mailbox data recovery method and device, computer equipment and storage medium
CN113722152A (en) * 2021-08-05 2021-11-30 四川大学 Data incremental backup method, device, equipment and storage medium
CN115373903A (en) * 2022-08-30 2022-11-22 广州鼎甲计算机科技有限公司 Logic backup method and device, computer equipment and storage medium

Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5644698A (en) * 1996-05-30 1997-07-01 International Business Machines Corporation Configurable reuse delay criterion for storage volumes
US5842222A (en) * 1996-10-04 1998-11-24 Taiwan Semiconductor Manufacturing Company, Ltd. Production information system enhanced for availability
US8041679B1 (en) * 2008-06-04 2011-10-18 Symantec Operating Corporation Synthetic differential backups creation for a database using binary log conversion
CN105630626A (en) * 2014-11-03 2016-06-01 中兴通讯股份有限公司 Transaction backup processing method and device
CN106354583A (en) * 2016-08-30 2017-01-25 广州鼎甲计算机科技有限公司 Hot backup method and system for MySQL database
CN106383861A (en) * 2016-08-31 2017-02-08 网易(杭州)网络有限公司 Data synchronization method and apparatus used for databases
CN106407356A (en) * 2016-09-07 2017-02-15 网易(杭州)网络有限公司 Data backup method and device
CN106610876A (en) * 2015-10-23 2017-05-03 中兴通讯股份有限公司 Method and device for recovering data snapshot
CN107066357A (en) * 2017-05-31 2017-08-18 广州鼎甲计算机科技有限公司 A kind of database synthetic backup and carry restoration methods
CN107229537A (en) * 2017-05-31 2017-10-03 广州鼎甲计算机科技有限公司 A kind of database real time backup method
CN107291787A (en) * 2016-04-13 2017-10-24 中兴通讯股份有限公司 Master/slave data storehouse switching method and apparatus

Patent Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5644698A (en) * 1996-05-30 1997-07-01 International Business Machines Corporation Configurable reuse delay criterion for storage volumes
US5842222A (en) * 1996-10-04 1998-11-24 Taiwan Semiconductor Manufacturing Company, Ltd. Production information system enhanced for availability
US8041679B1 (en) * 2008-06-04 2011-10-18 Symantec Operating Corporation Synthetic differential backups creation for a database using binary log conversion
CN105630626A (en) * 2014-11-03 2016-06-01 中兴通讯股份有限公司 Transaction backup processing method and device
CN106610876A (en) * 2015-10-23 2017-05-03 中兴通讯股份有限公司 Method and device for recovering data snapshot
CN107291787A (en) * 2016-04-13 2017-10-24 中兴通讯股份有限公司 Master/slave data storehouse switching method and apparatus
CN106354583A (en) * 2016-08-30 2017-01-25 广州鼎甲计算机科技有限公司 Hot backup method and system for MySQL database
CN106383861A (en) * 2016-08-31 2017-02-08 网易(杭州)网络有限公司 Data synchronization method and apparatus used for databases
CN106407356A (en) * 2016-09-07 2017-02-15 网易(杭州)网络有限公司 Data backup method and device
CN107066357A (en) * 2017-05-31 2017-08-18 广州鼎甲计算机科技有限公司 A kind of database synthetic backup and carry restoration methods
CN107229537A (en) * 2017-05-31 2017-10-03 广州鼎甲计算机科技有限公司 A kind of database real time backup method

Non-Patent Citations (6)

* Cited by examiner, † Cited by third party
Title
GANESH PRASAD,华中兴业科技发展有限公司: "《Linux部署专业技术》", 31 March 2001, 人民邮电出版社 *
余洪春: "《构建高可用Linux服务器》", 31 October 2014 *
史晓红: "《网络安全完全技术宝典》", 31 March 2010, 中国铁道出版社 *
唐铸文: "《数据库原理及应用》", 31 July 2003 *
喻梅: "《数据库应用技术》", 30 June 2013, 天津大学出版社 *
布拉德福,施耐德: "《Effective MySQL之深入解析复制技术》", 31 January 2014 *

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110083490A (en) * 2019-04-29 2019-08-02 浙江豪联信息科技有限公司 A kind of database backup method, restoring method and storage medium
CN110389937A (en) * 2019-07-26 2019-10-29 上海英方软件股份有限公司 A kind of method and system based on database in phase transmission file
CN111158958A (en) * 2019-12-31 2020-05-15 广州鼎甲计算机科技有限公司 Backup method, system, device and storage medium capable of quickly recovering data
CN111625397A (en) * 2020-04-14 2020-09-04 北京捷通华声科技股份有限公司 Service log backup method, cluster, device, electronic equipment and storage medium
CN111625397B (en) * 2020-04-14 2023-09-12 北京捷通华声科技股份有限公司 Service log backup method, cluster, device, electronic equipment and storage medium
CN112835918A (en) * 2021-02-19 2021-05-25 浪潮云信息技术股份公司 MySQL database increment synchronization implementation method
CN112882862A (en) * 2021-02-22 2021-06-01 广州鼎甲计算机科技有限公司 Mailbox data recovery method and device, computer equipment and storage medium
CN112882862B (en) * 2021-02-22 2022-05-17 广州鼎甲计算机科技有限公司 Mailbox data recovery method and device, computer equipment and storage medium
CN113722152A (en) * 2021-08-05 2021-11-30 四川大学 Data incremental backup method, device, equipment and storage medium
CN115373903A (en) * 2022-08-30 2022-11-22 广州鼎甲计算机科技有限公司 Logic backup method and device, computer equipment and storage medium

Similar Documents

Publication Publication Date Title
CN109144790A (en) The synthesized backup method and device of MySQL database
US9710331B2 (en) Data storage method, data recovery method, related apparatus, and system
CN106776130B (en) Log recovery method, storage device and storage node
CN111078662B (en) Block chain data storage method and device
US20150213100A1 (en) Data synchronization method and system
US8448023B2 (en) Approach for data integrity in an embedded device environment
CN109976947B (en) Power failure recovery method and system for hybrid memory
CN111046024B (en) Data processing method, device, equipment and medium for shared storage database
CN108701005A (en) Data update technology
CN109460438A (en) Message data storage method, device, computer equipment and storage medium
US8639968B2 (en) Computing system reliability
US20190317686A1 (en) Method, apparatus, device and storage medium for processing data location of storage device
CN108920301A (en) Data back up method and system, data reconstruction method and system
WO2022105442A1 (en) Erasure code-based data reconstruction method and appratus, device, and storage medium
WO2022033269A1 (en) Data processing method, device and system
CN104991739A (en) Method and system for refining primary execution semantics during metadata server failure substitution
KR102049417B1 (en) Data storing and restoring method based on In-memory database using NVDIMM
CN113821377B (en) Data recovery method, system and storage medium of distributed storage cluster
CN111581023B (en) Bank memory data processing method and device
JP2014170352A (en) Information system and database restoration method
CN111897676A (en) File backup method and device based on database index
CN113742132B (en) Storage system fault repairing method and device
CN111124740A (en) Data reading method and device, storage equipment and machine-readable storage medium
CN117472292B (en) Data reconstruction method for redundant array of independent disk, storage system and controller
CN117950905B (en) Method, apparatus, device, medium and program product for reorganizing data of buffer disk

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20190104

RJ01 Rejection of invention patent application after publication