CN106776136B - Data base processing method and device - Google Patents

Data base processing method and device Download PDF

Info

Publication number
CN106776136B
CN106776136B CN201611138924.3A CN201611138924A CN106776136B CN 106776136 B CN106776136 B CN 106776136B CN 201611138924 A CN201611138924 A CN 201611138924A CN 106776136 B CN106776136 B CN 106776136B
Authority
CN
China
Prior art keywords
affairs
recovery
database
time
presented
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201611138924.3A
Other languages
Chinese (zh)
Other versions
CN106776136A (en
Inventor
温正湖
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Netease Hangzhou Network Co Ltd
Original Assignee
Netease Hangzhou Network 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 Netease Hangzhou Network Co Ltd filed Critical Netease Hangzhou Network Co Ltd
Priority to CN201611138924.3A priority Critical patent/CN106776136B/en
Publication of CN106776136A publication Critical patent/CN106776136A/en
Application granted granted Critical
Publication of CN106776136B publication Critical patent/CN106776136B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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
    • 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/1458Management of the backup or restore process
    • G06F11/1469Backup restoration techniques

Abstract

Presently filed embodiment provides data base processing method and device.Due to pre-parsed the result is that carrying out pre-parsed acquisition to operation log file in the application, pre-parsed does not need all to parse all the elements in operation log file.In this way, the data volume of parsing result will be less than data volume in the prior art.Moreover, the speed of pre-parsed can also be higher than resolution speed in the prior art.Operation log file is carried out to parse the spent time so as to reduce.In addition, showing the Transaction Identifier of affairs to be presented in the default corresponding position at determining time point according to preset time axis.In this way, user can be by chronologically showing as a result, the open-and-shut operating time for understanding each affairs, so as to make user quickly find recovery point.To further increase the efficiency of determining recovery point, bring preferably application experience for user.

Description

Data base processing method and device
Technical field
Presently filed embodiment is related to field of information processing, more specifically, presently filed embodiment is related to database Treating method and apparatus.
Background technique
This part intends to provides background or context for the presently filed embodiment stated in claims.Herein Description recognizes it is the prior art not because not being included in this section.
Currently, database becomes the preferred embodiment of user management data with the continuous increase of data volume.
Specifically, it needs constantly to be updated database during managing data.Sometimes, special based on certain Determine demand, needs database recovery to some specific state.For example, by the shape of updated database recovery to the previous day State.
When carrying out database recovery in the prior art, PIT (point in time recovery, recovery point) is generallyd use Restore.The recovery point can be a specific time point, be also possible to database operation log file (such as BinLog text Part) in a specific deviation post.
Summary of the invention
For the reason of do not provide the concrete scheme for how determining recovery point in the prior art, in the prior art, if When determining a recovery point, it usually needs parse all information of operation log file;Then parsing result is opened, manually Recovery point is searched from the parsing result of magnanimity.
Therefore conventionally, as including a large amount of data in the operation log file of database, and recovery point floods Not in a large amount of extraneous data.User is difficult to find recovery point in thickly dotted data.So extensive in the prior art The determination of complex point is very complicated, inefficiency.Furthermore, it is generally the case that the data volume of operation log file is bigger, will be such Big document analysis, which comes out, needs to expend many time, and analyzing efficiency is low.So further resulting in the determining needs of recovery point Expend the more time.This is very bothersome process.
Thus, it is also very desirable to which a kind of improved data base processing method and device allow the user to easily determine extensive Complex point improves the application experience of user in order to improve the recovery efficiency of database.
In the present context, presently filed embodiment is intended to provide a kind of data base processing method and device.
In the first aspect of the application embodiment, a kind of data base processing method is provided, comprising:
The beginning and ending time of affairs to be presented is obtained from the pre-parsed result prestored, wherein the pre-parsed result is pair The operation log file of database carries out the result obtained after pre-parsed;
According to the beginning and ending time of affairs to be presented, affairs to be presented corresponding time point on preset time axis is determined;
According to the preset time axis, the affairs mark of affairs to be presented is shown in the default corresponding position at determining time point Know.
In the second aspect of the application embodiment, a kind of database processing device is provided, comprising:
Affairs to be presented obtain module, for obtaining the beginning and ending time of affairs to be presented from the pre-parsed result prestored, Wherein, the pre-parsed result is the result for obtain after pre-parsed to the operation log file of database;
Time point determining module determines affairs to be presented in preset time for the beginning and ending time according to affairs to be presented Corresponding time point on axis;
Affairs display module, for being shown in the default corresponding position at determining time point according to the preset time axis The Transaction Identifier of affairs to be presented.
In the third aspect of the application embodiment, a kind of database processing equipment is provided, for example, may include depositing Reservoir and processor, wherein processor can be used for reading the program in memory, execute following process:
The beginning and ending time of affairs to be presented is obtained from the pre-parsed result prestored, wherein the pre-parsed result is pair The operation log file of database carries out the result obtained after pre-parsed;
According to the beginning and ending time of affairs to be presented, affairs to be presented corresponding time point on preset time axis is determined;
According to the preset time axis, the affairs mark of affairs to be presented is shown in the default corresponding position at determining time point Know.
In the fourth aspect of the application embodiment, a kind of program product is provided comprising program code, when described When program product is run, said program code is for executing following procedure:
The beginning and ending time of affairs to be presented is obtained from the pre-parsed result prestored, wherein the pre-parsed result is pair The operation log file of database carries out the result obtained after pre-parsed;
According to the beginning and ending time of affairs to be presented, affairs to be presented corresponding time point on preset time axis is determined;
According to the preset time axis, the affairs mark of affairs to be presented is shown in the default corresponding position at determining time point Know.
According to the data base processing method and device of the application embodiment, due to pre-parsed the result is that operation log text Part carries out pre-parsed acquisition, and pre-parsed does not need all to parse all the elements in operation log file.In this way, solution The data volume of analysis result will be less than data volume in the prior art.Moreover, the speed of pre-parsed can also be higher than it is in the prior art Resolution speed.Operation log file is carried out to parse the spent time so as to reduce.In addition, according to preset time axis, The Transaction Identifier of affairs to be presented is shown in the default corresponding position at determining time point.In this way, user can be by chronologically It is showing as a result, the open-and-shut operating time for understanding each affairs, so as to make user quickly find recovery point.From And the efficiency of determining recovery point is further increased, preferably application experience is brought for user.
Detailed description of the invention
The following detailed description is read with reference to the accompanying drawings, above-mentioned and other mesh of the application illustrative embodiments , feature and advantage will become prone to understand.In the accompanying drawings, if showing the application's by way of example rather than limitation Dry embodiment, in which:
Fig. 1 schematically shows the application scenarios schematic diagram according to the application embodiment;
Fig. 2 schematically shows the flow diagrams according to the data base processing method of another embodiment of the application;
Fig. 3 schematically shows the schematic diagram at the displaying interface according to the another embodiment of the application;
Fig. 4 schematically shows the schematic diagrames for showing interface according to the application another embodiment;
Fig. 5 schematically shows the schematic diagram at the displaying interface according to the application another embodiment;
Fig. 6 schematically shows the schematic diagram at the displaying interface according to the application another embodiment;
Fig. 7 schematically shows the flow diagram of the data base processing method according to the application another embodiment;
Fig. 8 schematically shows the structural schematic diagram of the database processing device according to the application another embodiment;
Fig. 9 schematically shows the structural schematic diagram of the database processing device according to the application another embodiment;
Figure 10 schematically shows the structural representation of the program product of the database processing according to one embodiment of the application Figure;
In the accompanying drawings, identical or corresponding label indicates identical or corresponding part.
Specific embodiment
The principle and spirit of the application are described below with reference to several illustrative embodiments.It should be appreciated that providing this A little embodiments are used for the purpose of making those skilled in the art can better understand that realizing the application in turn, and be not with any Mode limits scope of the present application.On the contrary, these embodiments are provided so that this disclosure will be more thorough and complete, and energy It is enough that the scope of the present disclosure is completely communicated to those skilled in the art.
One skilled in the art will appreciate that presently filed embodiment can be implemented as a kind of system, device, equipment, method Or computer program product.Therefore, the present disclosure may be embodied in the following forms, it may be assumed that complete hardware, complete software The form that (including firmware, resident software, microcode etc.) or hardware and software combine.
According to presently filed embodiment, a kind of data base processing method and device are proposed.
Herein, it is to be understood that related term:
1, affairs: being the basic unit restored with con current control;Affairs by affairs (begin transaction) and Affairs terminate all operation compositions executed between (end transaction), so an affairs include beginning and ending time (i.e. thing The general name of business time started and affairs end time).Wherein, in relational database, an affairs can be a SQL (Structured Query Language, structured query language) sentence, one group of SQL statement or entire program.
2, operation log file: refer to the file of the operation log for database of record, such as BinLog file.
May include multiple action events in operation log file, for example, Insert (insertion), Delete (deletion), The Event (event) of the DML such as Update (update) (data manipulation language, data manipulation language) type, It also may include the other types Event such as Query (inquiry) Event
3, PIT restores: referring to that the point can be time point by database data recovery to determining certain point, it is also possible to It is some deviation post in operation log file.
4, play back forward: a kind of database recovery mode restored based on PIT starts recovery point and terminates to restore specified After point, database recovery is carried out by the way of playback operation journal file.
5, recall backward: a kind of database recovery mode restored based on PIT starts recovery point and terminates to restore specified After point, database recovery is carried out by the way of rollback, for example, database manipulation is to delete A information, then operation when rollback It is addition A information.
In addition, any number of elements in attached drawing is used to example rather than limitation and any name are only used for distinguishing, Without any restrictions meaning.
Below with reference to several representative embodiments of the application, the principle and spirit of the application are illustrated in detail.
Summary of the invention
Applicants have discovered that in the prior art, the reason of not providing the concrete scheme for how determining recovery point, existing skill In art, if to determine a recovery point, it usually needs parse all information of operation log file;Then parsing is opened As a result, manually searching recovery point from the parsing result of magnanimity.Therefore conventionally, as the operation log text of database It include a large amount of data in part, and recovery point is submerged in a large amount of extraneous data.User is difficult in thickly dotted data Find recovery point.So the determination of recovery point is very complicated in the prior art, inefficiency.Furthermore, it is generally the case that behaviour The data volume for making journal file is bigger, and so big document analysis is come out and needs to expend many time, analyzing efficiency is low. So the determination for further resulting in recovery point needs to expend the more time.The application of user is caused to be experienced poor.
In the embodiment of the present application, due to pre-parsed the result is that carrying out pre-parsed acquisition, pre-parsed to operation log file It does not need all to parse all the elements in operation log file.In this way, the data volume of parsing result will be less than it is existing Data volume in technology.Moreover, the speed of pre-parsed can also be higher than resolution speed in the prior art.So as to reduce to behaviour It carries out parsing the spent time as journal file.In addition, according to preset time axis, in the default corresponding position at determining time point Set the Transaction Identifier for showing affairs to be presented.In this way, user can be by chronologically showing as a result, open-and-shut understand respectively The operating time of affairs, so as to make user quickly find recovery point.To further increase the effect of determining recovery point Rate brings preferably application experience for user.
After describing the basic principle of the application, lower mask body introduces the various non-limiting embodiment party of the application Formula.
Application scenarios overview
Referring initially to Fig. 1, it is the application scenarios schematic diagram of data base processing method provided by the embodiments of the present application.This Scape for example may include user 10, user terminal 11 and server 12.Wherein, mountable in the user terminal 11 to have various visitors Family end, such as data query client, Netease's news client, youku.com's videoconference client.User 10 can be whole based on the user Client in end 11, Xiang Suoshu client or server 12 issue the instruction for searching recovery point;By in the user terminal 11 Client or server 12 according to described instruction, the beginning and ending time of affairs to be presented is obtained from the pre-parsed result prestored; According to the beginning and ending time of affairs to be presented, the affairs to be presented corresponding time point on preset time axis is determined;And according to institute Preset time axis is stated, shows the Transaction Identifier of the affairs to be presented in the default corresponding position at determining time point.
Wherein, the pre-parsed of the operation log file of database can be completed by user terminal 11 or client;Certainly It can also be completed by server 12.When completing the pre-parsed and storing and resolving result to operation log file by server, use Family can issue the instruction for searching recovery point based on the client in the user terminal 11, Xiang Suoshu client;By user's end Client in end 11 is according to the instruction, when request server obtains the start-stop of affairs to be presented from the pre-parsed result prestored Between;It is sent to client after the beginning and ending time that server obtains affairs to be presented, by client according to the start-stop of affairs to be presented Time determines the affairs to be presented corresponding time point on preset time axis;And according to the preset time axis, in determination The default corresponding position at time point show the Transaction Identifiers of the affairs to be presented.In addition it is also possible to straight by server administrators It connects to input to server and instruct, the beginning and ending time of affairs to be presented is obtained by server, according to the beginning and ending time of affairs to be presented, Determine the affairs to be presented corresponding time point on preset time axis;And equipment is shown by server accordingly, according to described Preset time axis shows the Transaction Identifier of the affairs to be presented in the default corresponding position at determining time point.
That is, data base processing method provided by the embodiments of the present application both can by the server implementation of network side, Can also be implemented by the client or even user terminal that are installed in user terminal, also or, can part by server reality It applies, is partially implemented by client or terminal, the application is not limited in any way this.
Wherein, user terminal 11 and server 12 can be communicatively coupled by communication network, which can be local Net, wide area network etc..User terminal 11 can be mobile phone, tablet computer, laptop, personal computer etc., and server 12 can Think any server apparatus that can support corresponding database processing.
Illustrative methods
Below with reference to the application scenarios of Fig. 1, the data according to the application illustrative embodiments are described with reference to Fig. 2-10 Library processing method.It should be noted that above-mentioned application scenarios are merely for convenience of understanding spirit herein and principle and showing, Presently filed embodiment is unrestricted in this regard.On the contrary, presently filed embodiment can be applied to applicable appoint What scene.
As shown in Fig. 2, being the flow diagram of data base processing method provided by the present application, comprising:
Step 201: the beginning and ending time of affairs to be presented is obtained from the pre-parsed result prestored, wherein pre-parsed result The result obtained after pre-parsed is carried out for the operation log file to database.
Step 202: according to the beginning and ending time of affairs to be presented, determining affairs to be presented when corresponding on preset time axis Between point.
Wherein, in one embodiment, each affairs to be presented include the beginning and ending time, i.e. transaction start time and affairs knot The beam time.When it is implemented, be directed to each affairs to be presented, the transaction start time of the affairs to be presented can be determined as this to Show affairs corresponding time point on preset time axis;It similarly, can also be true by the affairs end time of the affairs to be presented It is set to the affairs to be presented corresponding time point on preset time axis;Further, it is also possible to from transaction start time to affairs knot A time point is selected in period between the beam time, and the time point of selection is determined as affairs to be presented in preset time Corresponding time point on axis.
Step 203: according to preset time axis, showing the thing of affairs to be presented in the default corresponding position at determining time point Business mark.
For example, as shown in Figure 3, it is assumed that affairs to be presented include 4, such as affairs 1, affairs 2, affairs 3 and the affairs in Fig. 3 4, the Transaction Identifier of each affairs to be presented is then shown in corresponding position.In Fig. 3, T1, T2, T3, T4 on time shaft can be with It is affairs to be presented determining in step 202 corresponding time point, time being also possible on time shaft on preset time axis Scale.When it is implemented, can time point indicates on time shaft determine according to actual needs content, as long as it is logical to be able to use family The operating time of each affairs to be presented can be understood by crossing time shaft, and the application is not construed as limiting this.
Wherein, in one embodiment, recovery point is accurately confirmed for the ease of user, in the embodiment of the present application, user It can determine whether the affairs checked are needed recovery point by checking the details of affairs.For example, in the same time Section, in the case that transactions are more, perhaps user needs to check the details of affairs to determine which affairs is recovery point. So in the embodiment of the present application, it is (aobvious in the default corresponding position at determining time point i.e. according to preset time axis in step 203 Show the Transaction Identifier of affairs to be presented) after, method further include:
Step A1: after receiving the selection instruction to Transaction Identifier, the beginning and ending time of the affairs of selection is shown.
Step A2: the action event of DML type and the operating time of action event that the affairs of selection include are obtained and is shown Show.
For example, continuing to continue to use example shown in Fig. 3.Then user can be shown such as Fig. 4 by clicking selection affairs 2 Shown in interface.Show the transaction start time of affairs 2 in interface shown in Fig. 4, the affairs end time and comprising DML operation be Insert, Delete.Wherein, the operating time of Insert is 2016.11.2.10:02:04;The behaviour of Delete Making the time is 2016.11.2.10:04:05.In this way, user can further confirm that recovery point by the details of affairs 2 It whether is affairs 2.It should be noted that how Fig. 4 shows the details of the affairs of selection only for illustration, specifically When implementation, the exhibition method at interface can be determined according to actual needs, and the application is not construed as limiting this.
Certainly, it is also necessary to explanation, when it is implemented, when executing step 203, it can also rising each affairs to be presented Only the time and comprising DML operate and show simultaneously with Transaction Identifier, shown after specifying affairs without user's selection.This Sample can avoid user and execute the operating procedure for selecting specified affairs, streamline operation.
Wherein, in one embodiment, action event and the behaviour of the DML type that the affairs of selection include are obtained in step A2 The operating time for making event may particularly include following two embodiment:
Mode 1:, can be by the action event for the DML type that affairs include and behaviour when pre-parsed operation log file The operating time for making event is parsed together in the result for being stored in and obtaining after moon parsing.In this way, can be from pre-parsed result The action event for the DML type that the middle affairs for obtaining selection include and the operating time of action event.
Mode 2: when pre-parsed, it can be parsed out location information of each affairs in operation log file, and store In pre-parsed result.It is then possible to believe from position of the affairs of selection in operation log file is obtained in pre-parsed result Breath parses action event and the operation of the DML type that the affairs of selection include according to location information from operation log file The operating time of event.
In this way, when it is implemented, which kind of can parse when determining pre-parsed according to actual needs and memory space Information storage.The actual demand that can satisfy user improves the application experience of user.
It wherein, in one embodiment, can also be from pre-parsed knot for convenient for further confirming which affairs is recovery point The database and/or table information that the affairs of selection are related to are obtained in fruit and are shown.In this way, being equivalent to makes user further according to thing The database that is related to and/or table information be engaged in confirm which affairs is recovery point.In order to improve the accuracy of determining recovery point.
Wherein, in one embodiment, it can also obtain and check by the following method the details of affairs, in order to Determine recovery point.Specifically, including:
Step B1: after receiving the instruction of details that request specifies affairs, the data volume of specified affairs is determined.
The details of specified affairs, e.g. above-mentioned include DML type action event, action event operation At least one of time, the database being related to, the table information being related to.Certainly, details can also include affairs corresponding Location information in operation log file, such as initial position and end position.Can also include in further details The particular content of operating time, such as insert1, which kind of operation update3 to 4, i.e., specifically perform and operating result can To be included in details.
Step B2: if data volume is less than preset data amount, the details of specified affairs and display are parsed;If data volume More than or equal to preset data amount, then parsing result is stored to object storage server after parsing the details of specified affairs On, and show storage address.
For example, client shows affairs to be presented, and when parsing the details of specified affairs by server, server can It returns to client storage address to be determined according to the data volume of specified affairs or returns to the details parsed. In this way, the particular content of client can be returned to according to actual needs.
It wherein, in one embodiment, can be according to one of following methods or combination, to determine affairs to be presented, specifically :
Method one: the affairs that the operation log file of selection includes are determined as affairs to be presented:
Wherein, in one embodiment, operation log file can have multiple.Each operation log file under normal conditions Middle can include multiple affairs.So being used in the embodiment of the present application in order to be shown as far as possible in limited spacial flex The most desirable affairs in family further include creation time and the shut-in time of operation log file in pre-parsed result;It is pre- from what is prestored Before the beginning and ending time for obtaining affairs to be presented in parsing result, method further include:
Step C1: according to preset time axis, the file identification of display operation journal file and its corresponding creation time and End time.
Step C2: after receiving the selection instruction to file identification, the affairs for including by the operation log file of selection are true It is set to affairs to be presented.
For example, Fig. 5 is the file identification of display operation journal file and its showing for corresponding creation time and end time It is intended to.In Fig. 5, the corresponding creation time of file identification A is A1, end time A2;The corresponding creation time of file identification B For B1, end time B2;The corresponding creation time of file identification C is C1, end time C2.Certainly, it should be noted that Fig. 5 is merely illustrative the embodiment of the present application.When it is implemented, when how interface is designed and shows creation in which way Between and the end time can determine that the application is not construed as limiting this according to actual needs.
That is, each operation log file and corresponding time can first be shown, then according to the user's choice, really Fixed affairs to be presented are then into showing each affairs to be presented in the interface of Fig. 3.In this way, user can be according to time shaft and oneself General time range, rapidly finds the operation log file for needing to understand in detail and affairs to be presented known to oneself.
Method two: affairs to be presented are determined according to the querying condition of user:
The affairs for meeting querying condition are determined as affairs to be presented by the querying condition for receiving user's input;Wherein, it inquires Condition includes at least one of the following:
1), designated time period: for example, searching on November 21st, 20116 this period in the morning 8:00:00-10:00:00 Affairs are as affairs to be presented.In this way, the unrelated affairs of other times section can be filtered out, and related thing is shown in interface Business can further help user to determine recovery point, improve the efficiency for determining recovery point.
2), specified database: for example, the database that user establishes includes database A and database B, and the affairs searched It is only related with database A, then it can specify and search the affairs for being related to database A as affairs to be presented.
3) table information, is specified: for example, affairs related with table b and table c can be searched as affairs to be presented.
4) DML action type, is specified: for example, can include the affairs of Insert type into lookup as affairs to be presented.
5), specify and need the database that filters: for example, user do not know it is related with which database, but can determine with When which database is unrelated, search criterion can be set to be filled into the specified database for needing to filter.For example, determining and data Library B is unrelated, it is determined that affairs to be presented be the affairs unrelated with database B.
6) the table information for needing to filter, is specified: for example, when user's confirmation is unrelated with which table, it is possible to specify need to filter Table information.In this way, the affairs that the table information filtered with specified needs is unrelated are as affairs to be presented.
7) it, specifies and needs the DML action type filtered: for example, the specified DML action type for needing to filter is Update, Then using the affairs of the DML action type in addition to Update as affairs to be presented.
Certainly, querying condition can be applied in combination, such as querying condition is to require to return to specified database at the appointed time The affairs of specified DML action type in section.In this way, user can be accurate to determine which kind of thing searched according to their own needs Business.Consequently facilitating the quantity of affairs to be presented is reduced, then user can determine recovery point according to a small amount of affairs to be presented, To improve the determination efficiency of recovery point, the application experience being used for is improved.
User can be according to itself demand configuration querying condition in brief.In this way, can be filtered out by querying condition Unrelated affairs, and the affairs of user's needs are returned as affairs to be presented.The quantity of the affairs of displaying can be reduced in this way, used Family can determine recovery point from the affairs of negligible amounts, to improve the determination efficiency of recovery point.
The method one and method two of above-mentioned determination affairs to be presented can also combine.E.g., according to determining pair of method one Which operation log file is inquired, and then will need root in the operation log file inquired according to the querying condition of method two It is operated according to the obtained affairs of querying condition as affairs to be presented.In this way, can be only in the operation log file of selection Middle inquiry transaction can be improved the efficiency of inquiry.
Wherein, in one embodiment, when needing the content that shows more, (such as operation log file is more or wait open up When showing that affairs are more), recovery point is checked and searched for the ease of user, may also include following methods:
Step D1: it receives the scaling for scaling time shaft and instructs.
Step D2: instructing according to scaling, scales preset time axis.
For example, show there are 100 affairs to be presented when corresponding in the certain time period of time shaft, but 100 are to be presented Affairs concentrate in together displaying, will have the case where overlapping each other and blocking between Transaction Identifier.So, user will be unable to understand The Transaction Identifier of each affairs to be presented, so user can be with amplification time axis.After amplification, the mark of each affairs to be presented can be complete It shows entirely, in order to which user clearly recognizes each affairs, to easily search recovery point.
Certainly, when it is implemented, when the transactions to be presented shown in the specified unit interval of time shaft are more, As shown in fig. 6, can be to select the Transaction Identifier of preset quantity to show in unit interval, and show in the specified unit interval For transactions to be presented.In this way, the figure shown was both beautiful, it is also convenient for user and determines whether to scale time shaft.
Wherein, in one embodiment, in order to make database recovery to need state, may also include following methods:
Step E1: the recovery request that the affairs of selection are determined as to recovery point is received.
Step E2: database recovery is carried out according to recovery point.
In this way, the recovery operation in recovery point fixed sum data library really can be integrated completion, namely to restore Point really accomplish without any letup by the two links of the recovery in fixed sum data library, can be improved the application experience of user.
Wherein, in one embodiment, database recovery is carried out according to recovery point, may particularly include: needs if it exists extensive Multiple wide area information server example, then be restored to recovery point for database instance.In this way, can be preferentially according to database reality Example, accurately restores database.
Wherein, in one embodiment, database recovery is carried out according to recovery point, specifically may also include that
Step E21: the multiple full backup for the database for needing to restore if it exists, according to the operation day of each full backup Will calculates each full backup and is restored to data volume to be processed needed for recovery point, and selects the smallest full dose of data volume calculated Backup;Alternatively, the time difference between the Backup end time of selection full backup and the end time of recovery point is the smallest complete Amount backup.
Step E22: the full backup of selection is restored to recovery point.
Here step E21- step E22 is illustrated:
For example, it is assumed that meeting the following conditions before database recovery:
Condition 1, recovery point t;
Condition 2, be respectively with title H1, H2 and H3 three full backup, the corresponding Backup end time is respectively t1,t2,t3;
It can then determine which full backup of selection carries out database recovery by following two mode, specific:
Mode 1 calculates in the operation log of H1 between t1-t if each full backup has corresponding operation log Data volume;Calculate the data volume in the operation log of H2 between t2-t;The data volume in the operation log of H3 between t3-t is calculated, It chooses the smallest full backup of data volume calculated and is used for database recovery
Mode 2 calculates t1, t2, t3 respectively with the difference of t, time difference as corresponding full backup.If such as t2 with Difference between t is minimum, then selects H2 for database recovery.
That is, which full backup progress the data volume or time difference that handle as needed select extensive to determine It is multiple.In such manner, it is possible to improve the efficiency of database recovery.
Wherein, in one embodiment, the full backup of selection is restored to recovery point in step E21, specifically included:
Step E211: compare the time between the Backup end time of the full backup of selection and the end time of recovery point Sequencing.
Step E212: if the Backup end time after the end time of recovery point, is incited somebody to action by the way of recalling backward The full backup of selection is restored to recovery point;If the Backup end time before the end time of recovery point, uses and returns forward The full backup of selection is restored to recovery point by the mode put.
In this way, data recovery can be carried out using optimal data reset mode, the accuracy that data are restored is improved.
Wherein, in one embodiment, database recovery is carried out according to the mode recalled backward, then needed in biggish Deposit space.Assuming that the content for needing to carry out back tracking operation backward in Binlog file is section pos1-pos2, wherein recovery point For pos1.The operation that pos1-pos2 includes in chronological sequence sequentially is followed successively by delete4, update2 and (is updated to 3 by 2 3), insert1. needs rollback data then using when backtracking mode is restored backward.That is, it needs to which first insert1 is resolved to It is saved in memory after delete1, update2 to 3 is resolved to the preservation of update3 to 2 in memory and is stored in delete1 Before, delete4 is resolved into insert4 preservation in memory and be stored in front of update3 to 2.By section pos1-pos2 So content is all parsed and is stored in after memory, it is successively read the operation of preservation from memory, then executes.If section Pos1-pos2 data volume is larger, in the case where low memory, parsing will be caused to fail due to low memory, eventually leading to can not Restore database.So in the embodiment of the present application, carrying out data according to recovery point in order to smoothly carry out data recovery Library is restored, and is specifically included:
Step F1: according to free memory space, by the slave current state for needing the database restored be restored to recovery point it Between the affairs that need to restore be divided into multiple transaction sets, wherein the data volume of transaction set is less than or equal to free memory space.
Transaction set can be divided according to the data volume of space memory headroom and each affairs.It is of course also possible to according to the free time The affairs of preset quantity are divided into a transaction set by the actual amount of data of memory headroom and affairs.When it is implemented, can be with Transaction set is divided according to actual needs, causes parsing to fail as long as can be avoided low memory, the application does not limit this It is fixed.
Step F2: according to recovery sequence and recovery point, database recovery is carried out according to ready-portioned multiple transaction sets.
Wherein recovery sequence, the i.e. affairs of beginning and ending time the latest in elder generation's recovery operation journal file.For example, affairs 1 are upper Noon operation, affairs 2 operate with affairs 1, then first restore affairs 2 and restore affairs 1 again afternoons on the same day.
That is, as unit of transaction set, the data restored will be needed to be divided into multistage to fit in the embodiment of the present application Answer memory headroom.In such manner, it is possible to which the recovery due to low memory inverse is avoided to fail.It can be improved the efficiency of database recovery.
Wherein, in one embodiment, in order to improve the accuracy of database recovery, recoveries needs of some operations are directed to Different databases and/or different tables carry out.Such as same operation, some databases need to restore, but efficient database is not It needs to restore.For another example some tables need to restore when database recovery, but some tables are without recovery.So the application In embodiment, before carrying out database recovery according to recovery point, method further include:
Step G1: the recovery condition of input is received;Recovery condition includes at least one of the following: what specified needs filtered Database specified need the database restored, specified need the table information filtered, the specified table information for needing to restore, specified needs The DML action type to be restored.
Wherein, if the condition of recovery includes the database for needing to filter, it may be considered that being when being restored not to this kind of number It is operated according to library;Similarly, specified to need the database restored it may be considered that being to carry out when being restored to this kind of database Operation.Other information similarly repeats no more.
It in this way, carrying out database recovery according to recovery point, may particularly include: being counted according to the condition of recovery and recovery point Restore according to library.
To sum up, in the embodiment of the present application, pass through key message (of such as affairs in the operation log of pre-parsed database The only time), and shown according to time shaft, consequently facilitating user can intuitively, open-and-shut find be considered as recovery The affairs of point.So as to improve the efficiency that recovery point determines, and then improve the efficiency of database recovery.
In addition, when determining recovery point, can also allow for user input query condition, thus mistake in the embodiment of the present application Unrelated transaction is filtered, only user shows the affairs needed, to reduce the quantity of the affairs of displaying, further helps user fast The determination recovery point of speed, improves the determination efficiency of recovery point, improves the application experience of user.
In addition, when carrying out database recovery, being also able to achieve more fine-grained recovery, such as can in the embodiment of the present application To carry out recovery operation only for certain databases, or even only for the progress recovery operation of certain tables, so that the recovery of database It is more accurate, quick, while being also avoided that unrelated database or table are influenced by recovery operation.
In addition, in the embodiment of the present application, by the affairs restored will be needed to be divided into transaction set according to free memory space, It can be avoided since low memory causes to restore to fail, database recovery gone on smoothly.
In the following, for convenient for further understanding data base processing method provided by the embodiments of the present application, with reference to Fig. 7, to the party Method is described further.
In the embodiment shown in fig. 7, it may include the creation time of operation log file that the content parsed is needed when pre-parsed The action event for the DML type for including with the beginning and ending time for the affairs for including in shut-in time, operation log file, each affairs and The table information of database, each Transaction Design that the operating time of action event, also each affairs are related to.And pre-parsed result is deposited It is put into parsing result database in order to inquire.Wherein, operation log file can be completed by server in the present embodiment It parses and safeguards parsing result database.When specific progress database processing, it may include following steps:
Step 701: terminal sends pending data library and identifies to server.
Step 702: server analytically result data library inquiry and the corresponding operation log file of processing Database Identification Creation time and the shut-in time, and be sent to terminal.
Step 703: when terminal is according to preset time axis, the file identification of display operation journal file and its corresponding creation Between and the end time.
Step 704: terminal receives the querying condition of user's input, and will select after receiving the selection instruction to file identification The affairs for meeting querying condition in the corresponding operation log file of the file identification selected are determined as affairs to be presented, and request to service Device returns to affairs to be presented.
Wherein, server can by the beginning and ending time of affairs to be presented, the data manipulation language DML type for including and The database and table information being related to are sent to terminal.
Step 705: terminal determines that affairs to be presented are corresponding on preset time axis according to the beginning and ending time of affairs to be presented Time point.
Step 706: terminal shows the displaying affairs according to preset time axis, in the default corresponding position at determining time point Transaction Identifier.
Step 707: after terminal receives the selection instruction to Transaction Identifier, showing beginning and ending time, the packet of the affairs of selection The action event of the DML type contained and the database being related to and table information.
When it is implemented, the scaling for scaling time shaft can also be received after step 703 and before step 708 Instruction;It is instructed according to scaling, scales preset time axis.In order to which user checks the affairs of database.
Step 708: after terminal receives the instruction of details that request specifies affairs, specified affairs are checked in transmission Details request server.
Step 709: server determines the data volume of specified affairs;If the data volume is greater than or equal to preset data amount, Parsing result is stored onto object storage server after parsing the details of specified affairs, and sends storage address to terminal Display;If the data volume is less than preset data amount, parsing specifies the details of affairs and is sent to terminal and shows.
Details e.g. specify operating time, the result of operation of action event etc. for including in affairs.Facilitate User further confirms that whether specified time is recovery point.
Step 710: terminal receives the recovery request that the affairs of selection are determined as to recovery point.
Step 711: terminal receives the recovery condition of input.
As it was noted above, the condition of recovery includes at least one of the following: the specified database for needing to filter, specified needs The database of recovery, the specified table information for needing the table information filtered, specified needs to restore, the specified DML operation for needing to restore Type.
Step 712: searching whether there are the database instance in pending data library, if so, step 713 is executed, if it is not, holding Row step 714.
Step 713: according to the condition of recovery, database instance being restored to recovery point.
Step 714: multiple full backup in pending data library if it exists, according to the operation log meter of each full backup It calculates each full backup and is restored to data volume to be processed needed for recovery point, and select the smallest full dose of data volume calculated standby Part;Alternatively, the smallest full dose of time difference between the Backup end time of selection full backup and the end time of recovery point Backup;According to the condition of recovery, the full backup of selection is restored to recovery point.
When it is implemented, being carried out when step 713 and step 714 carry out database recovery according to the mode recalled backward Database recovery will need the affairs restored to be divided into multiple transaction sets, wherein transaction set then according to free memory space Data volume is less than or equal to free memory space;Then, according to recovery sequence and recovery point, according to ready-portioned multiple transaction sets Carry out database recovery.This way it is possible to avoid database recovery caused by low memory fails.
In conclusion in the embodiment of the present application, server carries out pre-parsed to operation log file, without will when pre-parsed Operating result parses.Operation log file is all parsed to the speed that can be improved parsing compared with the prior art Degree, can occupy less process resource.Moreover, the information of operation log file and its affairs is shown by time shaft, it can User is helped to search affairs according to the time and determine recovery point.In addition, can help to use by querying condition and recovery condition Family preferably carries out relevant operation, improves the efficiency of database recovery.
Example devices
After the data base processing method for describing the application illustrative embodiments, next, with reference to Fig. 8 to this Shen Please the database processing devices of illustrative embodiments be illustrated.
As shown in figure 8, being the structural schematic diagram of database processing device provided by the embodiments of the present application, comprising:
Affairs to be presented obtain module 801, when for obtaining the start-stop of affairs to be presented from the pre-parsed result prestored Between, wherein the pre-parsed result is the result for obtain after pre-parsed to the operation log file of database;
Time point determining module 802 determines affairs to be presented when default for the beginning and ending time according to affairs to be presented Between corresponding time point on axis;
Affairs display module 803, for being shown in the default corresponding position at determining time point according to the preset time axis Show the Transaction Identifier of affairs to be presented.
Wherein, in one embodiment, described according to the preset time axis, the method also includes:
Affairs beginning and ending time display module 804, the default corresponding position at the time point for being determined in affairs display module 803 After setting the Transaction Identifier for showing affairs to be presented, after receiving the selection instruction to Transaction Identifier, the affairs of selection are shown Beginning and ending time;
Event display module 805, for obtaining the action event and operation thing of the DML type that the selected affairs include Operating time of part and display.
Wherein, in one embodiment, described device further include:
Library table display module 806, the database being related to for obtaining the selected affairs from the pre-parsed result And/or it table information and shows.
Wherein, in one embodiment, the event display module 805, specifically includes:
DML event first acquisition unit 807, the DML for including for obtaining the selected affairs from pre-parsed result The action event of type and the operating time of action event;Alternatively,
DML event second acquisition unit 808, for obtaining the selected affairs from pre-parsed result in operation log Location information in file, according to the positional information, the selected affairs are parsed from operation log file includes The action event of DML type and the operating time of action event.
It wherein, in one embodiment, further include creation time and the pass of operation log file in the pre-parsed result Close the time;Described device further include:
Journal file display module 809 obtains module 801 from the pre-parsed result prestored for the affairs to be presented Before the beginning and ending time for obtaining affairs to be presented, according to the preset time axis, the file identification of display operation journal file and Its corresponding creation time and end time;
Affairs determining module 810 to be presented, after receiving the selection instruction to file identification, by the operation day of selection The affairs that will file includes are determined as affairs to be presented.
Wherein, in one embodiment, described device further include:
Querying condition processing module 811 obtains module 801 from the pre-parsed result prestored for the affairs to be presented Before the beginning and ending time for obtaining affairs to be presented, the querying condition of user's input is received, the affairs of the querying condition will be met It is determined as the affairs to be presented;Wherein, the querying condition includes at least one of the following: designated time period, specified number According to library, the table information for specifying table information, specified DML action type, the database for specifying needs to filter, specified needs to filter, refer to The DML action type for needing to filter calmly.
Wherein, in one embodiment, described device further include:
Data volume determining module 812 determines institute after the instruction of details for specifying affairs for receiving request State the data volume of specified affairs;
First parsing module 813 parses the detailed of the specified affairs if being less than preset data amount for the data volume Thin information is simultaneously shown;
Second parsing module 814 parses the finger if being greater than or equal to the preset data amount for the data volume Parsing result is stored onto object storage server after determining the details of affairs, and shows storage address.
Wherein, in one embodiment, described device further include:
Command reception module 815 is scaled, for receiving the scaling instruction for scaling time shaft;
Zoom module 816 scales the preset time axis for instructing according to the scaling.
Wherein, in one embodiment, described device further include:
Recovery request receiving module 817, for receiving the recovery request that the affairs of selection are determined as to recovery point;
Recovery module 818, for carrying out database recovery according to the recovery point.
Wherein, in one embodiment, recovery module 818 specifically include:
Database instance recovery unit 819, the wide area information server example for needing to restore if it exists then will be described Database instance is restored to the recovery point.
Wherein, in one embodiment, recovery module 818 specifically include:
Full backup selection unit 820, multiple full backup of the database for needing to restore if it exists, according to each The operation log of full backup calculates each full backup and is restored to data volume to be processed needed for the recovery point, and selects to count The smallest full backup of the data volume of calculation;Alternatively, at the end of the Backup end time of selection full backup and the recovery point Between between the smallest full backup of time difference;
Recovery unit 821, for the full backup of selection to be restored to the recovery point.
Wherein, in one embodiment, recovery unit 821 specifically include:
Comparing subunit, for comparing the Backup end time of the full backup of selection and the end time of the recovery point Between chronological order;
Restore subelement, if for the Backup end time after the end time of recovery point, using what is recalled backward The full backup of selection is restored to the recovery point by mode;If the Backup end time before the end time of recovery point, The full backup of selection is restored to the recovery point by the way of playing back forward.
Wherein, in one embodiment, database recovery is carried out according to the mode recalled backward;The recovery module 818, it specifically includes:
Transaction set determination unit 822 is used for according to free memory space, by the slave current state for the database for needing to restore It is restored to the affairs between the recovery point needed to restore and is divided into multiple transaction sets, wherein the data volume of the transaction set is small In or equal to the free memory space;
Transaction set recovery unit 823 is used for according to recovery sequence and the recovery point, according to ready-portioned multiple transaction sets Carry out database recovery.
Wherein, in one embodiment, described device further include:
Recovery condition obtain module 824, for the recovery module 818 according to the recovery point carry out database recovery it Before, receive the recovery condition of input;The recovery condition includes at least one of the following: the specified database for needing to filter, It is specified to need the database restored, the table information for needing the table information filtered, specified needs to restore, specified needs is specified to restore DML action type;
The recovery module 818, specifically includes:
Condition recovery unit 825, for carrying out database recovery according to the recovery condition and the recovery point.
In conclusion in the operation log that database processing device provided by the embodiments of the present application passes through pre-parsed database Key message (beginning and ending times of such as affairs), and shown according to time shaft, consequently facilitating user can intuitively, a mesh That is clear finds the affairs for being considered as recovery point.So as to improve the efficiency that recovery point determines, and then improve database recovery Efficiency.
In addition, when determining recovery point, can also allow for user input query condition, thus mistake in the embodiment of the present application Unrelated transaction is filtered, only user shows the affairs needed, to reduce the quantity of the affairs of displaying, further helps user fast The determination recovery point of speed, improves the determination efficiency of recovery point, improves the application experience of user.
In addition, when carrying out database recovery, being also able to achieve more fine-grained recovery, such as can in the embodiment of the present application To carry out recovery operation only for certain databases, or even only for the progress recovery operation of certain tables, so that the recovery of database It is more accurate, quick, while being also avoided that unrelated database or table are influenced by recovery operation.
In addition, in the embodiment of the present application, by the affairs restored will be needed to be divided into transaction set according to free memory space, It can be avoided since low memory causes to restore to fail, database recovery gone on smoothly.
After describing the method and apparatus of exemplary embodiment of the invention, next, introducing according to the present invention The database processing device of another exemplary embodiment.
Person of ordinary skill in the field it is understood that various aspects of the invention can be implemented as system, method or Program product.Therefore, various aspects of the invention can be embodied in the following forms, it may be assumed that complete hardware embodiment, complete The embodiment combined in terms of full Software Implementation (including firmware, microcode etc.) or hardware and software, can unite here Referred to as circuit, " module " or " system ".
In some possible embodiments, database processing device according to the present invention may include at least one processing Unit and at least one storage unit.Wherein, the storage unit is stored with program code, when said program code is by institute When stating processing unit execution, so that the processing unit executes basis described in above-mentioned " illustrative methods " part of this specification Various steps in the data base processing method of the various illustrative embodiments of the present invention.For example, the processing unit can be held Row step 201 as shown in Figure 2, obtains the beginning and ending time of affairs to be presented, wherein described from the pre-parsed result prestored Pre-parsed result is the result for obtain after pre-parsed to the operation log file of database;Step 202, according to thing to be presented The beginning and ending time of business determines affairs to be presented corresponding time point on preset time axis;Step 203, according to it is described default when Between axis, show the Transaction Identifier of affairs to be presented in the default corresponding position at determining time point.
The database processing device 90 of this embodiment according to the application is described referring to Fig. 9.What Fig. 9 was shown Database processing device is only an example, should not function to the embodiment of the present application and use scope bring any restrictions.
As shown in figure 9, database processing device 90 can be showed in the form of universal computing device, such as it can be clothes Business device equipment.The component of database processing device 90 can include but is not limited to: at least one above-mentioned processing unit 91, it is above-mentioned extremely A few storage unit 92, the bus 93 of the different system components (including storage unit 92 and processing unit 91) of connection.
Bus 93 indicates one of a few class bus structures or a variety of, including memory bus or Memory Controller, Peripheral bus, processor or the local bus using any bus structures in a variety of bus structures.
Storage unit 92 may include the readable medium of form of volatile memory, such as random access memory (RAM) 921 and/or cache memory 922, it can further include read-only memory (ROM) 923.
Storage unit 92 can also include program/utility 925 with one group of (at least one) program module 924, Such program module 924 includes but is not limited to: operating system, one or more application program, other program modules and It may include the realization of network environment in program data, each of these examples or certain combination.
Database processing device 90 can also be logical with one or more external equipments 94 (such as keyboard, sensing equipment etc.) Letter, can also be enabled a user to one or more equipment interact with the database processing device 90 communicate, and/or with make The database processing device 90 can with it is one or more of the other calculating equipment be communicated any equipment (such as router, adjust Modulator-demodulator etc.) communication.This communication can be carried out by input/output (I/O) interface 95.Also, database processing fills Set 90 can also by network adapter 96 and one or more network (such as local area network (LAN), wide area network (WAN) and/or Public network, such as internet) communication.As shown, network adapter 96 passes through bus 93 and database processing device 90 Other module communications.It should be understood that although not shown in the drawings, can with combined data library processing unit 90 using other hardware and/ Or software module, including but not limited to: microcode, device driver, redundant processing unit, external disk drive array, RAID System, tape drive and data backup storage system etc..
Exemplary process product
In some possible embodiments, the various aspects of the application are also implemented as a kind of shape of program product Formula comprising program code, when described program product is run on server apparatus, said program code is for making the clothes Business device equipment executes described in above-mentioned " illustrative methods " part of this specification according to the various illustrative embodiments of the application Method in step, for example, the server apparatus can execute step 201 as shown in Figure 2, from the pre-parsed prestored As a result the beginning and ending time of affairs to be presented is obtained in, wherein the pre-parsed result be to the operation log file of database into The result obtained after row pre-parsed;Step 202, according to the beginning and ending time of affairs to be presented, determine affairs to be presented when default Between corresponding time point on axis;Step 203, aobvious in the default corresponding position at determining time point according to the preset time axis Show the Transaction Identifier of affairs to be presented.
Described program product can be using any combination of one or more readable mediums.Readable medium can be readable letter Number medium or readable storage medium storing program for executing.Readable storage medium storing program for executing for example may be-but not limited to-electricity, magnetic, optical, electromagnetic, red The system of outside line or semiconductor, device or device, or any above combination.The more specific example of readable storage medium storing program for executing (non exhaustive list) includes: the electrical connection with one or more conducting wires, portable disc, hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read only memory (EPROM or flash memory), optical fiber, portable compact disc Read memory (CD-ROM), light storage device, magnetic memory device or above-mentioned any appropriate combination.
As shown in Figure 10, the program product 100 for database processing according to presently filed embodiment is described, Can be using portable compact disc read only memory (CD-ROM) and including program code, and can be transported on server apparatus Row.However, the program product of the application is without being limited thereto, in this document, readable storage medium storing program for executing, which can be, any to be included or stores The tangible medium of program, the program can be commanded execution system, device or device use or in connection.
Readable signal medium may include in a base band or as the data-signal that carrier wave a part is propagated, wherein carrying Readable program code.The data-signal of this propagation can take various forms, including --- but being not limited to --- electromagnetism letter Number, optical signal or above-mentioned any appropriate combination.Readable signal medium can also be other than readable storage medium storing program for executing it is any can Read medium, the readable medium can send, propagate or transmit for by instruction execution system, device or device use or Program in connection.
The program code for including on readable medium can transmit with any suitable medium, including --- but being not limited to --- Wirelessly, wired, optical cable, RF etc. or above-mentioned any appropriate combination.
Can with any combination of one or more programming languages come write for execute the application operation program Code, described program design language include object oriented program language-Java, C++ etc., further include conventional Procedural programming language-such as " C " language or similar programming language.Program code can be fully in user It calculates and executes in equipment, partly executes on a user device, being executed as an independent software package, partially in user's calculating Upper side point is executed on a remote computing or is executed in remote computing device or server completely.It is being related to far Journey calculates in the situation of equipment, and remote computing device can pass through the network of any kind --- including local area network (LAN) or extensively Domain net (WAN)-be connected to user calculating equipment, or, it may be connected to external computing device (such as utilize Internet service Provider is connected by internet).
It should be noted that although being referred to several unit or sub-units of device in the above detailed description, this stroke It point is only exemplary not enforceable.In fact, according to presently filed embodiment, it is above-described two or more The feature and function of unit can embody in a unit.Conversely, the feature and function of an above-described unit can It is to be embodied by multiple units with further division.
In addition, although describing the operation of the application method in the accompanying drawings with particular order, this do not require that or Hint must execute these operations in this particular order, or have to carry out shown in whole operation be just able to achieve it is desired As a result.Additionally or alternatively, it is convenient to omit multiple steps are merged into a step and executed by certain steps, and/or by one Step is decomposed into execution of multiple steps.
Although describing spirit herein and principle by reference to several specific embodiments, it should be appreciated that, this It is not limited to the specific embodiments disclosed for application, does not also mean that the feature in these aspects cannot to the division of various aspects Combination is benefited to carry out, this to divide the convenience merely to statement.This application is intended to cover appended claims spirit and Included various modifications and equivalent arrangements in range.

