CN106528582B - The backup method and device of database - Google Patents
The backup method and device of database Download PDFInfo
- Publication number
- CN106528582B CN106528582B CN201510587755.0A CN201510587755A CN106528582B CN 106528582 B CN106528582 B CN 106528582B CN 201510587755 A CN201510587755 A CN 201510587755A CN 106528582 B CN106528582 B CN 106528582B
- Authority
- CN
- China
- Prior art keywords
- database
- backup
- backup mode
- preset
- mode
- 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
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/07—Responding to the occurrence of a fault, e.g. fault tolerance
- G06F11/14—Error detection or correction of the data by redundancy in operation
- G06F11/1402—Saving, restoring, recovering or retrying
- G06F11/1446—Point-in-time backing up or restoration of persistent data
- G06F11/1448—Management of the data involved in backup or backup restore
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/27—Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
Abstract
The invention discloses a kind of backup method of database and devices.Wherein, this method comprises: service condition of the Test database at current time, obtains database service condition testing result;According to obtained database service condition testing result, corresponding DB Backup mode is selected;According to the corresponding DB Backup mode selected, database is backed up.The present invention solve in the related technology as Database Backup operations once can not just interrupt and caused by the backup operation of database can influence each other with normal read-write operation, decline database performance the technical issues of.
Description
Technical field
The present invention relates to internet areas, in particular to the backup method and device of a kind of database.
Background technique
The industries such as internet, finance are very high to data reliability requirement, cause to count in case of situations such as hang-ups
According to loss, loss can be very heavy.For this purpose, database administrator needs to formulate detailed database according to specific business need
Backup strategy.
In the related art, it provides a kind of periodically to database execution full backup operation (that is, complete backup operation)
Technical solution.For example, weekly or monthly doing primary backup completely to database.Under normal conditions, backup is all completely every time
Since some time point, to a complete copy of all data and application progress in database.In practical application, one
As whole system is backed up completely using a disk, including standby system itself and all data.This backup mode
As long as largest benefit be with a disk, so that it may the data for restoring all loss substantially reduce the extensive of system and data
The multiple time.However, it is disadvantageous in that, on the one hand, the data volume that backup needs to back up every time is quite big, and backup is caused to consume
When it is longer;On the other hand, require execution at the appointed time due to backing up every time, and entire backup procedure cannot in
Disconnected, until stand-by program terminates, and other application may access the database in the process, at this point, necessarily leading to data
The backup operation in library can influence each other with normal read-write operation, so that database performance declines.In addition, the BACKUP TIME of database
It is uncontrollable, it needs specified manually.
For above-mentioned problem, currently no effective solution has been proposed.
Summary of the invention
The embodiment of the invention provides a kind of backup method of database and device, at least solve in the related technology due to
Database Backup operations once can not just interrupt and caused by database backup operation and normal read-write operation can be mutual
The technical issues of influencing, declining database performance.
According to an aspect of an embodiment of the present invention, a kind of backup method of database is provided, comprising: Test database
In the service condition at current time, database service condition testing result is obtained;According to obtained above-mentioned database service condition
Testing result selects corresponding DB Backup mode;According to the above-mentioned corresponding DB Backup mode selected, to above-mentioned number
It is backed up according to library.
Further, according to obtained above-mentioned database service condition testing result, corresponding DB Backup side is selected
Formula includes: to select preset database quick backup mode when detecting that above-mentioned database is in using idle state.
Further, after selecting preset database quick backup mode, the above method further include: according to
The above-mentioned preset database quick backup mode selected detects whether during backing up to above-mentioned database
Occur accessing the chance event of above-mentioned database;It is the case where chance event of the above-mentioned database of access occurred in testing result
Under, above-mentioned preset database quick backup mode is switched to the slow backup mode of preset database;According to
Switch the obtained above-mentioned preset slow backup mode of database, above-mentioned database is backed up.
Further, delay above-mentioned preset database quick backup mode is switched to preset database
Before slow backup mode, the above method further include: whether the current accessed amount of the chance event of the above-mentioned database of test access
Reach default requesting threshold, wherein be also not up to above-mentioned default requesting threshold in testing result for above-mentioned current accessed amount
When, above-mentioned preset database quick backup mode is switched to the above-mentioned slow backup mode of preset database.
Further, whether reach default amount of access in the current accessed amount of the chance event of the above-mentioned database of test access
After threshold value, the above method further include: when testing result is that above-mentioned current accessed amount has reached above-mentioned default requesting threshold,
Above-mentioned preset database quick backup mode is switched to preset stopping DB Backup mode;According to switching
Obtained above-mentioned preset stopping DB Backup mode terminates the program backed up to above-mentioned database.
According to another aspect of an embodiment of the present invention, a kind of back-up device of database is additionally provided, comprising: the first detection
Unit, the service condition for Test database at current time obtain database service condition testing result;Selecting unit,
For selecting corresponding DB Backup mode according to obtained above-mentioned database service condition testing result;First backup is single
Member, for being backed up to above-mentioned database according to the above-mentioned corresponding DB Backup mode selected.
Further, above-mentioned selecting unit makes specifically for detecting that above-mentioned database is in above-mentioned first detection unit
When with idle state, preset database quick backup mode is selected;Above-mentioned first backup units are specifically used for according to upper
The database quick backup mode that selecting unit is selected is stated to back up database.
Further, above-mentioned apparatus further include: second detection unit, in above-mentioned first backup units according to selecting
Database quick backup mode during backing up to above-mentioned database, detects whether occur accessing above-mentioned database
Chance event;First switch unit is the above-mentioned database of access occur for the testing result in above-mentioned second detection unit
Chance event in the case where, above-mentioned preset database quick backup mode is switched to preset database and is delayed
Slow backup mode;Second backup units, the above-mentioned preset data for switching according to above-mentioned first switch unit
The slow backup mode in library, backs up above-mentioned database.
Further, above-mentioned apparatus further include: third detection unit, being used for will be above-mentioned preparatory in above-mentioned first switch unit
The database quick backup mode of setting is switched to before the slow backup mode of preset database, the above-mentioned number of test access
Default requesting threshold whether is had reached according to the current accessed amount of the chance event in library, wherein above-mentioned first switch unit is also used
It, will when the testing result in above-mentioned third detection unit is that above-mentioned current accessed amount is also not up to above-mentioned default requesting threshold
Above-mentioned preset database quick backup mode is switched to the above-mentioned slow backup mode of preset database.
Further, above-mentioned apparatus further include: the second switch unit, for the test access in above-mentioned third detection unit
It is above-mentioned work as in testing result after whether the current accessed amount of the chance event of above-mentioned database reaches default requesting threshold
When preceding amount of access has reached above-mentioned default requesting threshold, above-mentioned preset database quick backup mode is switched to pre-
The stopping DB Backup mode first set;End unit, the above-mentioned preset stopping data for being obtained according to switching
Library backup mode terminates the program backed up to above-mentioned database.
In embodiments of the present invention, the side of corresponding DB Backup mechanism is formulated using the service condition according to database
Formula, the service condition by Test database at current time obtain database service condition testing result;According to obtained data
Library service condition testing result selects corresponding DB Backup mode;According to the corresponding DB Backup mode selected, logarithm
It is backed up according to library, having reached prevents Database Backup operations and the conflicting purpose of normal read-write operation, mentions to realize
The technical effect of the performance of high database, so solve in the related technology due to Database Backup operations once just can not in
It is disconnected and caused by the backup operation of database the technical issues of influencing each other with normal read-write operation, declining database performance.
Detailed description of the invention
The drawings described herein are used to provide a further understanding of the present invention, constitutes part of this application, this hair
Bright illustrative embodiments and their description are used to explain the present invention, and are not constituted improper limitations of the present invention.In the accompanying drawings:
Fig. 1 is a kind of flow chart of the backup method of database according to an embodiment of the present invention;
Fig. 2 is a kind of schematic diagram of the back-up device of optional database according to an embodiment of the present invention.
Specific embodiment
In order to enable those skilled in the art to better understand the solution of the present invention, below in conjunction in the embodiment of the present invention
Attached drawing, technical scheme in the embodiment of the invention is clearly and completely described, it is clear that described embodiment is only
The embodiment of a part of the invention, instead of all the embodiments.Based on the embodiments of the present invention, ordinary skill people
Member's every other embodiment obtained without making creative work, should fall within the scope of the present invention.
It should be noted that description and claims of this specification and term " first " in above-mentioned attached drawing, "
Two " etc. be to be used to distinguish similar objects, without being used to describe a particular order or precedence order.It should be understood that using in this way
Data be interchangeable under appropriate circumstances, so as to the embodiment of the present invention described herein can in addition to illustrating herein or
Sequence other than those of description is implemented.In addition, term " includes " and " having " and their any deformation, it is intended that cover
Cover it is non-exclusive include, for example, the process, method, system, product or equipment for containing a series of steps or units are not necessarily limited to
Step or unit those of is clearly listed, but may include be not clearly listed or for these process, methods, product
Or other step or units that equipment is intrinsic.
Embodiment 1
According to embodiments of the present invention, a kind of embodiment of the method for the backup method of database is provided, it should be noted that
Step shown in the flowchart of the accompanying drawings can execute in a computer system such as a set of computer executable instructions, and
It, in some cases, can be to be different from sequence execution institute herein and although logical order is shown in flow charts
The step of showing or describing.
Fig. 1 is a kind of flow chart of the backup method of database according to an embodiment of the present invention, as shown in Figure 1, this method
Include the following steps:
Step S102, Test database obtain database service condition testing result in the service condition at current time;
Step S104 selects corresponding DB Backup mode according to obtained database service condition testing result;
Step S106 backs up database according to the corresponding DB Backup mode selected.
Busy state, the database that the service condition of database specifically includes that database is frequently used are not made substantially
Idle state.Further, which may include: the stochastic regime that chance event uses database again.With
In machine state, the state that a small amount of chance event uses database using the state of database or a large amount of chance events can be.
DB Backup mode specifically includes that database quick backup mode (hereinafter referred to as quick backup mode), database are slow
Backup mode (hereinafter referred to as slow backup mode) and stopping DB Backup mode (hereinafter referred to as stopping backup mode).
These backup modes are all corresponding relationship such as tables preset according to the particular condition in use of database, with service condition
Shown in 1:
Table 1
Database is busy | Stop backup |
Database is idle | Quick backup |
A small amount of chance event uses database under idle state | Slowly backup |
A large amount of chance events use database under idle state | Stop backup (interrupting backup) |
It, can be by the currently used situation of database performance detection module Test database, and according to current when implementation
The testing result of service condition selects preset corresponding backup mode in conjunction with table 1, and then according to the backup side selected
Formula executes backup operation to database.
Specifically, database performance detection module mainly collects performance data in terms of two: on the one hand, collecting data
The performance data in library itself such as collects the current read throughput of database, and records current time;On the other hand, behaviour is collected
Make the performance data of system, such as collect the disk read throughput of operating system, and records current time.
It should be noted that may be corresponded to since database generally comprises multiple, different databases in different time
Therefore different service logics generally manages the backup tasks of multiple databases simultaneously using task management module in systems,
It is corresponded to each database-name and carries out bulk management in different service logics.Since DB Backup is not supported usually
According to service logic backup database, therefore, for each database, need to execute mould by oneself exclusive backup
Block executes backup logic.The backup execution module can be different for different database (such as sqlserver, mysql) adaptations
Database adapter, different database adapters are that corresponding database executes DB Backup task.In use, the backup
Execution module is dispatched by task management module.
Through the embodiment of the present invention, pass through the module and a task schedule of one Test database service condition of setting
Module enables DB Backup to be suitable for various businesses scene, solves full backup and is interrupted in the process or influences other
The problem of database is using conflict, may be implemented to prevent Database Backup operations and the conflicting mesh of normal read-write operation
, and realize the technical effect for improving the performance of database.
Optionally, according to obtained database service condition testing result, the corresponding DB Backup mode is selected to include:
S2 selects preset database quick backup mode when detecting that database is in using idle state.
That is, quick backup operation is executed to database according to preset First Speed, at this time due to it in the database free time
Its program not will use database generally, and therefore, Database Backup operations are separated from each other with using the operation of database, and the two is not
It can have an impact, the two can be prevented caused due to conflicting with each other caused by using same database simultaneously, and in turn
Database performance reduces.
In addition, can be according to corresponding relationship as shown in Table 1 when detecting that database is in using busy state
It selects preset stopping backup mode.That is, stopping executes the standby of any mode to database when database is busy
Part operation can prevent two at this time since other programs meeting normal use database by Database Backup operations without being influenced
Due to conflicting with each other caused by using same database simultaneously, and in turn, caused database performance reduces person.
It should be noted that database business logic definition module can be used, backup strategy is defined according to business demand,
The strategy of four kinds of backups of controlling database as shown in Table 1 may be implemented in the module.Meanwhile service logic is divided into two by the module
Kind, it is respectively as follows: regular incident management and chance event management.It is held in certain time for example, certain service logics need to be defined on
Row, within this time, database may have a large amount of read-write operation, at this point, the processing that cannot backup to database, and
Regular incident management should be carried out to database.It specifically, can be fixed according to settings such as week, the moon, year or some set times
The period of phase incident management, and backup operation periodically is stopped to database.For another example being in idle for a long time in database
When state, can occur a large amount of read-write operations to disk or a large amount of read-write operations to database suddenly, these are emergent
Event is to meet the service logic of chance event management, when encountering these events, by the backup operation of database by quick
Backup is switched to slow backup.
Still optionally further, after selecting preset database quick backup mode, the above method further include:
S4, according to the preset database quick backup mode selected, during being backed up to database,
Detect whether the chance event for access database occur;
S6, in the case where testing result is to have occurred accessing the chance event of database, by preset database
Quick backup mode is switched to the slow backup mode of preset database;
S8 backs up database according to the slow backup mode of preset database that switching obtains.
It should be noted that under normal circumstances, it is believed that the chance event of these access databases is to disk or database
The operation read and write on a small quantity, as long as at this point, quick backup is switched to slow backup, so that it may reduce the two due to making simultaneously
With being conflicted with each other caused by same database, and in turn caused by database performance reduce.
However, the chance event of emergent access database is also likely to be to disk or number in the database free time
The time largely accessed according to library, at this point, being not enough to reduce two if only backup mode is switched to slow backup mode
Person caused by using same database simultaneously due to conflicting with each other.As a result, further, can according to currently occur with
The size of the amount of access of machine event, to determine which kind of more suitable backup mode is quick backup mode be switched to.
Optionally, it slowly backs up preset database quick backup mode is switched to preset database
Before mode, the above method further include:
Whether the current accessed amount of S10, the chance event of test access database have reached default requesting threshold,
In, when testing result is current accessed amount also not up to default requesting threshold, by preset database quick backup
Mode is switched to the slow backup mode of preset database.
That is, only when accessing the current accessed amount of chance event of database not up to default requesting threshold,
Preset database quick backup mode is switched to the slow backup mode of preset database, if can be to avoid
The current accessed amount for accessing the chance event of database is excessive, is also switched to preset database quick backup mode pre-
The slow backup mode of the database first set, and lead to not prevent conflicting between DB Backup and database use.
Still optionally further, whether reach default amount of access in the current accessed amount of the chance event of test access database
After threshold value, the above method further include:
S12 is fast by preset database when testing result is that current accessed amount has reached default requesting threshold
Fast backup mode is switched to preset stopping DB Backup mode;
S14 backs up database according to the preset stopping DB Backup mode that switching obtains, end
Program.
That is, if the corresponding amount of access of chance event is more than certain value, stopping to the data in the database free time
The backup operation in library first allows other programs to use the database.It can prevent same database from executing backup operation in this way
Simultaneously as executing read-write operation and generating conflict.
Embodiment 2
According to embodiments of the present invention, a kind of Installation practice of the back-up device of database is provided.
Fig. 2 is a kind of schematic diagram of the back-up device of optional database according to an embodiment of the present invention, as shown in Fig. 2,
The device includes: first detection unit 202, the service condition for Test database at current time, obtains database use
Situation testing result;Selecting unit 204, for selecting corresponding data according to obtained database service condition testing result
Library backup mode;First backup units 206, for being carried out to database standby according to the corresponding DB Backup mode selected
Part.
Busy state, the database that the service condition of database specifically includes that database is frequently used are not made substantially
Idle state.Further, which may include: the stochastic regime that chance event uses database again.With
In machine state, the state that a small amount of chance event uses database using the state of database or a large amount of chance events can be.
DB Backup mode specifically includes that database quick backup mode (hereinafter referred to as quick backup mode), database are slow
Backup mode (hereinafter referred to as slow backup mode) and stopping DB Backup mode (hereinafter referred to as stopping backup mode).
These backup modes are all corresponding relationship such as tables preset according to the particular condition in use of database, with service condition
Shown in 1.
It, can be by the currently used situation of database performance detection module Test database, and according to current when implementation
The testing result of service condition selects preset corresponding backup mode in conjunction with table 1, and then according to the backup side selected
Formula executes backup operation to database.
Specifically, database performance detection module mainly collects performance data in terms of two: on the one hand, collecting data
The performance data in library itself such as collects the current read throughput of database, and records current time;On the other hand, behaviour is collected
Make the performance data of system, such as collect the disk read throughput of operating system, and records current time.
It should be noted that may be corresponded to since database generally comprises multiple, different databases in different time
Therefore different service logics generally manages the backup tasks of multiple databases simultaneously using task management module in systems,
It is corresponded to each database-name and carries out bulk management in different service logics.Since DB Backup is not supported usually
According to service logic backup database, therefore, for each database, need to execute mould by oneself exclusive backup
The execution backup logic of block.The backup execution module can be adapted to different for different databases (such as sqlserver, mysql)
Database adapter, different database adapters be corresponding database execute DB Backup task.In use, this is standby
Part execution module is dispatched by task management module.
Through the embodiment of the present invention, pass through the module and a task schedule of one Test database service condition of setting
Module enables DB Backup to be suitable for various businesses scene, solves full backup and is interrupted in the process or influences other
The problem of database is using conflict, may be implemented to prevent Database Backup operations and the conflicting mesh of normal read-write operation
, and realize the technical effect for improving the performance of database.
Optionally, selecting unit is specifically used for when first detection unit detects that database is in using idle state,
Select preset database quick backup mode.That is, in the database free time, according to preset First Speed pair
Database executes quick backup operation, at this time since other programs not will use database generally, Database Backup operations
It is separated from each other with the operation of database is used, the two will not have an impact, and both can prevent due to same data of use simultaneously
It is conflicted with each other caused by library, and caused database performance reduces in turn.
In addition, can be according to corresponding relationship as shown in Table 1 when detecting that database is in using busy state
It selects preset stopping backup mode.It is quick that first backup units are specifically used for the database selected according to selecting unit
Backup mode backs up database.That is, the backup for stopping executing database any mode is grasped when database is busy
Make, at this time due to other programs can normal use database without being influenced by Database Backup operations, both can prevent by
It is conflicted with each other caused by simultaneously using same database, and caused database performance reduces in turn.
It should be noted that database business logic definition module can be used, backup strategy is defined according to business demand,
The strategy of four kinds of backups of controlling database as shown in Table 1 may be implemented in the module.Meanwhile service logic is divided into two by the module
Kind, it is respectively as follows: regular incident management and chance event management.It is held in certain time for example, certain service logics need to be defined on
Row, within this time, database may have a large amount of read-write operation, at this point, the processing that cannot backup to database, and
Regular incident management should be carried out to database.It specifically, can be fixed according to settings such as week, the moon, year or some set times
The period of phase incident management, and backup operation periodically is stopped to database.For another example being in idle for a long time in database
When state, can occur a large amount of read-write operations to disk or a large amount of read-write operations to database suddenly, these are emergent
Event is to meet the service logic of chance event management, when encountering these events, by the backup operation of database by quick
Backup is switched to slow backup.
Still optionally further, above-mentioned apparatus further include: second detection unit, for being set in advance in the selection of the first backup units
After fixed database quick backup mode, according to the preset database quick backup mode selected, to database
During being backed up, the chance event for access database occur is detected whether;First switch unit, in the second detection
The testing result of unit is in the case where having occurred accessing the chance event of database, by preset database quick backup
Mode is switched to the slow backup mode of preset database;Second backup units, for switching according to the first switch unit
The obtained slow backup mode of preset database, backs up database.
It should be noted that under normal circumstances, it is believed that the chance event of these access databases is to disk or database
The operation read and write on a small quantity, as long as at this point, quick backup is switched to slow backup, so that it may reduce the two due to making simultaneously
With being conflicted with each other caused by same database, and in turn caused by database performance reduce.
However, the chance event of emergent access database is also likely to be to disk or number in the database free time
The time largely accessed according to library, at this point, being not enough to reduce two if only backup mode is switched to slow backup mode
Person caused by using same database simultaneously due to conflicting with each other.As a result, further, can according to currently occur with
The size of the amount of access of machine event, to determine which kind of more suitable backup mode is quick backup mode be switched to.
Still optionally further, above-mentioned apparatus further include: third detection unit, for that will be preset in the first switch unit
Database quick backup mode be switched to before the slow backup mode of preset database, test access database with
Whether the current accessed amount of machine event has reached default requesting threshold, wherein the first switch unit is also used to detect in third
When the testing result of unit is that current accessed amount also not up to presets requesting threshold, by preset database quick backup
Mode is switched to the slow backup mode of preset database.
That is, only when accessing the current accessed amount of chance event of database not up to default requesting threshold,
Preset database quick backup mode is switched to the slow backup mode of preset database, if can be to avoid
The current accessed amount for accessing the chance event of database is excessive, is also switched to preset database quick backup mode pre-
The slow backup mode of the database first set, and lead to not prevent conflicting between DB Backup and database use.
Still optionally further, above-mentioned apparatus further include: the second switch unit, for the Random event in test access database
It is current accessed amount in the testing result of third detection unit after whether the current accessed amount of part reaches default requesting threshold
When having reached default requesting threshold, preset database quick backup mode is switched to preset stopping data
Library backup mode;End unit, the preset stopping DB Backup mode for obtaining according to switching, terminates to data
The program that library is backed up.
That is, if the corresponding amount of access of chance event is more than certain value, stopping to the data in the database free time
The backup operation in library first allows other programs to use the database.It can prevent same database from executing backup operation in this way
Simultaneously as executing read-write operation and generating conflict.
The serial number of the above embodiments of the invention is only for description, does not represent the advantages or disadvantages of the embodiments.
In the above embodiment of the invention, it all emphasizes particularly on different fields to the description of each embodiment, does not have in some embodiment
The part of detailed description, reference can be made to the related descriptions of other embodiments.
In several embodiments provided herein, it should be understood that disclosed technology contents can pass through others
Mode is realized.Wherein, the apparatus embodiments described above are merely exemplary, such as the division of unit, can be one kind
Logical function partition, there may be another division manner in actual implementation, such as multiple units or components can combine or can
To be integrated into another system, or some features can be ignored or not executed.Another point, shown or discussed is mutual
Coupling, direct-coupling or communication connection can be through some interfaces, the indirect coupling or communication connection of unit or module,
It can be electrical or other forms.
The unit as illustrated by the separation member may or may not be physically separated, aobvious as unit
The component shown may or may not be physical unit, it can and it is in one place, or may be distributed over multiple
On unit.It can some or all of the units may be selected to achieve the purpose of the solution of this embodiment according to the actual needs.
It, can also be in addition, the functional units in various embodiments of the present invention may be integrated into one processing unit
It is that each unit physically exists alone, can also be integrated in one unit with two or more units.Above-mentioned integrated list
Member both can take the form of hardware realization, can also realize in the form of software functional units.
If the integrated unit is realized in the form of SFU software functional unit and sells or use as independent product
When, it can store in a computer readable storage medium.Based on this understanding, technical solution of the present invention is substantially
The all or part of the part that contributes to existing technology or the technical solution can be in the form of software products in other words
It embodies, which is stored in a storage medium, including some instructions are used so that a computer
Equipment (can for personal computer, server or network equipment etc.) execute each embodiment the method for the present invention whole or
Part steps.And storage medium above-mentioned includes: that USB flash disk, read-only memory (ROM, Read-Only Memory), arbitrary access are deposited
Reservoir (RAM, Random Access Memory), mobile hard disk, magnetic or disk etc. be various to can store program code
Medium.
The above is only a preferred embodiment of the present invention, it is noted that for the ordinary skill people of the art
For member, various improvements and modifications may be made without departing from the principle of the present invention, these improvements and modifications are also answered
It is considered as protection scope of the present invention.
Claims (6)
1. a kind of backup method of database characterized by comprising
Test database obtains database service condition testing result in the service condition at current time;
According to the obtained database service condition testing result, corresponding DB Backup mode is selected;
According to the corresponding DB Backup mode selected, the database is backed up, wherein according to obtained institute
Database service condition testing result is stated, selecting corresponding DB Backup mode includes: to detect that the database is in
When using idle state, preset database quick backup mode is selected,
After selecting preset database quick backup mode, the method also includes: described pre- according to what is selected
The database quick backup mode first set during backing up to the database, detects whether occur described in access
The chance event of database;It, will be described pre- in the case where testing result is the chance event of the access database occurred
The database quick backup mode first set is switched to the slow backup mode of preset database;The institute obtained according to switching
The slow backup mode of preset database is stated, the database is backed up.
2. the method according to claim 1, wherein by the preset database quick backup mode
It is switched to before the slow backup mode of preset database, the method also includes:
Whether the current accessed amount of the chance event of database described in test access has reached default requesting threshold, wherein
It is when testing result is that the current accessed amount is also not up to the default requesting threshold, the preset database is fast
Fast backup mode is switched to the slow backup mode of preset database.
3. according to the method described in claim 2, it is characterized in that, the chance event of the database described in test access it is current
After whether amount of access reaches default requesting threshold, the method also includes:
When testing result is that the current accessed amount has reached the default requesting threshold, by the preset data
Library quick backup mode is switched to preset stopping DB Backup mode;
The database is backed up according to the preset stopping DB Backup mode that switching obtains, end
Program.
4. a kind of back-up device of database characterized by comprising
First detection unit, the service condition for Test database at current time obtain database service condition detection knot
Fruit;
Selecting unit, for selecting corresponding DB Backup side according to the obtained database service condition testing result
Formula;
First backup units, for being backed up to the database according to the corresponding DB Backup mode selected,
The selecting unit is specifically used for the selection when first detection unit detects that the database is in using idle state
Preset database quick backup mode;First backup units are specifically used for the number selected according to the selecting unit
Database is backed up according to library quick backup mode,
Described device further include: second detection unit, for quickly standby according to the database selected in first backup units
Part mode during backing up to the database, detects whether the chance event for occurring accessing the database;First
Switch unit, for being the feelings of the chance event of the access database occurred in the testing result of the second detection unit
Under condition, the preset database quick backup mode is switched to the slow backup mode of preset database;The
Two backup units, the slow side of backup of the preset database for switching according to first switch unit
Formula backs up the database.
5. device according to claim 4, which is characterized in that described device further include:
Third detection unit, for switching the preset database quick backup mode in first switch unit
Before the slow backup mode of preset database, the current accessed amount of the chance event of database described in test access is
It is no to have reached default requesting threshold,
Wherein, first switch unit be also used to the third detection unit testing result be the current accessed amount also
Not up to the default requesting threshold when, the preset database quick backup mode is switched to and described is set in advance
The slow backup mode of fixed database.
6. device according to claim 5, which is characterized in that described device further include:
Second switch unit, for the testing result in the third detection unit be the current accessed amount have reached it is described pre-
If when requesting threshold, it is standby that the preset database quick backup mode is switched to preset stopping database
Part mode;
End unit, the preset stopping DB Backup mode for obtaining according to switching, terminates to the number
The program backed up according to library.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510587755.0A CN106528582B (en) | 2015-09-15 | 2015-09-15 | The backup method and device of database |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510587755.0A CN106528582B (en) | 2015-09-15 | 2015-09-15 | The backup method and device of database |
Publications (2)
Publication Number | Publication Date |
---|---|
CN106528582A CN106528582A (en) | 2017-03-22 |
CN106528582B true CN106528582B (en) | 2019-07-23 |
Family
ID=58348727
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201510587755.0A Active CN106528582B (en) | 2015-09-15 | 2015-09-15 | The backup method and device of database |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN106528582B (en) |
Families Citing this family (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107066353B (en) * | 2017-03-28 | 2020-06-12 | 深圳市科力锐科技有限公司 | Data using method and data consistency assembly in data backup process |
CN108664524A (en) * | 2017-03-31 | 2018-10-16 | 平安科技(深圳)有限公司 | database data archiving method and system |
CN109976942B (en) * | 2017-12-28 | 2021-02-19 | 中移(杭州)信息技术有限公司 | Data backup and recovery method, backup server and source server |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US5522037A (en) * | 1993-09-20 | 1996-05-28 | Fujitsu Limited | Backup control apparatus and method of data processing system |
CN101326498A (en) * | 2005-12-08 | 2008-12-17 | 辉达公司 | Emergency data preservation services |
CN101788938A (en) * | 2010-03-26 | 2010-07-28 | 北京邮电大学 | Data backup method based on user storing actions |
CN102841827A (en) * | 2012-06-28 | 2012-12-26 | 宇龙计算机通信科技(深圳)有限公司 | Method for backuping database files and communication terminal |
CN103197988A (en) * | 2012-01-05 | 2013-07-10 | 中国移动通信集团湖南有限公司 | Data backup and recovery method, device and database system |
CN103947124A (en) * | 2012-10-01 | 2014-07-23 | 华为技术有限公司 | Controlling data synchronization and backup services |
-
2015
- 2015-09-15 CN CN201510587755.0A patent/CN106528582B/en active Active
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US5522037A (en) * | 1993-09-20 | 1996-05-28 | Fujitsu Limited | Backup control apparatus and method of data processing system |
CN101326498A (en) * | 2005-12-08 | 2008-12-17 | 辉达公司 | Emergency data preservation services |
CN101788938A (en) * | 2010-03-26 | 2010-07-28 | 北京邮电大学 | Data backup method based on user storing actions |
CN103197988A (en) * | 2012-01-05 | 2013-07-10 | 中国移动通信集团湖南有限公司 | Data backup and recovery method, device and database system |
CN102841827A (en) * | 2012-06-28 | 2012-12-26 | 宇龙计算机通信科技(深圳)有限公司 | Method for backuping database files and communication terminal |
CN103947124A (en) * | 2012-10-01 | 2014-07-23 | 华为技术有限公司 | Controlling data synchronization and backup services |
Also Published As
Publication number | Publication date |
---|---|
CN106528582A (en) | 2017-03-22 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10037348B2 (en) | Database management system with database hibernation and bursting | |
EP2372551B1 (en) | Real time backup storage node assignment | |
JP6033985B2 (en) | Performance evaluation method and information processing apparatus | |
US9274714B2 (en) | Method and system for managing storage capacity in a storage network | |
CN106354583B (en) | A kind of heat backup method and system of MySQL database | |
US10496323B2 (en) | Data protection using change-based measurements in block-based backup | |
CN105376100B (en) | A kind of distributed warning rule evaluation method suitable for cloud platform monitoring resource | |
CN106528582B (en) | The backup method and device of database | |
CN106776113B (en) | Virtual machine backup method and device | |
CN104750573B (en) | The global coherency backup-and-restore method of distributed data system back end | |
CN107273182B (en) | Method and system for dynamically expanding virtual machine resources | |
CN107463468A (en) | Buffer memory management method and its equipment | |
CN106209412B (en) | Resource monitoring system and method thereof | |
US9996599B2 (en) | Using access count of the remote site to optimize file transfer order for asynchronous replication | |
CN110727508A (en) | Task scheduling system and scheduling method | |
US9639701B1 (en) | Scheduling data protection operations based on data activity | |
US20150286548A1 (en) | Information processing device and method | |
CN103902401B (en) | Virtual machine fault-tolerance approach and device based on monitoring | |
CN113778650A (en) | Task scheduling method and device, electronic equipment and storage medium | |
CN108958980A (en) | Prevent method, electronic device and the computer readable storage medium of Activity life cycle exception | |
CN110377616A (en) | A kind of data-erasure method, device, electronic equipment and storage medium | |
CN109274548A (en) | A kind of method for monitoring application program, computer readable storage medium and terminal device | |
CN115643178A (en) | Network target range configuration method, device, equipment and machine readable storage medium | |
CN106126123B (en) | A kind of method, apparatus and system of the distribution of host volume | |
CN103746968A (en) | CDN server removal method, CDN control center and system thereof |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
CB02 | Change of applicant information |
Address after: 100083 No. 401, 4th Floor, Haitai Building, 229 North Fourth Ring Road, Haidian District, Beijing Applicant after: Beijing Guoshuang Technology Co.,Ltd. Address before: 100086 Cuigong Hotel, 76 Zhichun Road, Shuangyushu District, Haidian District, Beijing Applicant before: Beijing Guoshuang Technology Co.,Ltd. |
|
CB02 | Change of applicant information | ||
GR01 | Patent grant | ||
GR01 | Patent grant |