CN105446828A - Database backup and recovery method, apparatus and system - Google Patents

Database backup and recovery method, apparatus and system Download PDF

Info

Publication number
CN105446828A
CN105446828A CN201410523108.9A CN201410523108A CN105446828A CN 105446828 A CN105446828 A CN 105446828A CN 201410523108 A CN201410523108 A CN 201410523108A CN 105446828 A CN105446828 A CN 105446828A
Authority
CN
China
Prior art keywords
database
time
backup
full backup
data
Prior art date
Application number
CN201410523108.9A
Other languages
Chinese (zh)
Other versions
CN105446828B (en
Inventor
符玲亭
Original Assignee
北京金山云网络技术有限公司
北京金山云科技有限公司
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 北京金山云网络技术有限公司, 北京金山云科技有限公司 filed Critical 北京金山云网络技术有限公司
Priority to CN201410523108.9A priority Critical patent/CN105446828B/en
Publication of CN105446828A publication Critical patent/CN105446828A/en
Application granted granted Critical
Publication of CN105446828B publication Critical patent/CN105446828B/en

Links

Abstract

Embodiments of the present invention disclose a database backup and recovery method, apparatus and system. When recovering a to-be-recovered database, data recovery is performed on the to-be-recovered database by using full backup data of the last full backup time of the to-be-recovered database and record data of the to-be recovered database between the last full backup time and a recovery target time point. By applying the method, apparatus and system disclosed by the embodiments of the present invention, it is avoided that the data between the database recovery target time point and the last database full backup time point before the database recovery target time point is lost as when being recovered, the database is recovered by using only data of the last database full backup before the database recovery target time point when performing recovery on a database, only the last database full backup data before the database recovering target time point is used, the loss of the data between the database recovering target time point and the last database full backup time point before the database recovering target time point is avoided.

Description

-种数据库备份、恢复方法、装置及系统 - kind of database backup, recovery method, apparatus and system for

技术领域 FIELD

[0001] 本发明涉及计算机信息安全技术领域,特别涉及一种数据库备份、恢复方法、装置及系统。 [0001] The present invention relates to computer technology field of information security, particularly to a database backup and recovery methods, apparatus and systems.

背景技术 Background technique

[0002] 随着计算机技术和互联网技术的发展,信息安全的重要性日趋明显。 [0002] With the development of computer technology and Internet technology, the importance of information security has become increasingly evident. 数据库作为信息安全的一个重要内容也被越来越重视。 Database as an important element of information security is also more and more attention. 数据库是指长期存储在计算机内有组织、可共享的数据集合。 Refers to a computer database in an organized long-term storage can be shared set of data. 如果没有对数据库进行备份,郝么在数据库发生错误时,就不能对数据库进行恢复,从而导致数据库数据的丢失,此时造成的损失是无法弥补的。 If you do not back up the database, Hao it when a database error, it can not restore the database, resulting in the loss of data in the database, this time caused by the loss is irreparable.

[0003] 现有技术中常用的一种数据库备份及恢复方法,是预先设置数据库全量备份时间点,当时间到达预先设置的数据库全量备份时间点时,对数据库进行全量备份,生成数据库全量备份数据,所谓的全量备份是指对整个数据库进行完全的备份。 [0003] Frequently a database backup and recovery methods of the prior art, is set in advance a database full backup point in time, when the database time reaches a preset full backup point in time, the database is full backup, generate a database full backup data the so-called full backup means that the entire database full backups. 当数据库出现问题时, 使用数据库恢复目标时间点之前的最近一次数据库全量备份数据,对数据库进行恢复。 When the database problems, the most recent database before the target point in time recovery using the database full backup data, restore the database.

[0004] 但是,在数据库出现问题需要对数据库进行恢复时,应用上述的数据库备份及恢复方法,只能将数据库的状态恢复到数据库恢复目标时间点之前的最近一次数据库全量备份时间点的状态,全量备份所花时间较长,资源消耗较大,因此相邻两次全量备份的时间间隔比较长,而且全量备份期间出现数据库恢复需求时,能够获得的最近一次完整的数据库全量备份数据已经时隔很久,往往导致数据库恢复目标时间点至数据库恢复目标时间点之前的最近一次数据库全量备份时间点的大量数据无法恢复,因此全量备份的方式有较多缺陷和不安全的因素存在。 [0004] However, when issues need to restore the database, applying the database backup and recovery methods, you can only restore the state of the database to the state once the database full backup point in time recently before the database recovery target point in time appear in the database, full backup takes longer, consume more resources, so the two neighboring full backup time interval is relatively long, and occurred during the last full backup of the complete database full backup database data recovery needs, have access to lapse for a long time, often leads to a point in time database restore large amounts of data to the most recent full backup database point of time can not be restored before the database recovery target point in time, so full backup of the way there exist many factors defective and unsafe.

发明内容 SUMMARY

[0005] 本发明实施例的目的在于提供一种数据库备份、恢复方法、装置及系统,W防止在数据库进行恢复时,数据库恢复目标时间点至数据库恢复目标时间点之前的最近一次数据库全量备份时间点之间数据的丢失。 [0005] The object of embodiments of the present invention to provide a database backup and recovery methods, apparatus, and systems, W prevented when database recovery, database recovery target time point to the last database full backup time before the database recovery target point in time missing data between points.

[0006] 为达到上述目的,本发明实施例公开了一种数据库备份方法,包括: [0006] To achieve the above object, embodiments of the present invention discloses a database backup method, comprising:

[0007] 根据数据库组中的各个数据库的全量备份时间点,分别对每个数据库在其全量备份时间点进行全量备份; [0007] The full backup time point each database group database, separately for each full backup database at the time point of its full backup;

[0008] 在对任一数据库相邻两次全量备份时间之间,记录对该数据库的修改,生成记录数据。 [0008] For any database between two adjacent full backup time, modifications to the database record, generates a recording data.

[0009] 较佳的,所述数据库组,包括: [0009] Preferably, the database group, comprising:

[0010] 在多租户环境下,分别为每位租户配置的一个独立于其他租户存在的数据库的集A 口〇 [0010] In the multi-tenant environment, each tenant are arranged independently of the other a present set of port A tenant database billion

[0011] 较佳的,所述数据库组中的各个数据库的全量备份时间点是预先设置的; [0011] Preferably, the total amount of time the database backup point group of each database is set in advance;

[0012] 或所述全量备份时间点,是由策略管理单元确定的。 [0012] or the full backup point in time, is determined by the policy management unit.

[0013] 较佳的,所述策略管理单元确定所述全量备份时间点,包括: [0013] Preferably, the policy management unit determines the full backup point in time, comprising:

[0014] 所述策略管理单元根据预设的数据库组中的各个数据库的全量备份时间间隔,或根据数据库组中的数据库个数,或者每个数据库的存储空间大小,或者数据库的修改频率, 确定数据库组中的各个数据库的全量备份时间点。 [0014] The policy management unit according to a preset time full backup database of each group interval database, database or databases according to the modified number of frequency groups, or the size of each storage space of the database, or databases, to determine the full amount of each database group database backup point in time.

[0015] 较佳的,所述策略管理单元确定所述全量备份时间点,包括: [0015] Preferably, the policy management unit determines the full backup point in time, comprising:

[0016] 所述策略管理单元根据所述数据库组中的数据库的备份时间间隔,计算各个备份时间点拟启动全量备份的数据库的个数,如果数据库个数大于预设的阔值,则将数据库存储空间最大的数据库的全量备份时间点开始时间向前或向后移动到第二时间起点。 [0016] The policy management unit according to the backup database the database group interval calculated for each backup start time point the number of quasi full backup of a database, the database if the number is larger than a preset width value, the database the maximum amount of storage space a full database backup time start time forward or backward to the starting point for the second time.

[0017] 较佳的,所述方法还包括: [0017] Preferably, the method further comprising:

[0018] 对所述记录数据进行增量备份。 [0018] incremental backup of the data record.

[0019] 较佳的,所述对所述记录数据进行增量备份,包括: [0019] Preferably, the incremental backup of the recording data, comprising:

[0020] 对所述记录数据实时进行增量备份; [0020] The recording of data in real time incremental backup;

[0021] 或 [0021] or

[0022] 在预先设置的增量备份时间点,对所述记录数据进行增量备份。 [0022] In the incremental backup time point set in advance, the incremental backup data recording.

[0023] 较佳的,所述方法还包括: [0023] Preferably, the method further comprising:

[0024] 将当前最后一次全量备份之前的增量备份数据删除。 [0024] The incremental backup data prior to the last full backup of the current deletion.

[00巧]较佳的,所述将当前最后一次全量备份之前的增量备份数据删除,包括: [Qiao 00] Preferably, the incremental backup data before the last full backup to delete the current, comprising:

[0026] 完成第η次全量备份后,将第η次全量备份与第n-1次全量备份之间的增量备份数据删除,其中,n= 2、3、4……。 [0026] After the completion of the first full backup η times the incremental backup data between the first full backup η times n-1 and the first full backup times deleted, where, n = 2,3,4 .......

[0027] 为达到上述目的,本发明实施例公开了一种数据库恢复方法,包括: [0027] To achieve the above object, embodiments of the present invention discloses a database recovery method, comprising:

[0028] 接收数据库恢复指令,确定待恢复数据库的恢复目标时间点T0,所述数据库恢复指令中包括待恢复数据库的标识; [0028] The instruction receiving database recovery, the recovery is determined to be a point in time recovery database T0, to restore the database to be recovered identifier included in the instruction database;

[0029] 获取所述恢复目标时间点TO之前的、待恢复数据库最近一次全量备份时间T1的全量备份数据; [0029] obtaining the recovery before a point in time TO to be a full database restore the most recent backup amount of time T1 is the total amount of backup data;

[0030] 根据所述全量备份数据W及TO至T1之间的记录数据,对待恢复数据库进行数据恢复。 [0030] According to the full backup data and the recording data W between the TO to T1, data recovery treatment to recover the database.

[0031] 较佳的,所述根据所述全量备份数据W及TO至T1之间的记录数据,对待恢复数据库进行数据恢复,包括: [0031] Preferably, the recording data between the full backup data W and the TO to Tl, treated to restore the database to data recovery, comprising:

[0032] 利用待恢复数据库最近一次全量备份时间T1的全量备份数据,将待恢复数据库恢复到T1时刻状态; [0032] The use of a database to be restored full backup time T1 full backup data most recently, to restore the database to be restored to the status at time T1;

[0033] 利用TO至T1之间的记录数据,将待恢复数据库恢复到TO时刻状态。 [0033] With the recording data between the TO to T1, restore the database to be restored to the state of the time point TO.

[0034] 为达到上述目的,本发明实施例公开了一种数据库备份装置,包括:全量备份模块、记录数据生成模块,其中, [0034] To achieve the above object, the present invention discloses embodiments of a database backup device, comprising: a full backup module, the recording data generation module, wherein

[0035] 所述全量备份模块,用于根据数据库组中的各个数据库的全量备份时间点,分别对每个数据库在其全量备份时间点进行全量备份; [0035] The full backup module for full backup time point each database group database, separately for each full backup database at the time point of its full backup;

[0036] 所述记录数据生成模块,在对任一数据库相邻两次全量备份时间之间,记录对该数据库的修改,生成记录数据。 [0036] The recording data generating module, between two full backup time adjacent either database, modifications to the database record, generates a recording data.

[0037] 较佳的,所述数据库组,包括: [0037] Preferably, the database group, comprising:

[0038] 在多租户环境下,分别为每位租户配置的一个独立于其他租户存在的数据库的集合。 [0038] In the multi-tenant environment, it is a set of independent existence of other tenants per tenant database configuration.

[0039] 较佳的,所述数据库组中的各个数据库的全量备份时间点是预先设置的; [0039] Preferably, the total amount of time the database backup point group of each database is set in advance;

[0040] 或所述全量备份时间点,是由策略管理单元确定的。 [0040] or the full backup point in time, is determined by the policy management unit.

[0041] 较佳的,所述策略管理单元确定所述全量备份时间点,包括: [0041] Preferably, the policy management unit determines the full backup point in time, comprising:

[0042] 所述策略管理单元根据预设的数据库组中的各个数据库的全量备份时间间隔,或根据数据库组中的数据库个数,或者每个数据库的存储空间大小,或者数据库的修改频率, 确定数据库组中的各个数据库的全量备份时间点。 [0042] The policy management unit according to a preset time full backup database of each group interval database, database or databases according to the modified number of frequency groups, or the size of each storage space of the database, or databases, to determine the full amount of each database group database backup point in time.

[0043] 较佳的,所述策略管理单元,确定所述全量备份时间点,包括: [0043] Preferably, the policy management unit, determines the full backup point in time, comprising:

[0044] 所述策略管理单元根据所述数据库组中的数据库的备份时间间隔,计算各个备份时间点拟启动全量备份的数据库的个数,如果数据库个数大于预设的阔值,则将数据库存储空间最大的数据库的全量备份时间点开始时间向前或向后移动到第二时间起点。 [0044] The policy management unit according to the backup database the database group interval calculated for each backup start time point the number of quasi full backup of a database, the database if the number is larger than a preset width value, the database the maximum amount of storage space a full database backup time start time forward or backward to the starting point for the second time.

[0045] 较佳的,所述装置还包括;增量备份模块,其中, [0045] Preferably, the apparatus further comprises; incremental backup module, wherein

[0046] 所述增量备份模块,用于对所述记录数据进行增量备份。 [0046] The incremental backup module, for recording the incremental backup data.

[0047] 较佳的,所述增量备份模块,具体用于: [0047] Preferably, the incremental backup module is configured to:

[0048] 对所述记录数据实时进行增量备份; [0048] The recording of data in real time incremental backup;

[0049]或 [0049] or

[0050] 在预先设置的增量备份时间点,对所述记录数据进行增量备份。 [0050] In the incremental backup time point set in advance, the incremental backup data recording.

[0051] 较佳的,所述装置还包括;删除模块,其中, [0051] Preferably, the apparatus further comprises; deleting module, wherein

[0052] 所述删除模块,用于将当前最后一次全量备份之前的增量备份数据删除。 [0052] The deleting module configured before backup data from the last full backup current deleted.

[0053] 较佳的,所述删除模块,具体用于: [0053] Preferably, the deleting module, configured to:

[0054] 完成第η次全量备份后,将第η次全量备份与第n-1次全量备份之间的增量备份数据删除,其中,η= 2、3、4……。 [0054] [eta] After the completion of the secondary full backup, incremental backup data between the first full backup times [eta] n-1 of the first full backup delete times, wherein, η = 2,3,4 .......

[00巧]为达到上述目的,本发明实施例公开了一种数据库恢复装置,包括:确定模块、全量备份获取模块和恢复模块,其中, [Qiao 00] To achieve the above object, the present invention discloses embodiments of a database recovery apparatus, comprising: a determining module, full backup acquisition module and a restoration module, wherein

[0056] 所述确定模块,用于接收数据库恢复指令,确定待恢复数据库的恢复目标时间点Τ0,所述数据库恢复指令中包括待恢复数据库的标识; [0056] The determining module, configured to receive a command database recovery, the recovery is determined to be a point in time recovery Τ0 database, the database recovery command includes identification of the database to be recovered;

[0057] 所述全量备份获取模块,用于获取所述恢复目标时间点TO之前的、待恢复数据库最近一次全量备份时间T1的全量备份数据; [0057] The full backup acquisition module configured to obtain the recovery target before the TO time point, the amount of a full database backup time T1 is full backup data to be restored recently;

[0058] 所述恢复模块,用于根据所述全量备份数据W及TO至T1之间的记录数据,对待恢复数据库进行数据恢复。 [0058] The recovery module according to the full backup data and the recording data W between the TO to Tl, data recovery treatment to recover the database.

[0059] 较佳的,所述恢复模块,具体用于: [0059] Preferably, the recovery module is configured to:

[0060] 利用待恢复数据库最近一次全量备份时间T1的全量备份数据,将待恢复数据库恢复到T1时刻状态; [0060] The use of a database to be restored full backup time T1 full backup data most recently, to restore the database to be restored to the status at time T1;

[0061] 利用TO至T1之间的记录数据,将待恢复数据库恢复到TO时刻状态。 [0061] With the recording data between the TO to T1, restore the database to be restored to the state of the time point TO.

[0062] 为达到上述目的,本发明实施例公开了一种数据库备份恢复系统,包括:上述数据库备份装置的任意一种W及上述数据库恢复装置的任意一种。 [0062] To achieve the above object, the disclosed embodiments recovery system of the present invention, database backup, comprising: any one of said database backup unit W and any one of said database recovery apparatus.

[0063] 为达到上述目的,本发明实施例公开了一种数据库备份恢复系统,包括:全量备份模块、记录数据生成模块、确定模块、全量备份获取模块和恢复模块, [0063] To achieve the above object, embodiments of the present invention discloses a database backup and recovery system, comprising: a full backup module, a recording data generating module, a determination module, a full backup acquisition module and a restoration module,

[0064] 所述全量备份模块,用于根据数据库的全量备份时间点,对数据库在其每个全量备份时间点进行全量备份; [0064] The full backup module for full backup time point database, the database full backup full backup at each time point;

[0065] 所述记录数据生成模块,用于在对数据库相邻两次全量备份的时间之间,或者全程记录对该数据库的修改,生成记录数据; [0065] The recording data generation means for the time between two adjacent full backup database, or modifications to the whole record database, generates a recording data;

[0066]所述确定模块,用于接收数据库恢复指令,确定待恢复数据库的恢复目标时间占. ;、、、 » [0066] The determining module, configured to receive an instruction to restore the database to determine the target time to be recovered accounting database recovery;. ,,, »

[0067] 所述全量备份获取模块,用于获取所述恢复目标时间点之前的、待恢复数据库最近一次全量备份时间的全量备份数据; [0067] The full backup acquisition module for full backup data before acquiring the point in time recovery target, a database to be restored latest full backup time;

[0068] 所述恢复模块,用于获取所述全量备份数据W及恢复目标时间点至所述恢复目标时间点之前的、待恢复数据库最近一次全量备份的时间之间的记录数据,根据该记录数据对待恢复数据库进行数据恢复。 [0068] The recovery module, configured to obtain a full backup target data W and the recovery time to restore to the data recorded between the time point before the target time, the restored database the last full backup, according to which the recording data treat restore the database for data recovery.

[0069] 为达到上述目的,本发明实施例公开了一种数据库备份恢复系统,包括:全量备份模块、记录数据生成模块、确定模块、全量备份获取模块和恢复模块, [0069] To achieve the above object, embodiments of the present invention discloses a database backup and recovery system, comprising: a full backup module, a recording data generating module, a determination module, a full backup acquisition module and a restoration module,

[0070] 所述全量备份模块,用于根据数据库组中的各个数据库的全量备份时间点,分别对每个数据库在其全量备份时间点进行全量备份; [0070] The full backup module for full backup time point each database group database, separately for each full backup database at the time point of its full backup;

[0071] 所述记录数据生成模块,用于在对任一数据库相邻两次全量备份的时间之间,记录对该数据库的修改,生成记录数据; [0071] The recording data generation module configured for any time between two adjacent full backup database is recorded modifications to the database, generates a recording data;

[0072] 所述确定模块,用于接收数据库恢复指令,确定待恢复数据库的恢复目标时间点T0,所述数据库恢复指令中包括待恢复数据库的标识; [0072] The determining module, configured to receive a command database recovery, the recovery is determined to be a point in time T0 recovery of a database, the database recovery command includes identification of the database to be recovered;

[0073] 所述全量备份获取模块,用于获取所述恢复目标时间点TO之前的、待恢复数据库最近一次全量备份时间T1的全量备份数据; [0073] The full backup acquisition module configured to obtain the recovery target before the TO time point, the amount of a full database backup time T1 is full backup data to be restored recently;

[0074] 所述恢复模块,用于根据所述全量备份数据W及TO至T1之间的记录数据,对待恢复数据库进行数据恢复。 [0074] The recovery module according to the full backup data and the recording data W between the TO to Tl, data recovery treatment to recover the database.

[0075] 由上述的技术方案可见,本发明实施例提供了一种数据库备份、恢复方法、装置及系统,根据数据库组中的各个数据库的全量备份时间点,分别对每个数据库在其全量备份时间点进行全量备份;在对任一数据库相邻两次全量备份时间之间,记录对该数据库的修改,生成记录数据。 [0075] seen from the above technical solution, the present invention provides a database backup, recovery method, apparatus and system according to the full backup time point database group in each database, respectively, for each database in its full backup full backup point in time; between the database for any time between two adjacent full backup, modifications to the database record, generates a recording data. 在数据库出现问题时,对数据库使用数据库恢复目标时间点之前的最近一次数据库全量备份数据和该次数据库全量备份至数据库恢复目标时间点的记录数据对数据库进行恢复,避免了在数据库恢复时,只使用数据库恢复目标时间点之前的最近一次数据库全量备份数据对数据库进行恢复,数据库恢复目标时间点至数据库恢复目标时间点之前的最近一次数据库全量备份时间点之间数据的丢失。 Last database full backup of data and the sub-database full backup to restore the database target point in time before the database problem, the recovery target point in time the database using the database record data to restore the database to avoid during database recovery, only the last full backup data database restore the database before the recovery target point in time using the database, the database restore lost data to a point in time between the last full backup database point in time before the database recovery target point in time.

附图说明 BRIEF DESCRIPTION

[0076] 为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可W 根据送些附图获得其他的附图。 [0076] In order to more clearly illustrate the technical solutions in the embodiments or the prior art embodiment of the present invention, briefly introduced hereinafter, embodiments are described below in the accompanying drawings or described in the prior art needed to be used in describing the embodiments the drawings are only some embodiments of the present invention, those of ordinary skill in the art is concerned, without any creative effort, according to take some further W drawings other drawings.

[0077] 图1为本发明实施例提供的一种数据库备份方法的流程示意图; [0077] FIG. 1 is a schematic flow of one kind of database backup method according to an embodiment of the present invention;

[0078]图2为本发明实施例提供的另一种数据库备份方法的流程示意图; [0078] FIG. 2 is a schematic of another database backup process according to an embodiment of the method of the present invention;

[0079] 图3为本发明实施例提供的再一种数据库备份方法的流程示意图; [0079] FIG. 3 is a schematic flow database backup still another method according to an embodiment of the present invention;

[0080]图4为本发明实施例提供的一种数据库恢复方法的流程示意图; [0080] FIG 4 flow diagram of a database provided in the recovery method embodiment of the invention;

[0081] 图5为本发明实施例提供的一种数据库备份装置的结构示意图; [0081] FIG. 5 is a schematic structure of a database backup apparatus according to an embodiment of the present invention;

[0082] 图6为本发明实施例提供的另一种数据库备份装置的结构示意图; [0082] FIG. 6 is a schematic structural diagram of another database backup apparatus according to an embodiment of the present invention;

[0083]图7为本发明实施例提供的再一种数据库备份装置的结构示意图; [0083] FIG 7 provides a schematic structural diagram of still another embodiment of the database backup apparatus embodiment of the invention;

[0084] 图8为本发明实施例提供的一种数据库恢复装置的结构示意图。 [0084] FIG. 8 provides structural diagram of a database recovery apparatus embodiment of the invention.

具体实施方式 Detailed ways

[0085]本发明实施例提供了一种数据库备份恢复系统,该系统包括;全量备份模块、记录数据生成模块、确定模块、全量备份获取模块和恢复模块,其中, [0085] The embodiments of the present invention provides a database backup and recovery system, the system comprising; full backup module, a recording data generating module, a determination module, a full backup acquisition module and a restoration module, wherein

[0086] 全量备份模块,用于根据数据库的全量备份时间点,对数据库在其每个全量备份时间点进行全量备份; [0086] full backup module for full backup time point database, the database full backup full backup at each time point;

[0087] 记录数据生成模块,用于在对数据库相邻两次全量备份的时间点之间,或者全程记录对该数据库的修改,生成记录数据; [0087] The recording data generation means for time points between two adjacent full backup database, or to modify the whole record to the database, and generating recording data;

[0088]确定模块,用于接收数据库恢复指令,确定待恢复数据库的恢复目标时间点; [0088] The determining module, configured to receive an instruction to restore the database to determine the target point in time to be recovered to restore the database;

[0089] 全量备份获取模块,用于获取所述恢复目标时间点之前的、待恢复数据库最近一次全量备份时间的全量备份数据; [0089] The full backup acquisition module for acquiring target point before the recovery time, a full backup data in the database of the latest full backup time to be restored;

[0090] 恢复模块,用于获取所述全量备份数据W及恢复目标时间点至所述恢复目标时间点之前的、待恢复数据库最近一次全量备份的时间之间的记录数据,根据该记录数据对待恢复数据库进行数据恢复。 [0090] recovery module, configured to obtain a full backup target data W and the recovery time to restore to the data recorded between the time point before the target time, the database be restored to the last full backup, the record data is treated in accordance with restore the database for data recovery.

[0091] 本发明实施例提供了一种数据库备份恢复系统,该系统包括;全量备份模块、记录数据生成模块、确定模块、全量备份获取模块和恢复模块,其中, [0091] The embodiments of the present invention provides a database backup and recovery system, the system comprising; full backup module, a recording data generating module, a determination module, a full backup acquisition module and a restoration module, wherein

[0092] 全量备份模块,用于根据数据库组中的各个数据库的全量备份时间点,分别对每个数据库在其全量备份时间点进行全量备份; [0092] full backup module for full backup time point each database group database, separately for each full backup database at the time point of its full backup;

[0093] 记录数据生成模块,用于在对任一数据库相邻两次全量备份的时间之间,记录对该数据库的修改,生成记录数据; [0093] The recording data generation module configured for any time between two adjacent full backup database is recorded modifications to the database, generates a recording data;

[0094]确定模块,用于接收数据库恢复指令,确定待恢复数据库的恢复目标时间点T0,所述数据库恢复指令中包括待恢复数据库的标识; [0094] The determining module, configured to receive a command database recovery, the recovery is determined to be a point in time T0 recovery of a database, the database recovery command includes identification of the database to be recovered;

[0095] 全量备份获取模块,用于获取所述恢复目标时间点TO之前的、待恢复数据库最近一次全量备份时间T1的全量备份数据; [0095] The full backup acquisition module for acquiring the recovery target before the TO time point, the amount to be a full database restore the most recent backup of time T1 is the total amount of backup data;

[0096] 恢复模块,用于根据所述全量备份数据W及TO至T1之间的记录数据,对待恢复数据库进行数据恢复。 [0096] Recovery module for the full backup data and the recording data W between the TO to Tl, data recovery treatment to recover the database.

[0097] 本发明实施例提供了一种数据库备份、恢复方法、装置及系统,其中, Embodiment [0097] The present invention provides a database backup, recovery method, apparatus and system, wherein,

[0098] 数据库备份方法包括:根据数据库的全量备份时间点,对数据库在其每个全量备份时间点进行全量备份;在对数据库相邻两次全量备份的时间点之间,或者全程记录对该数据库的修改,生成记录数据。 [0098] database backup method comprising: the full backup time point database, the database full backup full backup at each point in time; between the two adjacent points on database full backup, or the whole record modify the database to generate recording data.

[0099] 数据库恢复方法包括;接收数据库恢复指令,确定待恢复数据库的恢复目标时间点;获取所述恢复目标时间点之前的、待恢复数据库最近一次全量备份时间的全量备份数据;获取所述全量备份数据W及恢复目标时间点至所述恢复目标时间点之前的、待恢复数据库最近一次全量备份的时间之间的记录数据,根据该记录数据对待恢复数据库进行数据恢复。 [0099] database recovery method comprising; receiving a database recovery command, determining the recovery target point in time to be restored database; obtaining, the restored database last full backup data full backup time before the recovery target point in time; acquiring the total amount W before the backup and recovery of data to a point in time of the recovery target point in time, the recorded data to be restored between the time the database of the last full backup, database restore data recovery treatment in accordance with the recording data.

[0100] 本发明实施例提供了一种数据库备份、恢复方法、装置及系统,其中, [0100] The present invention provides a database backup, recovery method, apparatus and system, wherein,

[0101] 数据库备份方法包括;根据数据库组中的各个数据库的全量备份时间点,分别对每个数据库在其全量备份时间点进行全量备份;在对任一数据库相邻两次全量备份的时间之间,记录对该数据库的修改,生成记录数据。 [0101] database backup method comprising; The full backup time point database group in each database, respectively, for each database full backup in its full backup point in time; the time of any database between two adjacent full backup of the Room recorded modifications to the database, to generate recording data.

[0102] 数据库恢复方法包括;接收数据库恢复指令,确定待恢复数据库的恢复目标时间点T0,所述数据库恢复指令中包括待恢复数据库的标识;获取所述恢复目标时间点TO之前的、待恢复数据库最近一次全量备份时间T1的全量备份数据;根据所述全量备份数据W及TO至T1之间的记录数据,对待恢复数据库进行数据恢复。 [0102] database recovery method comprising; receiving a command database recovery, the recovery target time point T0 is determined to be restored database, the database recovery instruction includes an identifier of the database to be restored; obtaining the recovery before a point in time TO, to be restored database last full backup time T1 full backup data; based on the total amount of backup data and the recording data W between the tO to T1, data recovery treatment to recover the database.

[0103] 其中,全量备份是指在对数据库组中的某个数据库进行完全的备份。 [0103] wherein, in the full backup of the database refers to a group of full database backup. 记录数据可W是事务日志。 Recorded data can be W is a transaction log. 在实际应用中,对数据库的修改,进行记录可W采用数据库的事务日志,所谓的事务日志是一个与数据库文件分开的文件,它是用来记录数据库的更新情况的文件, 它可W记录针对数据库的任何操作,并将记录的结果保存到独立的文件中。 In practice, the changes to the database, W can be recorded using the transaction log database, called the transaction log is a separate database file, which is used to document updates the records in the database, which can record for W any operation of the database, save and record the results to a separate file.

[0104] 在数据库出现问题时,对数据库使用数据库恢复目标时间点之前的最近一次数据库全量备份数据和该次数据库全量备份至数据库恢复目标时间点的记录数据对数据库进行恢复,避免了在数据库恢复时,只使用数据库恢复目标时间点之前的最近一次数据库全量备份数据对数据库进行恢复,数据库恢复目标时间点至数据库恢复目标时间点之前的最近一次数据库全量备份时间点之间数据的丢失。 Last database full backup of data and the sub-database full backup to restore the database target point in time before [0104] in the database problem, the recovery target point in time the database using the database record data to restore the database to avoid the recovery database the last full backup data database restore the database before, the only database recovery target point in time, a point in time database restore lost data to the database between the last full backup point database recovery time before the target point in time.

[0105] 下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。 [0105] below in conjunction with the present invention in the accompanying drawings, technical solutions of embodiments of the present invention are clearly and completely described, obviously, the described embodiments are merely part of embodiments of the present invention, but not all embodiments example. 基于本发明中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。 Based on the embodiments of the present invention, those of ordinary skill in the art to make all other embodiments without creative work obtained by, it falls within the scope of the present invention.

[0106] 下面通过具体实施例,对本发明进行详细说明。 [0106] The following specific embodiments of the present invention will be described in detail.

[0107] 图1为本发明实施例提供的一种数据库备份方法的流程示意图,可W包括: Schematic flow chart of [0107] FIG 1. A database backup method according to an embodiment of the present invention, W comprises:

[0108]S101 ;根据数据库组中的各个数据库的全量备份时间点,分别对每个数据库在其全量备份时间点进行全量备份; [0108] S101; The total amount of each database group database backup time points, respectively, for each full backup database at the time point of its full backup;

[0109] 其中,数据库组中的各个数据库的全量备份时间点可W为预先设置的。 [0109] wherein the full backup time point for each database in the database group may be W is set in advance.

[0110] 具体地,数据库组为在多租户的环境下,分别为每位租户配置的一个独立于其他租户存在的数据库的集合; [0110] In particular, the database group in multi-tenant environment, are a set of independent existence of other tenants per tenant database configuration;

[0111] 示例性的,在本发明实施例中,假设数据库组包括:名称为小区物业管理系统的数据库、名称为X超市商品的数据库和名称为Y公司的人力资源管理数据库。 [0111] exemplary embodiment of the present invention, assume that the database includes: name of the Property Management System database, the database name and the name of the supermarket product X is Y company's human resources management database.

[0112] 下面W数据库的名称为小区物业管理系统为例进行说明, [0112] The following database name W to residential property management system as an example,

[0113] 假设对小区物业管理系统数据库预先设置的全量备份时间点为;每天的0:00、 6:00、12:00和18:00,即每天4次全量备份数据库小区物业管理系统,每次全量备份间隔6 小时。 [0113] full backup time point is assumed to Property Management System database is set in advance; daily 0:00, 6: 00,12: 00 and 18:00, i.e. 4 times daily full backup Property Management System database, each second full backup interval of 6 hours.

[0114] 该小区物业管理系统数据库中存在7个表,分别为:表1A、表1B、表1C、表1D、表1E、表1F和表1G。 [0114] Table 7 present the Property Management System database, respectively: Tables 1A, Tables 1B, 1C, 1D table, Table 1E, 1F, and tables Table 1G.

[0115] 其中,表1A中记录物业公司ID号、名称、地址、联系电话和成立时间; [0115] where Table 1A record property company ID number, name, address, telephone number and set up time;

[0116] 表1B中记录业主ID号、姓名、入住时间、房间号、楼号和小区ID号; [0116] Table 1B record owner ID number, name, arrival time, room number, floor number, and a cell ID;

[0117] 表1C中记录物业公司员工ID号、姓名、负责的项目、负责小区ID号、家庭住址和联系电话; [0117] Table 1C records property company employee ID number, name, responsible for the project, responsible for the cell ID number, home address and telephone number;

[011引表1D中记录小区ID号、小区名、负责人、建成日期和小区位直; [011引表1E中记录用户ID号、姓名、密码、用户名和权限; [011 cited in Table 1D record a cell ID number, district, responsible person, date of completion and the cell bit straight; [011 records cited in Table 1E user ID number, name, passwords, user names and permissions;

[0120] 表1F中记录楼号、小区ID号、层数和建成时间; [0120] Table F recorded 1F, a cell ID, the number of layers and the completion time;

[0121] 表1G中记录房间号、楼号、小区ID号、是否入住和用户ID。 [0121] Table 1G recording room number, floor number, cell ID number, and check whether the user ID.

[0122] 假设某天6:00该小区物业管理系统数据库的状态如下: [0122] Suppose the day 6:00 Property Management System database states are as follows:

[0123] 表1A [0123] TABLE 1A

[0124] [0124]

Figure CN105446828AD00111

Figure CN105446828AD00121

[0137] [0137]

[013引将该状态下的小区物业管理系统数据库进行一次全量备份,生成6:00该小区物业管理系统数据库的全量备份数据。 Property Management System database under [013 lead the first full backup state, generating a full backup of the data 6:00 Property Management System database.

[0139] 数据库组中的各个数据库的全量备份时间点也可W是;由预先设置一个策略管理单元确定的。 [0139] full backup time point each database in the database group may be W is; determined by a preset policy management unit.

[0140] 具体的,预先设置一个策略管理单元,策略管理单元根据预设的数据库组中的各个数据库的全量备份时间间隔,或根据数据库组中的数据库个数,或者每个数据库的存储空间大小,或者数据库的修改频率,确定数据库组中的各个数据库的全量备份时间点。 [0140] Specifically, a policy management unit set in advance, a policy management unit according to a preset time full backup database of each group interval database, or a database according to the number of database storage space group, or the size of each database , frequency or modify the database to determine the full backup time point each database group database. 策略管理单元还可W根据所述数据库组中的数据库的备份时间间隔,计算各个备份时间点拟启动全量备份的数据库的个数,如果数据库个数大于预设的阔值,则将数据库存储空间最大的数据库的全量备份时间点开始时间向前或向后移动到第二时间起点。 The policy management unit may further W in the database backup time group database interval calculated for each backup start time point the number of quasi full backup of a database, the database if the number is larger than a preset width value, the database storage space full largest database backup time start time forward or backward to the starting point for the second time.

[0141] 具体的,在多租户环境下,为每位租户配置的一个独立于其他租户存在的数据库。 [0141] Specifically, in a multi-tenant environment, configured for a tenant each independently of the other existing tenant database. 对于至少一个或者多个数据库进行备份时,尽量将不同的数据库的全量备份时间间隔开来,而不是在同一个时间同时进行备份。 When a backup for at least one or more databases, as far as possible the full backup of the database at different times spaced apart, rather than backed up while at the same time.

[0142] 具体地,我们可W从创建数据库的时间起,设置为每隔固定的一个时间段对该数据库进行全量备份。 [0142] In particular, we W from the database was created, is set to a fixed full backup of the database for every period of time. 由于多租户环境下,为每个租户创建数据库的时间是不固定的,因此各个数据库的全量备份时间点,通常是间隔开的。 Since the multi-tenant environments, the database was created for each tenant is not fixed, so full backup of the database each time point, usually spaced. 但是也会出现,某个时间点全量备份的数据库过多给备份服务器带来压力的情况出现,因此设置一个策略管理单元,为整个备份服务器的数据库群的全量备份时间点进行管理,使得每个租户的备份时间点不同,全量备份的时间点得W均衡分配。 But there will be, much to the backup database server some point in time full backup of the situation to bring pressure occurs, thus setting a policy management unit to manage full backup point in time the entire backup database server group so that each different backup time tenants, the amount of time a full backup point was W balanced distribution.

[0143] 具体地,策略管理单元确定每个数据库的全量备份时间点为;根据预设的各个数据库的全量备份时间间隔,根据数据库的个数,数据库的修改频率,数据库存储空间的大小等因素确定。 [0143] In particular, the policy management unit determines the time point for each full backup of the database; full backup according to a preset time interval of each database, the database according to the number of modified frequency database, the size of the database storage space factors determine.

[0144] 具体地,各个数据库的全量备份时间间隔,是可W有用户或者本系统进行人工或自动计算设置的。 [0144] Specifically, the total amount of each database backup interval, W is the system users manual or automatic calculation or setting.

[0145] 具体地,策略管理单元根据所有的数据库的备份时间间隔计算各个备份时间点有多少个数据库将要启动全量备份,如果数据库个数大于预设的阔值,则将数据库存储空间最大的数据库的全量备份时间点开始时间向前或向后移动到第二时间起点。 [0145] In particular, the policy management unit time interval is calculated according to the backup all databases each time point the number of backup database full backup will be started, if the number is greater than a preset width value of a database, the database will be the largest database storage space the full amount of backup time point start time forward or backward to the starting point for the second time. 例如,多租户环境下,一共创建有3个数据库,数据库1的全量备份时间间隔是3小时,存储空间是5G; 数据库2的全量备份时间间隔是2小时,存储空间是6G;数据库3的全量备份时间间隔是1小时,存储空间是7G。 For example, the multi-tenant environment, total created there are three databases, full backup time database 1 interval of 3 hours, storage space. 5G; full backup time database 2 interval of 2 hours, storage space. 6G; database total amount 3 backup interval is 1 hour, the storage space is 7G. 假设3个数据库的第一时间起点拟分别设置在1点、2点、3点钟的时候进行全量备份,策略管理单元计算得到,在4点钟的时候将要有3个数据库同时开始全量备份,如果预设的阔值是2, 3大于预设的阔值2,于是策略管理单元将存储空间为7G的最大数据库3的第一时间起点向后延迟半小时。 Suppose first three databases are provided at the intended starting time 1:00, 2:00, 3 o'clock for full backup, the policy management unit is calculated, the database must be started simultaneously 3 full backup at 4 o'clock, If the predetermined width is 2, 3 is greater than the predetermined width value 2, then the policy management unit 7G database storage for the maximum starting a first time delay back 3 and a half hours.

[0146]S102 ;在对任一数据库相邻两次全量备份时间之间,记录对该数据库的修改,生成记录数据。 [0146] S102; between two full backup time adjacent either database, modifications to the database record, generates a recording data.

[0147] 示例性的,对上述小区物业管理系统数据库进行的修改,可W采用基于数据前后变化的方式进行记录,如表2所示: [0147] Exemplary modifications to the above Property Management System database can be employed W before and after the data record based on the change mode, as shown in Table 2:

[014引表2[0149] [Table 2 Primer 014 [0149]

Figure CN105446828AD00131

Figure CN105446828AD00141

[0150] [0150]

[0151] 对小区物业管理系统数据库进行的修改,还可W采用基于语句的方式进行记录, [0151] The Property Management System database modifications, W may also be recorded based approach using the statement,

[015引8:10,update'表1B'setRoom='301'where化ame='张H'; [015 Primer 8: 10, update 'table 1B'setRoom =' 301'where of ame = 'Double H';

[015引update'表1G'setYN='Ν'andTid="whereRoom='101'ANDLouyu='1'; [015 primer update 'table 1G'setYN =' Ν'andTid = "whereRoom = '101'ANDLouyu =' 1 ';

[0154] update'表IG'setYN='Y'andTid='1'whereRoom='301'ANDLouyu 二,1,; [0154] update 'table IG'setYN =' Y'andTid = '1'whereRoom =' 301'ANDLouyu two, 1 ,;

[0155] 9:20,inse;rtinto'表lA'values(' 3','恒诚物业','北京朝阳,,'85514520,,'2004-5-6,); [0155] 9: 20, inse; rtinto 'table lA'values ​​(' 3 ',' property Hengcheng ',' Beijing Chaoyang ,, ',, 85514520' 2004-5-6,);

[015引12:25,deletefrom'表1C'whereWname='王五'; [015 Primer 12: 25, deletefrom 'table 1C'whereWname =' Wang Wu ';

[0157] 在实际应用中,对数据库的修改,进行记录可W采用数据库的事务日志,所谓的事务日志是一个与数据库文件分开的文件,它是用来记录数据库的更新情况的文件,它可W记录针对数据库的任何操作,并将记录的结果保存到独立的文件中。 [0157] In practice, changes to the database, W can be employed to record the transaction log database, a so-called transaction log is a separate database file, which is used to record the file updates the database, it can be W save record any action against the database, and record the results to a separate file.

[015引需要说明的是,本申请中并不对数据库的修改,进行记录的方式做限定,任何可能的实现方式都可W应用于本申请中。 [015 cited Incidentally, the present application does not modify the database, defined way to do recording, any possible implementation of W can be applied in the present application.

[0159] 需要说明的是,上述W数据库的名称为小区物业管理系统为例进行说明,仅为一具体实例,并不够成对本申请的限定。 [0159] Incidentally, the name of the database is a cell W above property management system as an example, a specific example only, and not limiting of the disclosure in pairs.

[0160] 应用本发明图1所示实施例,根据数据库组中的各个数据库的全量备份时间点, 分别对每个数据库在其全量备份时间点进行全量备份;在对任一数据库相邻两次全量备份时间之间,记录对该数据库的修改,生成记录数据。 [0160] Application of the present invention is shown in FIG. 1 embodiment, the time point according full backup database the database for each group, respectively, for each database in its full backup full backup time point; for any two adjacent database time between full backup, modifications to the database record, generates a recording data. 在数据库出现问题时,对数据库使用数据库恢复目标时间点之前的最近一次数据库全量备份数据和该次数据库全量备份至数据库恢复目标时间点的记录数据对数据库进行恢复,避免了在数据库恢复时,只使用数据库恢复目标时间点之前的最近一次数据库全量备份数据对数据库进行恢复,数据库恢复目标时间点至数据库恢复目标时间点之前的最近一次数据库全量备份时间点之间数据的丢失。 Last database full backup of data and the sub-database full backup to restore the database target point in time before the database problem, the recovery target point in time the database using the database record data to restore the database to avoid during database recovery, only the last full backup data database restore the database before the recovery target point in time using the database, the database restore lost data to a point in time between the last full backup database point in time before the database recovery target point in time.

[0161]图2为本发明实施例提供的另一种数据库备份方法的流程示意图,本发明图2所示实施例在图1所示实施例的基础上,增加S103;对所述记录数据进行增量备份。 [0161] FIG. 2 is another schematic flow chart of the database backup method according to an embodiment the invention, the present invention is shown in FIG Example 2 based on the embodiment shown in FIG. 1, the increase in S103; the recorded data incremental backups.

[0162] 其中,增量备份是指每次只备份上一次备份后修改过的数据,可W对所述记录数据实时进行增量备份。 [0162] wherein, incremental backup is modified each time the last backup is only backup data, the recording data W can be performed in real time incremental backup.

[0163] 考虑到在实际应用中,对记录数据实时进行增量备份,占用系统资源,为了节省系统资源的占用,可W预先设置增量备份时间点,对记录数据在预先设置的增量备份时间点进行增量备份。 [0163] In consideration of practical use, the recording data in real time incremental backup, system resources, in order to save system resources, and W can be pre-set point in time the incremental backup, the incremental backup data is recorded is set in advance time incremental backups.

[0164] 假设预先设置的增量备份时间点为:每天的2:00、4:00、8:00、9:00、10:00、 14:00、16:00、20:00 和22:00, [0164] Suppose the incremental backup time point set in advance as follows: day 2: 00,4: 00,8: 00,9: 00,10: 00, 14: 00,16: 00,20: 00 and 22: 00,

[0165] 则对上述小区物业管理系统数据库进行的修改,记录数据进行的增量备份分别为: [0165] modifications to the above Property Management System database, the incremental backup data recorded were:

[0166] 在8:00进行第一次增量备份,对小区物业管理系统数据库6:00-8:00的修改,生成的记录数据进行增量备份, [0166] In an incremental backup for the first 8:00, for Property Management System database 6: incremental backup data recorded 00 modify, generated: 00-8

[0167] 在9:00进行第二次增量备份,对小区物业管理系统数据库8:00-9:00的修改,生成的记录数据进行增量备份, [0167] In a second incremental backup 9:00, for Property Management System database 8: incremental backup data recorded 00 modify, generated: 00-9

[0168] 在10:00进行第Η次增量备份,对小区物业管理系统数据库9:00-10:00的修改, 生成的记录数据进行增量备份, [0168] Η at 10:00 for the first incremental backup, a Property Management System database 9: incremental backup data recorded 00 modify, generated: 00-10

[0169] 在14:00进行第四次增量备份,对小区物业管理系统数据库12:00-14:00的修改, 生成的记录数据进行增量备份。 [0169] In a fourth 14:00 incremental backup, for Property Management System database 12: incremental backup data recorded 00 modify generated: 00-14.

[0170] 需要说明的是,上述W数据库的名称为小区物业管理系统为例进行说明,仅为一具体实例,并不够成对本申请的限定。 [0170] Incidentally, the name of the database is a cell W above property management system as an example, a specific example only, and not limiting of the disclosure in pairs.

[0171] 应用本发明图2所示实施例,在数据库出现问题时,对数据库使用数据库恢复目标时间点之前的最近一次数据库全量备份数据和该次数据库全量备份至数据库恢复目标时间点的记录数据对数据库进行恢复,避免了在数据库恢复时,只使用数据库恢复目标时间点之前的最近一次数据库全量备份数据对数据库进行恢复,数据库恢复目标时间点至数据库恢复目标时间点之前的最近一次数据库全量备份时间点之间数据的丢失。 [0171] Application of the invention FIG present embodiment 2, when a database problem, restore the last database full backup data, and the sub-database full backup before the target point in time to the database recovery target point in time of recording data to the database using the database restore the database to avoid the last database full backup before the database recovery target point in time the last database full backup of data before when the database is restored, using only database recovery target point in time the database recovery, database recovery target time point to missing data between time points. 并且对生成的记录数据进行备份,防止了由于记录数据的丢失,造成数据库不能修复的情况的发生。 And to record data generated backup, to prevent the occurrence of loss due to the recording of data, resulting in the database can not be repaired.

[0172] 考虑到在实际应用中,进行增量备份的次数越多,生成的增量备份数据越占用磁盘空间,为了减少磁盘空间的占用,本发明实施例还提供再一种数据库备份方法,参见图3 所示,本发明图3所示实施例在图2所示实施例基础上,增加S104;将当前最后一次全量备份之前的增量备份数据删除。 [0172] In considering the greater the number of practical applications, incremental backup, the incremental backup data generated in disk space in order to reduce disk space occupied, embodiments of the present invention further provides yet another method of database backup, Referring to FIG. 3, FIG. 3 embodiment of the present invention is illustrated based on Examples, increasing S104 in FIG. 2; the incremental backup data is deleted before the last full backup current.

[0173] 具体的,当完成一次全量备份后,在数据库管理员确认该次全量备份成功且该次全量备份时间点的数据库无误的情况下,该次全量备份时间点之前的增量备份数据可W被删除。 [0173] Specifically, after completion of a full backup, if the database administrator confirms that the secondary full backup is successful and the database is correct the secondary full backup point in time, the incremental backup data prior to the times full backup point in time may be W is removed. 在实际应用中,可W在完成第η次全量备份后,将第η次全量备份与第n-1次全量备份之间的增量备份数据和/或差量备份数据删除,其中,η= 2、3、4……。 In actual applications, the W at the completion of the [eta] Ci full backup, incremental backup data between the first [eta] Ci full backup and the first n 1-times full backup and / or differential backup data is deleted, wherein, η = 2,3,4 .......

[0174] 应用本发明图3所示实施例,减少了由于多次增量备份,使得生成的增量备份数据对磁盘空间的占用。 [0174] Application of the present invention, FIG. 3 embodiment, is reduced due to the multiple incremental backup, incremental backup so that the data generated by the disk space occupied.

[0Π5] 图4为本发明实施例提供的一种数据库恢复方法的流程示意图,可W包括: [0Π5] FIG 4 flow diagram of a database provided in the recovery method embodiment of the invention, W may include:

[0176]S201 ;接收数据库恢复指令,确定待恢复数据库的恢复目标时间点TO; [0176] S201; database recovery command received, the recovery is determined to be a point in time recovery of the TO database;

[0177] 其中,数据库恢复指令中包括待恢复数据库的标识,在实际应用中该标识可为数据库的名称。 [0177] wherein, database recovery command includes identification of the database to be restored, in practical applications the identification may be a name of the database.

[017引示例性的,下面W数据库的名称为小区物业管理系统为例进行说明。 [017 cited example, the name of the database W Property Management System The following is an example.

[0179] 在本发明实施例中,通常情况下,会将数据库恢复到当前时间,即恢复目标时间点TO指当前时间,例如遇到停电、计算机down机等情况时,需要恢复到当前时间的数据库。 [0179] When the embodiment, normally, the database will be restored to the current time, i.e., the recovery target time point TO refers to the current time, such as during a power failure, the computer down other embodiments of the present invention, the need to restore to the current time database.

[0180] 在某些情况下,也需要将数据库恢复到当前时间之前的某一时间,本申请也适用于,指定恢复目标时间点TO的情况。 [0180] In some cases, it is necessary to restore the database to a time before the current time, is also applicable to the present application, specify the target time point TO recovery. 例如:当前时间为13:00,数据库管理员对小区物业管理系统进行数据检查发现其数据发生错误,经过分析发现,从10:20分该数据库的数据发生错误,因此需要将该数据库的数据恢复到10:20。 For example: The current time is 13:00, a database administrator for residential property management system for data inspection found that the data error occurs, after analysis found an error data from the database 10:20 minutes, so you need to restore the data from the database to 10:20.

[0181] 还例如,数据库系统在进行自检时发现某个全量备份数据出现数据错误,郝么数据库恢复系统准备修复送一错误时,将根据待恢复数据库的备份时间来确定恢复目标时间点TO。 [0181] Also, for example, found that the database system self-test during a full backup of data to a data error, it Hao database recovery when the system is ready to send a repair errors, backup time will be determined based on the restored database recovery target time point TO .

[0182] 还例如,用户自己对数据库读写操作后反悔,希望将数据库恢复到自己希望的过去某个时间点的状态时,数据库恢复系统获取一个用户告知的待恢复数据库的恢复目标时间点TO。 When the [0182] Also, for example, the user's own go back after the database read and write operations, want to restore the database to an earlier point in time they want, the database recovery system to obtain a user to be informed of the recovery target recovery point in time TO database .

[0183]S202 ;获取所述恢复目标时间点TO之前的、待恢复数据库最近一次全量备份时间T1的全量备份数据; [0183] S202; acquired before the recovery target time point TO, the restored database last full backup time T1 full backup data;

[0184] 根据S201确定的数据库恢复时间点10:20,首先查找到10:20之前的最近一次数据库全量备份为6:00进行的全量备份。 [0184] According to S201 to determine the database recovery time 10:20 first look to the most recent full backup database full backup is performed at 6:00 before 10:20.

[0185]S203 ;根据所述全量备份数据W及TO至T1之间的记录数据,对待恢复数据库进行数据恢复。 [0185] S203; based on the total amount of backup data and the recording data W between the TO to T1, data recovery treatment to recover the database.

[0186] 其中,记录数据中所记载的信息,是最近一次时间的全量备份数据库完成时间T1, 至接收到数据恢复指令时间之间的对数据库进行修改的数据。 [0186] wherein the information data recording described, it is the last full backup time database completion time T1, the received data to recover the data changes to the database between the instruction time.

[0187] 具体的,利用待恢复数据库最近一次全量备份时间T1的全量备份数据,将待恢复数据库恢复到T1时刻状态; [0187] Specifically, the use of a database to be restored full backup time T1 full backup data most recently, to restore the database to be restored to the status at time T1;

[018引利用TO至T1之间的记录数据,将待恢复数据库恢复到TO时刻状态。 [018 primer using the recording data between the TO to T1, restore the database to be restored to the state of the time point TO.

[0189] 首先,利用6:00的全量备份数据将小区物业管理系统数据库恢复到6:00的状态如下: [0189] First, a full backup of the data recovery 6:00 Property Management System database to 6:00 states are as follows:

[0190] 表1A [0190] TABLE 1A

[0191] [0191]

Figure CN105446828AD00171

Figure CN105446828AD00181

[020引 [020 Cited

[020引再利用6:00至10:20之间的记录数据,即;8:10记录的对小区物业管理系统数据库修改的数据、9:20记录的对小区物业管理系统数据库修改的数据。 [020 cited reuse data recorded between 6:00 to 10:20, i.e.,; 8: 10 data records of the Property Management System database modifications, 9: 20 data records of the Property Management System database changes.

[0207] 对小区物业管理系统数据库进行数据恢复。 [0207] Property Management System database for data recovery.

[020引将小区物业管理系统数据库恢复到9:20的状态如下: [020 lead to restore to a Property Management System database 9:20 states are as follows:

[0209] 表1A [0209] TABLE 1A

[0210] [0210]

Figure CN105446828AD00182

Figure CN105446828AD00191

Figure CN105446828AD00201

[0223] [0223]

[0224] 由于在9:20至10:20,没有对小区物业管理系统数据库进行修改,因此10:20小区物业管理系统数据库的状态和9:20小区物业管理系统数据库的状态相同。 [0224] Since the 9:20 to 10:20, no modifications to the Property Management System database, so the same STATUS Property Management System database 10:20 and 9:20 Property Management System database. 至此,小区物业管理系统数据库的数据恢复完成。 So far, the data management community property system database recovery is complete.

[0225] 在将数据库恢复到当前时间的情况下,理想状态下,与当前时间T2最接近的T3时间的数据库数据可W与当前时间T2的数据库数据相同,但有可能事务日志备份不及时,导致最终恢复到T3时间的数据库,早于T2时间的数据库数据,与T2时间的数据库有差异。 [0225] In the case where the current time to restore the database, ideally, database data and the current time closest to time T3 T2 W may be the same as the current time data T2 of the database, but may not timely backup transaction log, leading to the eventual restoration time T3 to a database, the database data is earlier than the time T2, and the time difference T2 database.

[0226]举例1: [0226] Example 1:

[0227] 假设有第一个全量备份完成于TO时间,第二个全量备份时间开始于T1时间,将于T4时间结束,在第二个全量备份数据库尚未备份完成之时,用户在T2时间要求将数据库恢复到T2时间,然而T2时间的事务日志有一条尚未记录进去,为满足用户的需求,本发明的技术方案可W实现恢复到早于T2时间的T3时间的数据库给用户。 [0227] Consider first a full backup is completed at time TO, the second full backup time starts at T1 time, will end time T4, when the second full backup of the database is not backed up is completed, the user requires time T2 restore the database to the time T2, but the transaction log has a time T2 not recorded in, in order to meet the needs of users, aspect of the present invention may be implemented to return to W earlier than the time T2, the time T3 the database to the user. T2时间收到用户的数据库恢复请求后,查找最近一次时间的全量备份数据库,即TO时间的数据库,查找最近一次记录的事务日志,发现没有Τ2时间的事务日志,最近一次的是Τ3时间点的事务日志。 After T2 time to receive the user's database recovery request, find full backup database the last time, that TO database time, find the transaction log the last record, and found the transaction log is not Τ2 time, the most recent is Τ3 point in time the transaction log. 根据TO时间到Τ3时间的事务日志所记载的数据库的数据操作信息,将TO时间的数据库逐步恢复到T3时间点的数据库,即还原获得与T2时间最接近的T3时间数据库。 The operation of the data time information to the transaction log TO Τ3 time described in the database, the time TO will gradually restore the database to the database point of time T3, i.e., reducing the time T2 to obtain the database closest to the time T3. 举例1中,时间T0<T1<T3<T2<T4O [022引举例2 ; For example 1, the time T0 <T1 <T3 <T2 <T4O [022 Primer Example 2;

[0229] 假设有第一个全量备份完成于TO时间,第二个全量备份时间开始于T1时间,并于T4时间结束,T4时间之后的T2时间时尚未开始第Η次全量备份,用户在T2时间要求将数据库恢复到Τ2时间,然而Τ2时间的事务日志有一条尚未记录进去,最近一次的事务日志是Τ3时间的事务日志,为满足用户的需求,本发明的技术方案可W实现恢复到早于Τ2时间的Τ3时间的数据库给用户。 [0229] Consider first a full backup is completed at TO time, the second full backup time starts at time T1 and ends at time T4, when the T2 time after time T4 has not yet started on Η times full backup, the user T2 the time required to recover the database to Τ2 time, however, the transaction log Τ2 time there is a yet to record in, the last transaction log transaction log Τ3 time, to meet the needs of users, technical solution of the present invention may be W achieve recovery to early Τ3 time to time Τ2 database to the user. Τ2时间收到用户的数据库恢复请求后,查找最近一次时间的全量备份数据库,即Τ4时间的数据库,查找最近一次记录的事务日志,发现没有Τ2时间的事务日志,最近一次的是Τ3时间点的事务日志。 After Τ2 time to receive the user's database recovery request, find full backup database the last time that the database Τ4 time, find the transaction log the last record, and found the transaction log is not Τ2 time, the most recent is Τ3 point in time the transaction log. 根据Τ4时间到Τ3时间的事务日志所记载的数据库的数据操作信息,将Τ4时间的数据库逐步恢复到Τ3时间点的数据库,即还原获得与Τ2 时间最接近的Τ3时间数据库。 According to the operation information Τ4 Τ3 time period described in the transaction log of the database, will gradually restore the database to the database Τ4 time Τ3 point in time, i.e. the time reduction obtained Τ2 closest Τ3 time database. 举例2中,时间T0<T1<T4<T3<T2。 In Example 2, the time T0 <T1 <T4 <T3 <T2.

[0230] 需要说明的是,上述W数据库的名称为小区物业管理系统为例进行说明,仅为一具体实例,并不够成对本申请的限定。 [0230] Incidentally, the name of the database is a cell W above property management system as an example, a specific example only, and not limiting of the disclosure in pairs.

[0231] 应用本发明图4所示实施例,在数据库出现问题时,对数据库使用数据库恢复目标时间点之前的最近一次数据库全量备份数据和该次数据库全量备份至数据库恢复目标时间点的记录数据对数据库进行恢复,避免了在数据库恢复时,只使用数据库恢复目标时间点之前的最近一次数据库全量备份数据对数据库进行恢复,数据库恢复目标时间点至数据库恢复目标时间点之前的最近一次数据库全量备份时间点之间数据的丢失。 [0231] Application of the invention invention shown in Figure 4 embodiment, when the database problem, restore the last database full backup data, and the sub-database full backup to a database recovery target time point before the target time point of recording data of the database using the database restore the database to avoid the last database full backup before the database recovery target point in time the last database full backup of data before when the database is restored, using only database recovery target point in time the database recovery, database recovery target time point to missing data between time points.

[0232] 与上述的方法实施例相对应,本发明实施例还提供数据备份装置W及数据恢复装置。 [0232] Example embodiments of the method described above corresponds to the embodiment of the present invention further provides a data backup and data recovery device W apparatus.

[0233] 图5为本发明实施例提供的一种数据库备份装置的结构示意图,可W包括;全量备份模块301和记录数据生成模块302, [0233] FIG. 5 is a schematic structure of a database backup apparatus according to an embodiment of the present invention may comprise W; full backup module 301 and a recording data generation module 302,

[0234] 其中,全量备份模块301,用于根据数据库组中的各个数据库的全量备份时间点, 分别对每个数据库在其全量备份时间点进行全量备份;其中, [0234] wherein the total amount of backup module 301, according to the time point full backup database the database for each group, respectively, for each database in its full backup full backup time points; wherein,

[0235] 数据库组为;在多租户环境下,分别为每位租户配置的一个独立于其他租户存在的数据库的集合。 [0235] Database group; in a multi-tenant environment, are a set of independent existence of other tenants per tenant database configuration.

[0236] 数据库组中的各个数据库的全量备份时间点,可W是预先设置的,也可W是通过预先设置的一个策略管理单元确定的,策略管理单元可W根据预设的数据库组中的各个数据库的全量备份时间间隔,或根据数据库组中的数据库个数W及每个数据库的存储空间大小确定的。 [0236] full backup time point database group in each database may be W is set in advance, may be W is determined by a policy management unit set in advance, the policy management unit may W according to a preset database of the group the total amount of each database backup interval, or determined according to the number of database storage space in the database group W and the size of each database.

[0237] 具体地,策略管理单元,可W根据预设的数据库组中的各个数据库的全量备份时间间隔,或根据数据库组中的数据库个数,或者每个数据库的存储空间大小,或者数据库的修改频率,确定数据库组中的各个数据库的全量备份时间点。 [0237] In particular, the policy management unit, W may be a preset time according to the full backup database of each group interval database or databases the database according to the number of the group, or the size of each storage space of the database, or database modify the frequency, time point determined full backup of the database in each group database.

[023引具体地,策略管理单元,还可W根据所述数据库组中的数据库的备份时间间隔,计算各个备份时间点拟启动全量备份的数据库的个数,如果数据库个数大于预设的阔值,贝U 将数据库存储空间最大的数据库的全量备份时间点开始时间向前或向后移动到第二时间起点。 [023 cited Specifically, the policy management unit, also in the database backup time of the W group database interval calculated for each backup start time point the number of quasi full backup of a database, the database if the number is greater than the predetermined width value, Tony U database storage maximum amount of full database backup time start time forward or backward to the starting point for the second time.

[0239] 记录数据生成模块302,用于在对任一数据库相邻两次全量备份时间之间,记录对该数据库的修改,生成记录数据。 [0239] The recording data generation module 302, a database between a pair of any two adjacent full backup time, modifications to the database record, generates a recording data.

[0240] 应用本发明图5所示实施例,在根据数据库组中的各个数据库的全量备份时间点,分别对每个数据库在其全量备份时间点进行全量备份;在对任一数据库相邻两次全量备份之间,记录对该数据库的修改,生成记录数据。 [0240] Application of the invention invention shown in Figure 5 embodiment, respectively for each database full backup in its full backup point in time according to full backup time point database group in each database; Out of any database two adjacent times between full backup, modifications to the database record, generates a recording data. 在数据库出现问题时,对数据库使用数据库恢复目标时间点之前的最近一次数据库全量备份数据和该次数据库全量备份至数据库恢复目标时间点的记录数据对数据库进行恢复,避免了在数据库恢复时,只使用数据库恢复目标时间点之前的最近一次数据库全量备份数据对数据库进行恢复,数据库恢复目标时间点至数据库恢复目标时间点之前的最近一次数据库全量备份时间点之间数据的丢失。 Last database full backup of data and the sub-database full backup to restore the database target point in time before the database problem, the recovery target point in time the database using the database record data to restore the database to avoid during database recovery, only the last full backup data database restore the database before the recovery target point in time using the database, the database restore lost data to a point in time between the last full backup database point in time before the database recovery target point in time.

[0241]图6为本发明实施例提供的另一种数据库备份装置的结构示意图,本发明图6所示实施例在图5所示实施例的基础上,增加增量备份模块303,其中, [0241] FIG. 6 is a schematic structural diagram of another database backup apparatus according to an embodiment of the present invention, based on the embodiment shown in the embodiment of FIG. 5 the present invention in FIG. 6, increasing incremental backup module 303, wherein,

[0242] 增量备份模块303,用于对所述记录数据进行增量备份。 [0242] Incremental backup module 303, the record data for incremental backup.

[0243] 本发明实施例的增量备份模块303,具体可W用于: [0243] Incremental backup module 303 embodiments of the present invention, particularly W may be used:

[0244] 对所述记录数据实时进行增量备份; [0244] The recording of data in real time incremental backup;

[0245]或 [0245] or

[0246] 在预先设置的增量备份时间点,对所述记录数据进行增量备份。 [0246] In the incremental backup time point set in advance, the incremental backup data recording.

[0247] 应用本发明图6所示实施例,在数据库出现问题时,对数据库使用数据库恢复目标时间点之前的最近一次数据库全量备份数据和该次数据库全量备份至数据库恢复目标时间点的记录数据对数据库进行恢复,避免了在数据库恢复时,只使用数据库恢复目标时间点之前的最近一次数据库全量备份数据对数据库进行恢复,数据库恢复目标时间点至数据库恢复目标时间点之前的最近一次数据库全量备份时间点之间数据的丢失。 [0247] Application of the invention of FIGURE 6 embodiment illustrated, when the database problem, full backup data of the last database before the database using the database recovery target point in time, and the secondary database full backup to the recording data database recovery target point in time restore the database to avoid the last database full backup before the database recovery target point in time the last database full backup of data before when the database is restored, using only database recovery target point in time the database recovery, database recovery target time point to missing data between time points. 并且对生成的记录数据进行备份,防止了由于记录数据的丢失,造成数据库不能修复的情况的发生。 And to record data generated backup, to prevent the occurrence of loss due to the recording of data, resulting in the database can not be repaired. [024引图7为本发明实施例提供的再一种数据库备份装置的结构示意图,本发明图7所示实施例在图6所示实施例的基础上,增加删除模块304,其中, [024 FIG cited still another schematic configuration database backup apparatus according to an embodiment 7 of the present invention based on the embodiment of the embodiment shown in FIG. 6 on FIG. 7 of the present invention, increase deleting module 304, wherein,

[0249] 删除模块304,用于将当前最后一次全量备份之前的增量备份数据删除。 [0249] deletion module 304, for the incremental backup data prior to the last full backup of the current deletion.

[0巧0] 本发明实施例的删除模块304,具体可W用于: [0 0 Qiao] Example deleting module 304 of the present invention, particularly W may be used:

[0251] 完成第η次全量备份后,将第η次全量备份与第n-1次全量备份之间的增量备份数据删除,其中,η= 2、3、4……。 [0251] [eta] After the completion of the secondary full backup, incremental backup data between the first full backup times [eta] n-1 of the first full backup delete times, wherein, η = 2,3,4 .......

[0252] 应用本发明图7所示实施例,减少了由于多次增量备份,使得生成的增量备份数据对磁盘空间的占用。 Example [0252] As shown in FIG. 7 of the present invention is applied, is reduced due to the multiple incremental backup, incremental backup so that the data generated by the disk space occupied.

[0253] 图8为本发明实施例提供的一种数据库恢复装置的结构示意图,可W包括;确定模块401、全量备份获取模块402和恢复模块403,其中, [0253] FIG. 8 provides structural diagram of a database recovery apparatus of the present embodiment of the invention, W may comprise; determining module 401, acquisition module 402 full backup and restoration module 403, wherein,

[0254] 确定模块401,用于接收数据库恢复指令,确定待恢复数据库的恢复目标时间点Τ0,所述数据库恢复指令中包括待恢复数据库的标识; [0254] determination module 401, configured to receive an instruction to restore the database to determine a point in time to be recovered recovery Τ0 database, the database recovery command includes identification of the database to be recovered;

[0巧5] 全量备份获取模块402,用于获取所述恢复目标时间点TO之前的、待恢复数据库最近一次全量备份时间T1的全量备份数据; [Qiao 5 0] full backup acquisition module 402, configured to obtain the recovery target before the TO time point, the amount of a full database backup time T1 is full backup data to be restored recently;

[0巧6] 恢复模块403,用于根据所述全量备份数据W及TO至T1之间的记录数据,对待恢复数据库进行数据恢复。 [Qiao 6 0] recovery module 403, according to the full backup data and the recording data W between the TO to Tl, data recovery treatment to recover the database.

[0257] 本发明实施例的恢复模块403,具体可W用于: [0257] Recovery module embodiment 403 of the present invention, particularly W may be used:

[0巧引利用待恢复数据库最近一次全量备份时间T1的全量备份数据,将待恢复数据库恢复到T1时刻状态; [0 skillfully using primers recent backup database a full amount of time T1 is the total amount of backup data to be restored, to restore the database to be restored to the state at time T1;

[0259] 利用TO至T1之间的记录数据,将待恢复数据库恢复到TO时刻状态。 [0259] With the recording data between the TO to T1, restore the database to be restored to the state of the time point TO.

[0260] 应用本发明图8所示实施例,在数据库出现问题时,对数据库使用数据库恢复目标时间点之前的最近一次数据库全量备份数据和该次数据库全量备份至数据库恢复目标时间点的记录数据对数据库进行恢复,避免了在数据库恢复时,只使用数据库恢复目标时间点之前的最近一次数据库全量备份数据对数据库进行恢复,数据库恢复目标时间点至数据库恢复目标时间点之前的最近一次数据库全量备份时间点之间数据的丢失。 [0260] The application of the invention of FIGURE 8 embodiment, when a database problem, restore the last database full backup data, and the sub-database full backup to a database recovery target time point before the target time point of recording data of the database using the database restore the database to avoid the last database full backup before the database recovery target point in time the last database full backup of data before when the database is restored, using only database recovery target point in time the database recovery, database recovery target time point to missing data between time points.

[0261] 本发明实施例还提供一种数据库备份恢复系统,包括上述数据库备份装置的任意一种W及上述数据库恢复装置的任意一种。 Example [0261] The present invention further provides any one kind of database backup and recovery system, said database comprising any one of W and said backup unit of database recovery means.

[0262] 本发明实施例还提供一种数据库备份恢复系统,包括;全量备份模块、记录数据生成模块、确定模块、全量备份获取模块和恢复模块,其中, [0262] The present invention further provides a database backup and recovery system, comprising; full backup module, a recording data generating module, a determination module, a full backup acquisition module and a restoration module, wherein

[0263] 所述全量备份模块,用于根据数据库的全量备份时间点,对数据库在其每个全量备份时间点进行全量备份; [0263] The full backup module for full backup time point database, the database full backup full backup at each time point;

[0264] 所述记录数据生成模块,用于在对数据库相邻两次全量备份的时间之间,或者全程记录对该数据库的修改,生成记录数据; [0264] The recording data generation means for the time between two adjacent full backup database, or modifications to the whole record database, generates a recording data;

[0265] 所述确定模块,用于接收数据库恢复指令,确定待恢复数据库的恢复目标时间占. ;、、、» [0265] The determining module, configured to receive an instruction to restore the database to determine the target time to be recovered accounting database recovery;. ,,, »

[0266] 所述全量备份获取模块,用于获取所述恢复目标时间点之前的、待恢复数据库最近一次全量备份时间的全量备份数据; [0266] The full backup acquisition module for full backup data before acquiring the point in time recovery target, a database to be restored latest full backup time;

[0267] 所述恢复模块,用于获取所述全量备份数据W及恢复目标时间点至所述恢复目标时间点之前的、待恢复数据库最近一次全量备份的时间之间的记录数据,根据该记录数据对待恢复数据库进行数据恢复。 [0267] The recovery module, configured to obtain a full backup target data W and the recovery time to restore to the data recorded between the time point before the target time, the restored database the last full backup, according to which the recording data treat restore the database for data recovery.

[026引本发明实施例还提供一种数据库备份恢复系统,包括;全量备份模块、记录数据生成模块、确定模块、全量备份获取模块和恢复模块,其中, [026 cited embodiment of the present invention further provides a database backup and recovery system, comprising; full backup module, a recording data generating module, a determination module, a full backup acquisition module and a restoration module, wherein

[0269] 所述全量备份模块,用于根据数据库组中的各个数据库的全量备份时间点,分别对每个数据库在其全量备份时间点进行全量备份; [0269] The full backup module for full backup time point each database group database, separately for each full backup database at the time point of its full backup;

[0270] 所述记录数据生成模块,用于在对任一数据库相邻两次全量备份的时间之间,记录对该数据库的修改,生成记录数据; [0270] The recording data generation module configured for any time between two adjacent full backup database is recorded modifications to the database, generates a recording data;

[0271]所述确定模块,用于接收数据库恢复指令,确定待恢复数据库的恢复目标时间点T0,所述数据库恢复指令中包括待恢复数据库的标识; [0271] The determining module, configured to receive a command database recovery, the recovery is determined to be a point in time T0 recovery of a database, the database recovery command includes identification of the database to be recovered;

[0272] 所述全量备份获取模块,用于获取所述恢复目标时间点TO之前的、待恢复数据库最近一次全量备份时间T1的全量备份数据; [0272] The full backup acquisition module configured to obtain the recovery target before the TO time point, the amount of a full database backup time T1 is full backup data to be restored recently;

[0273] 所述恢复模块,用于根据所述全量备份数据W及TO至T1之间的记录数据,对待恢复数据库进行数据恢复。 [0273] The recovery module according to the full backup data and the recording data W between the TO to Tl, data recovery treatment to recover the database.

[0274] 应用本发明实施例提供的数据库备份恢复系统,避免了在数据库恢复时,只使用数据库恢复目标时间点之前的最近一次数据库全量备份数据对数据库进行恢复,数据库恢复目标时间点至数据库恢复目标时间点之前的最近一次数据库全量备份时间点之间数据的丢失。 Embodiment [0274] Application of the present invention is a database backup and recovery system provided, avoiding the database recovery, only the most recent database prior to database recovery target point in time the total amount of backup data for the database recovery, database recovery target point in time to restore the database loss of data between the database last full backup point in time before the target point in time.

[0275] 需要说明的是,在本文中,诸如第一和第二等之类的关系术语仅仅用来将一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示送些实体或操作之间存在任何送种实际的关系或者顺序。 [0275] Incidentally, herein, relational terms such as first and second and the like are only used to distinguish one entity or operation from another entity or action without necessarily requiring or implying to send some the presence of any kind of feed actual relationship or order between such entities or operations. 而且,术语"包括"、"包含"或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者设备不仅包括郝些要素,而且还包括没有明确列出的其他要素,或者是还包括为送种过程、方法、物品或者设备所固有的要素。 Further, the term "comprising", "containing" or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, article or device comprising Hao only those elements but not explicitly listed further comprising the other elements, or further comprising feeding elements of kinds of process, method, article, or apparatus inherent. 在没有更多限制的情况下,由语句"包括一个……"限定的要素,并不排除在包括所述要素的过程、方法、物品或者设备中还存在另外的相同要素。 Without more constraints, by the wording "include a ......" defined does not exclude the existence of additional identical elements in the element comprising a process, method, article, or apparatus.

[0276] 本说明书中的各个实施例均采用相关的方式描述,各个实施例之间相同相似的部分互相参见即可,每个实施例重点说明的都是与其他实施例的不同之处。 [0276] In the present specification, various embodiments are described by way of using correlation, between similar portions of the same embodiment of the various embodiments refer to each other, are different from the embodiment and the other embodiments described each embodiment focus. 尤其,对于装置实施例而言,由于其基本相似于方法实施例,所W描述的比较简单,相关之处参见方法实施例的部分说明即可。 In particular, for the apparatus of the embodiment, since it is basically similar to the method embodiments, the described W is relatively simple, see Example RELATED place portion can be described.

[0277] 本领域普通技术人员可W理解实现上述方法实施方式中的全部或部分步骤是可W通过程序来指令相关的硬件来完成,所述的程序可W存储于计算机可读取存储介质中, 送里所称得的存储介质,如;R0M/RAM、磁碟、光盘等。 [0277] Those of ordinary skill in the art can understand that the method described above W embodiment all or part of the steps may be W is instructing relevant hardware by a program, the program may be W stored in a computer readable storage medium. , was sent in the alleged storage medium, such as; R0M / RAM, magnetic disk, optical disk.

[027引W上所述仅为本发明的较佳实施例而已,并非用于限定本发明的保护范围。 The [027 W primer merely the preferred embodiments of the present invention but are not intended to limit the scope of the present invention. 凡在本发明的精神和原则之内所作的任何修改、等同替换、改进等,均包含在本发明的保护范围内。 Any modifications within the spirit and principle of the present invention, equivalent substitutions, improvements, etc., are included within the scope of the present invention.

Claims (25)

1. 一种数据库备份方法,其特征在于,所述方法包括: 根据数据库组中的各个数据库的全量备份时间点,分别对每个数据库在其全量备份时间点进行全量备份; 在对任一数据库相邻两次全量备份时间之间,记录对该数据库的修改,生成记录数据。 A database backup method, characterized in that, the method comprising: the full backup time point each database group database, separately for each database in its full backup full backup time point; any one of the database between two adjacent full backup time, modifications to the database record, generates a recording data.
2. 根据权利要求1所述的方法,其特征在于,所述数据库组,包括: 在多租户环境下,分别为每位租户配置的一个独立于其他租户存在的数据库的集合。 2. The method according to claim 1, characterized in that, the database group, comprising: in a multi-tenant environment, each tenant are arranged independently of the other a present tenant database collection.
3. 根据权利要求1或2所述的方法,其特征在于,所述数据库组中的各个数据库的全量备份时间点是预先设置的; 或所述全量备份时间点,是由策略管理单元确定的。 3. The method of claim 1 or claim 2, wherein the full backup of the database point of time of each set of the database is set in advance; full backup or the point of time, is determined by the policy management unit, .
4. 根据权利要求3所述的方法,其特征在于,所述策略管理单元确定所述全量备份时间点,包括: 所述策略管理单元根据预设的数据库组中的各个数据库的全量备份时间间隔,或根据数据库组中的数据库个数,或者每个数据库的存储空间大小,或者数据库的修改频率,确定数据库组中的各个数据库的全量备份时间点。 4. The method according to claim 3, wherein the policy management unit determines the full backup point in time, comprising: a policy management unit interval of time according to a predetermined full backup database of each group database , frequency, or number of databases according to the modified database group, or the size of each storage space of the database, or a database, the database to determine the total amount of the respective group the point in time the database backup.
5. 根据权利要求3所述的方法,其特征在于,所述策略管理单元确定所述全量备份时间点,包括: 所述策略管理单元根据所述数据库组中的数据库的备份时间间隔,计算各个备份时间点拟启动全量备份的数据库的个数,如果数据库个数大于预设的阈值,则将数据库存储空间最大的数据库的全量备份时间点开始时间向前或向后移动到第二时间起点。 5. The method according to claim 3, wherein the policy management unit determines the full backup point in time, comprising: a policy management unit according to the time of the database backup database set interval, each calculated Quasi backup start time point the number of full backup of a database, the database if the number is greater than a predetermined threshold value, full backup start time point of the maximum time database storage database will move forward or backward to the starting point for the second time.
6. 根据权利要求1所述的方法,其特征在于,所述方法还包括: 对所述记录数据进行增量备份。 6. The method according to claim 1, wherein said method further comprises: recording the incremental backup data.
7. 根据权利要求6所述的方法,其特征在于,所述对所述记录数据进行增量备份,包括: 对所述记录数据实时进行增量备份; 或在预先设置的增量备份时间点,对所述记录数据进行增量备份。 7. The method according to claim 6, wherein the incremental backup of the recording data, comprising: recording data in real time the incremental backup; or incremental backup at a preset time point , the incremental backup data recording.
8. 根据权利要求6所述的方法,其特征在于,所述方法还包括: 将当前最后一次全量备份之前的增量备份数据删除。 8. The method according to claim 6, wherein said method further comprises: the incremental backup data before the last full backup current deleted.
9. 根据权利要求8所述的方法,其特征在于,所述将当前最后一次全量备份之前的增量备份数据删除,包括: 完成第η次全量备份后,将第η次全量备份与第n-1次全量备份之间的增量备份数据删除,其中,η= 2、3、4......。 9. The method according to claim 8, wherein the incremental backup data before the last full backup to delete the current, comprising: a time after the completion of the full backup η, η times the first full backup and the n incremental backup data between the -1-order full backup deleted, wherein, η = 2,3,4 .......
10. -种数据库恢复方法,其特征在于,所述方法包括: 接收数据库恢复指令,确定待恢复数据库的恢复目标时间点Τ0,所述数据库恢复指令中包括待恢复数据库的标识; 获取所述恢复目标时间点Τ0之前的、待恢复数据库最近一次全量备份时间Τ1的全量备份数据; 根据所述全量备份数据以及T0至T1之间的记录数据,对待恢复数据库进行数据恢复。 10. - kind of database recovery method, characterized in that, the method comprising: receiving a command to restore the database to determine a point in time recovery Τ0 restored database, the database recovery instruction comprises an identification database to be restored; obtaining the recovery Τ0 point before the target time, to restore the database to be the last full backup time of the full backup data Τ1; based on the total amount of backup data and the recording data between T0 to Tl, data recovery treatment to recover the database.
11. 根据权利要求10所述的方法,其特征在于,所述根据所述全量备份数据以及T0至T1之间的记录数据,对待恢复数据库进行数据恢复,包括: 利用待恢复数据库最近一次全量备份时间Τ1的全量备份数据,将待恢复数据库恢复到Τ1时刻状态; 利用TO至Τ1之间的记录数据,将待恢复数据库恢复到TO时刻状态。 11. The method according to claim 10, wherein the full backup data according to the data recorded between T0 and Tl to, treatment to restore the database to data recovery, comprising: a database to be restored using the last full backup time [tau] 1 of the full backup data, to restore the database to be restored to the state in time [tau] 1; use to record data between the tO [tau] 1, the database will be restored to the restore time tO state.
12. -种数据库备份装置,其特征在于,所述装置包括:全量备份模块、记录数据生成模块,其中, 所述全量备份模块,用于根据数据库组中的各个数据库的全量备份时间点,分别对每个数据库在其全量备份时间点进行全量备份; 所述记录数据生成模块,用于在对任一数据库相邻两次全量备份时间之间,记录对该数据库的修改,生成记录数据。 12. - kind of database backup unit, characterized in that, said means comprising: a full backup module, the recording data generation module, wherein the full backup module for backup depending on the total amount of each database group database, respectively, for each full backup database at its full backup point in time; the recording data generation module configured for either between adjacent two full backup time database, modifications to the database record, generates a recording data.
13. 根据权利要求12所述的装置,其特征在于,所述数据库组,包括: 在多租户环境下,分别为每位租户配置的一个独立于其他租户存在的数据库的集合。 13. The apparatus as claimed in claim 12, wherein said database group, comprising: in a multi-tenant environment, each tenant are arranged independently of the other a present tenant database collection.
14. 根据权利要求12或13所述的装置,其特征在于,所述数据库组中的各个数据库的全量备份时间点是预先设置的; 或所述全量备份时间点,是由策略管理单元确定的。 14. The apparatus of claim 12 or claim 13, wherein the full backup of the database point of time of each set of the database is set in advance; full backup or the point of time, is determined by the policy management unit, .
15. 根据权利要求14所述的装置,其特征在于,所述策略管理单元确定所述全量备份时间点,包括: 所述策略管理单元根据预设的数据库组中的各个数据库的全量备份时间间隔,或根据数据库组中的数据库个数,或者每个数据库的存储空间大小,或者数据库的修改频率,确定数据库组中的各个数据库的全量备份时间点。 15. The apparatus according to claim 14, wherein the policy management unit determines the full backup point in time, comprising: a policy management unit interval of time according to a predetermined full backup database of each group database , frequency, or number of databases according to the modified database group, or the size of each storage space of the database, or a database, the database to determine the total amount of the respective group the point in time the database backup.
16. 根据权利要求14所述的装置,其特征在于,所述策略管理单元,确定所述全量备份时间点,包括: 所述策略管理单元根据所述数据库组中的数据库的备份时间间隔,计算各个备份时间点拟启动全量备份的数据库的个数,如果数据库个数大于预设的阈值,则将数据库存储空间最大的数据库的全量备份时间点开始时间向前或向后移动到第二时间起点。 16. Apparatus according to claim 14, wherein the policy management unit, determines the total amount of time the backup point, comprising: a policy management unit according to the time of the database backup database group interval is calculated Quasi respective backup start time point the number of full backup of a database, the database if the number is greater than a predetermined threshold value, full backup start time point of the maximum time database storage database will move forward or backward to the starting point for a second time .
17. 根据权利要求12所述的装置,其特征在于,所述装置还包括:增量备份模块,其中, 所述增量备份模块,用于对所述记录数据进行增量备份。 17. The apparatus as claimed in claim 12, wherein said apparatus further comprises: an incremental backup module, wherein, the incremental backup module, for recording the incremental backup data.
18. 根据权利要求17所述的装置,其特征在于,所述增量备份模块,具体用于: 对所述记录数据实时进行增量备份; 或在预先设置的增量备份时间点,对所述记录数据进行增量备份。 18. The apparatus according to claim 17, wherein the incremental backup module is configured to: record the data in real time incremental backup; or incremental backup at a preset time point, of the recording said incremental backup data.
19. 根据权利要求19所述的装置,其特征在于,所述装置还包括:删除模块,其中, 所述删除模块,用于将当前最后一次全量备份之前的增量备份数据删除。 19. The apparatus according to claim 19, characterized in that said apparatus further comprising: a deleting module, wherein said deleting module for incremental backup data before the last full backup current deleted.
20. 根据权利要求19所述的装置,其特征在于,所述删除模块,具体用于: 完成第η次全量备份后,将第η次全量备份与第n-1次全量备份之间的增量备份数据删除,其中,η= 2、3、4......。 20. The apparatus according to claim 19, wherein said deleting module, configured to: after the completion of increasing η times between full backup, the first full backup times η n 1-times of the first full backup the amount of backup data is deleted, wherein, η = 2,3,4 .......
21. -种数据库恢复装置,其特征在于,所述装置包括:确定模块、全量备份获取模块和恢复模块,其中, 所述确定模块,用于接收数据库恢复指令,确定待恢复数据库的恢复目标时间点Τ0,所述数据库恢复指令中包括待恢复数据库的标识; 所述全量备份获取模块,用于获取所述恢复目标时间点TO之前的、待恢复数据库最近一次全量备份时间T1的全量备份数据; 所述恢复模块,用于根据所述全量备份数据以及TO至T1之间的记录数据,对待恢复数据库进行数据恢复。 21. - kind of database recovery means, wherein, said means comprising: a determining module, full backup acquisition module and a restoration module, wherein the determining module, configured to receive an instruction to restore the database to determine the recovery time of the target database to be restored point [tau] 0, the instruction includes a database recovery identification database to be recovered; the full backup acquisition module configured to obtain the recovery target before the tO time point, the amount of a full database backup time T1 is full backup data to be restored recently; the recovery module for the full backup data and the recording data between the tO to Tl, data recovery treatment to recover the database.
22. 根据权利要求21所述的装置,其特征在于,所述恢复模块,具体用于: 利用待恢复数据库最近一次全量备份时间T1的全量备份数据,将待恢复数据库恢复到T1时刻状态; 利用TO至T1之间的记录数据,将待恢复数据库恢复到TO时刻状态。 22. The apparatus according to claim 21, wherein said recovery module is configured to: use the database to be restored the last full backup data of time T1 is full backup, restore the database to be restored to the state at time T1; using recording data between the tO to T1, restore the database to be restored to the state of the time point tO.
23. -种数据库备份恢复系统,包括权利要求12至20的任意一种数据库备份装置以及权利要求21和22的任意一种数据库恢复装置。 23. - Species Database backup and recovery system comprising a database backup to claim any one of claim 12 to 20 and the apparatus of any one of claims 21 and 22 database recovery means.
24. -种数据库备份恢复系统,其特征在于,所述系统包括:全量备份模块、记录数据生成模块、确定模块、全量备份获取模块和恢复模块,其中, 所述全量备份模块,用于根据数据库的全量备份时间点,对数据库在其每个全量备份时间点进行全量备份; 所述记录数据生成模块,用于在对数据库相邻两次全量备份的时间之间,或者全程记录对该数据库的修改,生成记录数据; 所述确定模块,用于接收数据库恢复指令,确定待恢复数据库的恢复目标时间点; 所述全量备份获取模块,用于获取所述恢复目标时间点之前的、待恢复数据库最近一次全量备份时间的全量备份数据; 所述恢复模块,用于获取所述全量备份数据以及恢复目标时间点至所述恢复目标时间点之前的、待恢复数据库最近一次全量备份的时间之间的记录数据,根据该记录数据对待恢复数 24. - Species Database backup and recovery system, wherein, said system comprising: a full backup module, a recording data generating module, a determination module, a full backup acquisition module and a restoration module, wherein the full backup module, according to the database the full backup point in time, the database at each time point full backup full backup; the recording data generation means for the time between two adjacent full backup database or the whole database records revision, the recording data; the determining module, configured to receive an instruction to restore the database to determine the target point in time to restore the database to be restored; the full backup acquisition module for acquiring target point before the recovery time, the restored database the last full backup full backup time of data; the restoration module, configured to obtain the full backup data, and the time to recover to the target point target point in time before the recovery, the time between the last full backup database is to be restored recording data, in accordance with the number of recovery treatment of the recording data 据库进行数据恢复。 Database for data recovery.
25. -种数据库备份恢复系统,其特征在于,所述系统包括:全量备份模块、记录数据生成模块、确定模块、全量备份获取模块和恢复模块,其中, 所述全量备份模块,用于根据数据库组中的各个数据库的全量备份时间点,分别对每个数据库在其全量备份时间点进行全量备份; 所述记录数据生成模块,用于在对任一数据库相邻两次全量备份的时间之间,记录对该数据库的修改,生成记录数据; 所述确定模块,用于接收数据库恢复指令,确定待恢复数据库的恢复目标时间点T0,所述数据库恢复指令中包括待恢复数据库的标识; 所述全量备份获取模块,用于获取所述恢复目标时间点T0之前的、待恢复数据库最近一次全量备份时间T1的全量备份数据; 所述恢复模块,用于根据所述全量备份数据以及T0至T1之间的记录数据,对待恢复数据库进行数据恢复。 25. - Species Database backup and recovery system, wherein, said system comprising: a full backup module, a recording data generating module, a determination module, a full backup acquisition module and a restoration module, wherein the full backup module, according to the database full backup each time point group database, separately for each database in its full backup full backup point in time; the recording data generation module configured for any time between two adjacent full backup database of , modifications to the database record, generates a recording data; the determining module, configured to receive an instruction to restore the database to determine the target time point T0 recovery restored database, the database recovery instruction comprises an identification database to be recovered; the full backup acquisition module for acquiring a point in time T0 before the recovery, the total amount of backup data backup time T1 a full amount of the latest database to be restored; the restoration module, according to the full backup data, and T0 and T1 of record data between, treat restore the database for data recovery.
CN201410523108.9A 2014-09-30 2014-09-30 A kind of DB Backup, restoration methods, apparatus and system CN105446828B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410523108.9A CN105446828B (en) 2014-09-30 2014-09-30 A kind of DB Backup, restoration methods, apparatus and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410523108.9A CN105446828B (en) 2014-09-30 2014-09-30 A kind of DB Backup, restoration methods, apparatus and system

Publications (2)

Publication Number Publication Date
CN105446828A true CN105446828A (en) 2016-03-30
CN105446828B CN105446828B (en) 2019-05-31

Family

ID=55557061

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410523108.9A CN105446828B (en) 2014-09-30 2014-09-30 A kind of DB Backup, restoration methods, apparatus and system

Country Status (1)

Country Link
CN (1) CN105446828B (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105955845A (en) * 2016-04-26 2016-09-21 浪潮电子信息产业股份有限公司 Data recovery method and device
CN106201780A (en) * 2016-07-08 2016-12-07 浪潮通用软件有限公司 Method for historical data reduction
WO2017215432A1 (en) * 2016-06-15 2017-12-21 腾讯科技(深圳)有限公司 Data retracement method, device and system

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1659522A (en) * 2002-04-19 2005-08-24 电脑联合想象公司 Method and system for disaster recovery
CN101067818A (en) * 2007-06-06 2007-11-07 中国工商银行股份有限公司 Data incremental backup and recovery method applied to data bank
US8260750B1 (en) * 2009-03-16 2012-09-04 Quest Software, Inc. Intelligent backup escalation system
CN103118011A (en) * 2013-01-12 2013-05-22 合肥华云通信技术有限公司 Method for protecting customer data in multi-tenant environment
CN103885855A (en) * 2012-12-20 2014-06-25 航天信息股份有限公司 Data backup and recovery method and data backup and recovery device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1659522A (en) * 2002-04-19 2005-08-24 电脑联合想象公司 Method and system for disaster recovery
CN101067818A (en) * 2007-06-06 2007-11-07 中国工商银行股份有限公司 Data incremental backup and recovery method applied to data bank
US8260750B1 (en) * 2009-03-16 2012-09-04 Quest Software, Inc. Intelligent backup escalation system
CN103885855A (en) * 2012-12-20 2014-06-25 航天信息股份有限公司 Data backup and recovery method and data backup and recovery device
CN103118011A (en) * 2013-01-12 2013-05-22 合肥华云通信技术有限公司 Method for protecting customer data in multi-tenant environment

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105955845A (en) * 2016-04-26 2016-09-21 浪潮电子信息产业股份有限公司 Data recovery method and device
WO2017215432A1 (en) * 2016-06-15 2017-12-21 腾讯科技(深圳)有限公司 Data retracement method, device and system
CN106201780A (en) * 2016-07-08 2016-12-07 浪潮通用软件有限公司 Method for historical data reduction

Also Published As

Publication number Publication date
CN105446828B (en) 2019-05-31

Similar Documents

Publication Publication Date Title
US8214612B1 (en) Ensuring consistency of replicated volumes
US8898112B1 (en) Write signature command
US8825601B2 (en) Logical data backup and rollback using incremental capture in a distributed database
CA2933790C (en) Apparatus and method for creating a real time database replica
US9535801B1 (en) Xcopy in journal based replication
US7624133B1 (en) Automatic detection of backup recovery sets
US6934725B1 (en) Management of file extent mapping to hasten mirror breaking in file level mirrored backups
US8015430B1 (en) Using asset dependencies to identify the recovery set and optionally automate and/or optimize the recovery
US8090917B2 (en) Managing storage and migration of backup data
US7634679B2 (en) Remote location failover server application
US8332354B1 (en) Asynchronous replication by tracking recovery point objective
JP2008251010A (en) Removal
US7308545B1 (en) Method and system of providing replication
US9058371B2 (en) Distributed database log recovery
US7571268B2 (en) Consistent updates across storage subsystems coupled to a plurality of primary and secondary units at selected times
JP2005196683A (en) Information processing system, information processor and control method of information processing system
US20110161302A1 (en) Distributed File System and Data Block Consistency Managing Method Thereof
US8775386B2 (en) Device and method for generating copy of database
US8190572B2 (en) High-availability and data protection of OLTP databases
US8260747B2 (en) System, method, and computer program product for allowing access to backup data
JP2012164343A (en) Method for managing deletion of data
EP2657859B1 (en) Ensuring database log recovery consistency
US8140484B2 (en) Techniques for determining an implemented data protection policy
CN101650680A (en) Continuous data protection method based on continuous snapshots
US8127174B1 (en) Method and apparatus for performing transparent in-memory checkpointing

Legal Events

Date Code Title Description
C06 Publication
C10 Entry into substantive examination