Claims (28)

1. a kind of data base processing method, comprising:
The beginning and ending time of affairs to be presented is obtained from the pre-parsed result prestored, wherein the pre-parsed result is to data The operation log file in library carries out the result obtained after pre-parsed;
According to the beginning and ending time of affairs to be presented, affairs to be presented corresponding time point on preset time axis is determined;
According to the preset time axis, the Transaction Identifier of affairs to be presented is shown in the default corresponding position at determining time point;
After receiving the selection instruction to Transaction Identifier, the beginning and ending time of the affairs of selection is shown;And
Obtain the action event for the data manipulation language DML type that the selected affairs include and the operating time of action event And it shows.
2. according to the method described in claim 1, the method also includes:
The database and/or table information that the selected affairs are related to are obtained from the pre-parsed result and are shown.
3. according to the method described in claim 1, the action event for obtaining the DML type that selected affairs include and It the operating time of action event, specifically includes:
Obtained from pre-parsed result the DML type that the selected affairs include action event and action event operation when Between;Alternatively,
From location information of the selected affairs in operation log file is obtained in pre-parsed result, believed according to the position Breath, parses the action event for the DML type that the selected affairs include and the behaviour of action event from operation log file Make the time.
4. according to the method described in claim 1, further include in the pre-parsed result operation log file creation time and Shut-in time;It is described before the beginning and ending time for obtaining affairs to be presented in the pre-parsed result prestored, the method also includes:
According to the preset time axis, the file identification of display operation journal file and its corresponding creation time are at the end of Between;
After receiving the selection instruction to file identification, the affairs that the operation log file of selection includes are determined as thing to be presented Business.
5. according to the method described in claim 1, described when obtaining the start-stop of affairs to be presented from the pre-parsed result prestored Between before, the method also includes:
The affairs for meeting the querying condition are determined as the affairs to be presented by the querying condition for receiving user's input;Wherein, The querying condition includes at least one of the following: designated time period, specified database, specified table information, specified DML operation Type, the specified table information for needing the database filtered, specified needs to filter, the specified DML action type for needing to filter.
6. according to the method described in claim 1, the method also includes:
After receiving the instruction of details that request specifies affairs, the data volume of the specified affairs is determined;
If the data volume is less than preset data amount, the details of the specified affairs and display are parsed;
If the data volume is greater than or equal to the preset data amount, will be parsed after parsing the details of the specified affairs As a result it stores in object storage server, and shows storage address.
7. according to the method described in claim 1, the method also includes:
The scaling for scaling time shaft is received to instruct;
It is instructed according to the scaling, scales the preset time axis.
8. any method in -7 according to claim 1, the method also includes:
Receive the recovery request that the affairs of selection are determined as to recovery point;
Database recovery is carried out according to the recovery point.
9. being specifically included according to the method described in claim 8, described carry out database recovery according to the recovery point:
The wide area information server example for needing to restore if it exists, then be restored to the recovery point for the database instance.
10. being specifically included according to the method described in claim 8, described carry out database recovery according to the recovery point:
The multiple full backup for the database for needing to restore if it exists calculate each complete according to the operation log of each full backup Data volume to be processed needed for measuring Backup and Restore to the recovery point, and select the smallest full backup of data volume calculated;Or Person selects the smallest full dose of time difference between the Backup end time of full backup and the end time of the recovery point standby Part;
The full backup of selection is restored to the recovery point.
11. being specifically included according to the method described in claim 10, the full backup of selection is restored to the recovery point:
Compare the chronological order between the Backup end time of the full backup of selection and the end time of the recovery point;
If the Backup end time after the end time of recovery point, by the full backup of selection by the way of recalling backward It is restored to the recovery point;
If the Backup end time before the end time of recovery point, by the full backup of selection by the way of playing back forward It is restored to the recovery point.
12. carrying out database recovery according to the mode recalled backward according to the method any in claim 9-11;Institute It states and database recovery is carried out according to the recovery point, specifically include:
According to free memory space, will need the slave current state of the database restored be restored between the recovery point need it is extensive Multiple affairs are divided into multiple transaction sets, wherein the data volume of the transaction set is less than or equal to the free memory space;
According to recovery sequence and the recovery point, database recovery is carried out according to ready-portioned multiple transaction sets.
13. according to the method described in claim 8, it is described according to the recovery point carry out database recovery before, the method Further include:
Receive the recovery condition of input;The recovery condition includes at least one of the following: the specified database for needing to filter, It is specified to need the database restored, the table information for needing the table information filtered, specified needs to restore, specified needs is specified to restore DML action type;
It is described that database recovery is carried out according to the recovery point, it specifically includes:
Database recovery is carried out according to the recovery condition and the recovery point.
14. a kind of database processing device, comprising:
Affairs to be presented obtain module, for obtaining the beginning and ending time of affairs to be presented from the pre-parsed result prestored, wherein The pre-parsed result is the result for obtain after pre-parsed to the operation log file of database;
Time point determining module determines affairs to be presented on preset time axis for the beginning and ending time according to affairs to be presented Corresponding time point;
Affairs display module, for being shown wait open up in the default corresponding position at determining time point according to the preset time axis Show the Transaction Identifier of affairs;
Affairs beginning and ending time display module is used in affairs display module according to the preset time axis, at determining time point Default corresponding position show the Transaction Identifier of affairs to be presented after, after receiving the selection instruction to Transaction Identifier, display The beginning and ending time of the affairs of selection;And
Event display module, for obtain the data manipulation language DML type that the selected affairs include action event and Operating time of action event and display.
15. device according to claim 14, described device further include:
Library table display module, for obtaining the database and/or table that the selected affairs are related to from the pre-parsed result Information is simultaneously shown.
16. device according to claim 14, the event display module, specifically include:
DML event first acquisition unit, for obtaining the behaviour for the DML type that the selected affairs include from pre-parsed result Make the operating time of event and action event;Alternatively,
DML event second acquisition unit, for from obtaining the selected affairs in pre-parsed result in operation log file Location information the DML type that the selected affairs include is parsed from operation log file according to the positional information Action event and action event operating time.
It further include the creation time of operation log file 17. device according to claim 14, in the pre-parsed result And the shut-in time;Described device further include:
Journal file display module is obtained from the pre-parsed result prestored to be presented for the affairs acquisition module to be presented According to the preset time axis, the file identification of display operation journal file and its corresponding creation before the beginning and ending time of affairs Time and end time;
Affairs determining module to be presented, after receiving the selection instruction to file identification, by the operation log file of selection The affairs for including are determined as affairs to be presented.
18. device according to claim 14, described device further include:
Querying condition processing module is obtained from the pre-parsed result prestored wait open up for obtaining module in the affairs to be presented Before showing the beginning and ending time of affairs, the querying condition of user's input is received, the affairs for meeting the querying condition are determined as institute State affairs to be presented;Wherein, the querying condition includes at least one of the following: designated time period, is specified at specified database Table information, specified need the database filtered, specified need the table information filtered, specified needs to filter specified DML action type DML action type.
19. device according to claim 14, described device further include:
Data volume determining module after the instruction of details for specifying affairs for receiving request, determines described specified The data volume of affairs;
First parsing module parses the details of the specified affairs if being less than preset data amount for the data volume And it shows;
Second parsing module parses the specified affairs if being greater than or equal to the preset data amount for the data volume Details after by parsing result storage in object storage server, and show storage address.
20. device according to claim 14, described device further include:
Command reception module is scaled, for receiving the scaling instruction for scaling time shaft;
Zoom module scales the preset time axis for instructing according to the scaling.
21. any device, described device in 4-20 according to claim 1 further include:
Recovery request receiving module, for receiving the recovery request that the affairs of selection are determined as to recovery point;
Recovery module, for carrying out database recovery according to the recovery point.
22. device according to claim 21, recovery module specifically include:
Database instance recovery unit, the wide area information server example for needing to restore if it exists, then by the database Instance recovery is to the recovery point.
23. device according to claim 21, recovery module specifically include:
Full backup selection unit, multiple full backup of the database for needing to restore if it exists are standby according to each full dose The operation log of part calculates each full backup and is restored to data volume to be processed needed for the recovery point, and selects the number calculated According to the smallest full backup of amount;Alternatively, between the Backup end time of selection full backup and the end time of the recovery point The smallest full backup of time difference;
Recovery unit, for the full backup of selection to be restored to the recovery point.
24. device according to claim 23, recovery unit specifically include:
Comparing subunit, for comparing between the Backup end time of the full backup of selection and the end time of the recovery point Chronological order;
Restore subelement, if for the Backup end time after the end time of recovery point, by the way of recalling backward The full backup of selection is restored to the recovery point;If the Backup end time before the end time of recovery point, uses The full backup of selection is restored to the recovery point by the mode played back forward.
25. carrying out database recovery according to the mode recalled backward according to the device any in claim 22-24; The recovery module, specifically includes:
Transaction set determination unit, for the slave current state of the database restored will be needed to be restored to according to free memory space The affairs for needing to restore between the recovery point are divided into multiple transaction sets, wherein the data volume of the transaction set is less than or waits In the free memory space;
Transaction set recovery unit, for being counted according to ready-portioned multiple transaction sets according to recovery sequence and the recovery point Restore according to library.
26. device according to claim 21, described device further include:
Recovery condition obtains module, before carrying out database recovery according to the recovery point for the recovery module, receives defeated The recovery condition entered;The recovery condition includes at least one of the following: the specified database for needing to filter, specified needs are extensive Multiple database specified need the table information filtered, specified needs the table information restored, the specified DML operation class for needing to restore Type;
The recovery module, specifically includes:
Condition recovery unit, for carrying out database recovery according to the recovery condition and the recovery point.
27. a kind of database processing device, including at least one processing unit and at least one storage unit, wherein described Storage unit is stored with program code, when said program code is executed by the processing unit, so that the processing unit is held The step of row claim 1-13 any the method.
28. a kind of computer readable storage medium comprising program code, when said program code is run on server apparatus When, the step of said program code is for making the server apparatus perform claim require 1-13 any the method.
CN201611138924.3A 2016-12-12 2016-12-12 Data base processing method and device Active CN106776136B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201611138924.3A CN106776136B (en) 2016-12-12 2016-12-12 Data base processing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201611138924.3A CN106776136B (en) 2016-12-12 2016-12-12 Data base processing method and device

Publications (2)

Publication Number Publication Date
CN106776136A CN106776136A (en) 2017-05-31
CN106776136B true CN106776136B (en) 2019-10-22

Family

ID=58875551

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201611138924.3A Active CN106776136B (en) 2016-12-12 2016-12-12 Data base processing method and device

Country Status (1)

Country Link
CN (1) CN106776136B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113868028A (en) * 2020-06-30 2021-12-31 华为技术有限公司 Method for replaying log on data node, data node and system
CN112685230B (en) * 2021-01-05 2022-03-15 浪潮云信息技术股份公司 Method for realizing backup and restoration of assigned time point by distributed database
CN113127427B (en) * 2021-04-21 2022-08-02 山东英信计算机技术有限公司 Method, system and device for analyzing transaction distribution in database log
CN113157496B (en) * 2021-04-28 2023-03-10 深圳市腾讯网域计算机网络有限公司 Processing method applied to data recovery, related device, equipment and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101436207B (en) * 2008-12-16 2011-01-19 浪潮通信信息系统有限公司 Data restoring and synchronizing method based on log snapshot
CN103049355A (en) * 2012-12-25 2013-04-17 华为技术有限公司 Method and equipment for database system recovery
US8775386B2 (en) * 2009-10-19 2014-07-08 International Business Machines Corporation Device and method for generating copy of database
CN105279045A (en) * 2015-10-28 2016-01-27 浪潮(北京)电子信息产业有限公司 Method and system for recovering data of database
CN105955845A (en) * 2016-04-26 2016-09-21 浪潮电子信息产业股份有限公司 Data recovery method and device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101436207B (en) * 2008-12-16 2011-01-19 浪潮通信信息系统有限公司 Data restoring and synchronizing method based on log snapshot
US8775386B2 (en) * 2009-10-19 2014-07-08 International Business Machines Corporation Device and method for generating copy of database
CN103049355A (en) * 2012-12-25 2013-04-17 华为技术有限公司 Method and equipment for database system recovery
CN105279045A (en) * 2015-10-28 2016-01-27 浪潮(北京)电子信息产业有限公司 Method and system for recovering data of database
CN105955845A (en) * 2016-04-26 2016-09-21 浪潮电子信息产业股份有限公司 Data recovery method and device

Also Published As

Publication number Publication date
CN106776136A (en) 2017-05-31

Similar Documents

Publication Publication Date Title
US11409425B2 (en) Transactional conversation-based computing system
CN106776136B (en) Data base processing method and device
CN109117363B (en) Test case generation method and device and server
US9098858B2 (en) Visualizing expressions for dynamic analytics
US20200401955A1 (en) Systems and methods for automated itinerary modification
CN107454140A (en) A kind of Ceph cluster automatically dispose method and system based on big data platform
CN107924679A (en) Delayed binding during inputting understanding processing in response selects
CN102902763B (en) The method of association, retrieving information process data and process information task and device
CN104636130B (en) For generating the method and system of event tree
CN112084315A (en) Question-answer interaction method, device, storage medium and equipment
WO2012102761A1 (en) Method and system for providing detailed information in an interactive manner in a short message service (sms) environment
CN110351715A (en) AT command processing method, terminal adapter and computer readable storage medium
CN109343926A (en) Application program image target display methods, device, terminal and storage medium
CN105335466A (en) Audio data retrieval method and apparatus
CN110334198A (en) Intelligent robot method of servicing, system and terminal device
US9763022B2 (en) Automatic system and method for conversion of smart phone applications to basic phone applications
EP3851803A1 (en) Method and apparatus for guiding speech packet recording function, device, and computer storage medium
CN110019131A (en) A kind of method and apparatus of discs business
WO2020093613A1 (en) Page data processing method and apparatus, storage medium, and computer device
CN110308929A (en) A kind of method of automatization simulation interface and data
CN113537954B (en) Project milestone processing method and device, storage medium and electronic equipment
US20170193385A1 (en) Configurable Dialog System
US20220366147A1 (en) Authoring a conversation service module from relational data
CN108459940A (en) Application performance manages configuration information amending method, device and the electronic equipment of system
US11334537B1 (en) Database metadata transfer system and methods thereof

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant