[go: up one dir, main page]

CN108762982A - A database recovery method, device and system - Google Patents

A database recovery method, device and system Download PDF

Info

Publication number
CN108762982A
CN108762982A CN201810478366.8A CN201810478366A CN108762982A CN 108762982 A CN108762982 A CN 108762982A CN 201810478366 A CN201810478366 A CN 201810478366A CN 108762982 A CN108762982 A CN 108762982A
Authority
CN
China
Prior art keywords
database
restored
middleware
recovery
disaster recovery
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.)
Granted
Application number
CN201810478366.8A
Other languages
Chinese (zh)
Other versions
CN108762982B (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.)
Hangzhou Dt Dream Technology Co Ltd
Original Assignee
Hangzhou Dt Dream Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hangzhou Dt Dream Technology Co Ltd filed Critical Hangzhou Dt Dream Technology Co Ltd
Priority to CN201810478366.8A priority Critical patent/CN108762982B/en
Priority to CN201910849759.XA priority patent/CN110647425A/en
Publication of CN108762982A publication Critical patent/CN108762982A/en
Application granted granted Critical
Publication of CN108762982B publication Critical patent/CN108762982B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; 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 OR CALCULATING; 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

Landscapes

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

Abstract

The application provides a database recovery method, a device and a system, wherein the method is applied to disaster recovery engine equipment of a main center in a database recovery system, and comprises the following steps: acquiring configuration information of a database to be recovered from a disaster recovery server based on a recovery instruction which is sent by disaster recovery management equipment and carries an identifier of an old instance of the database to be recovered; sending a configuration instruction to the middleware by using the acquired configuration information so that the middleware creates a new instance of the database to be recovered; and acquiring a service data table of the database to be recovered from the disaster recovery server, and writing the acquired service data table into the storage device based on a database-dividing and table-dividing strategy. The whole database recovery process is completed through the disaster recovery engine equipment, so that the middleware can specially process the service, and compared with the prior art, the service processing performance of the middleware can be doubled. And the disaster recovery engine device is specially used for database recovery, so that the recovery time can be shortened.

Description

一种数据库恢复方法、装置及系统A database recovery method, device and system

技术领域technical field

本申请涉及数据库技术领域,尤其涉及一种数据库恢复方法、装置及系统。The present application relates to the technical field of databases, in particular to a method, device and system for restoring a database.

背景技术Background technique

随着数据量的高速增长,数据库的架构开始由集中式向分布式发展。目前所使用的分布式数据库系统通常包括分布式数据库的中间件、分布式数据库等。为了保证分布式数据库系统的安全性,通常需要进行数据库灾备以用于后续数恢复。With the rapid growth of data volume, the database architecture began to develop from centralized to distributed. Currently used distributed database systems usually include distributed database middleware, distributed databases, and the like. In order to ensure the security of the distributed database system, database disaster recovery is usually required for subsequent data recovery.

在相关技术中,在对某一业务的数据库进行恢复时,灾备管理设备先从灾备中心的灾备服务器获取待恢复数据库的配置信息,并将待恢复数据库的配置信息发送至主中心的中间件,以使中间件根据配置信息创建待恢复数据库的实例,并基于分库分表策略自动生成待恢复数据库的路由信息;然后灾备管理设备再从灾备中心的灾备服务器获取待恢复数据库的业务数据表,并将业务数据表发送至主中心的中间件,并由中间件根据待恢复数据库的路由信息,将业务数据表写入主中心的存储设备中,从而完成数据库的恢复。In the related technology, when restoring the database of a certain business, the disaster recovery management device first obtains the configuration information of the database to be recovered from the disaster recovery server in the disaster recovery center, and sends the configuration information of the database to be recovered to the server in the main center. Middleware, so that the middleware creates an instance of the database to be restored according to the configuration information, and automatically generates the routing information of the database to be restored based on the sub-database and table strategy; then the disaster recovery management device obtains the data to be recovered from the disaster recovery server in the disaster recovery center The business data table of the database is sent to the middleware of the main center, and the middleware writes the business data table into the storage device of the main center according to the routing information of the database to be restored, thereby completing the recovery of the database.

然而,由于主中心的中间件除了需要处理待恢复数据库的数据写入过程,还需要处理业务对其他数据库的访问,因此主中心的中间件的处理压力比较大,进而影响到业务对数据库的访问性能,降低用户使用体验。However, since the middleware of the main center not only needs to handle the data writing process of the database to be restored, but also needs to handle the business’s access to other databases, the processing pressure of the middleware of the main center is relatively high, which in turn affects the business’s access to the database performance and degrade user experience.

发明内容Contents of the invention

有鉴于此,本申请提供一种数据库恢复方法、装置及系统,以解决现有恢复方式会影响业务对数据库的访问性能,降低用户使用体验的问题。In view of this, the present application provides a database recovery method, device and system to solve the problem that existing recovery methods will affect the performance of business access to the database and reduce user experience.

根据本申请实施例的第一方面,提供一种数据库恢复方法,所述方法应用于数据库恢复系统中主中心的灾备引擎设备,所述数据库恢复系统还包含灾备管理设备、灾备中心的灾备服务器,以及主中心的存储设备,所述方法包括:According to the first aspect of the embodiment of the present application, a database recovery method is provided, the method is applied to the disaster recovery engine equipment of the main center in the database recovery system, and the database recovery system also includes the disaster recovery management equipment, the disaster recovery center The disaster recovery server, and the storage device of the main center, the method includes:

步骤一、基于所述灾备管理设备发送的携带待恢复数据库的老实例的标识的恢复指令,从所述灾备服务器获取待恢复数据库的配置信息;Step 1. Obtain configuration information of the database to be restored from the disaster recovery server based on the restoration command sent by the disaster recovery management device and carrying the identifier of the old instance of the database to be restored;

步骤二、利用获取的配置信息向所述中间件发送配置指令,以使所述中间件创建待恢复数据库的新实例;Step 2, using the obtained configuration information to send a configuration instruction to the middleware, so that the middleware creates a new instance of the database to be restored;

步骤三、从所述灾备服务器获取待恢复数据库的业务数据表,并基于分库分表策略将获取的业务数据表写入所述存储设备。Step 3: Obtain the business data table of the database to be restored from the disaster recovery server, and write the obtained business data table into the storage device based on the strategy of sub-database and sub-table.

根据本申请实施例的第二方面,提供一种数据库恢复系统,所述系统包括:According to a second aspect of the embodiments of the present application, a database recovery system is provided, the system comprising:

灾备管理设备,用于向主中心的灾备引擎设备发送携带待恢复数据库的老实例的标识的恢复指令;The disaster recovery management device is used to send a recovery command carrying the identification of the old instance of the database to be recovered to the disaster recovery engine device in the main center;

灾备中心的灾备服务器,用于存储待恢复数据库的配置信息和业务数据表;The disaster recovery server in the disaster recovery center is used to store the configuration information and business data tables of the database to be recovered;

主中心的灾备引擎设备,用于基于携带待恢复数据库的老实例的标识的恢复指令,从所述灾备服务器获取待恢复数据库的配置信息,并利用获取的配置信息向中间件发送配置指令;从所述灾备服务器获取待恢复数据库的业务数据表,并基于分库分表策略将获取的业务数据表写入主中心的存储设备;The disaster recovery engine device of the main center is used to obtain the configuration information of the database to be recovered from the disaster recovery server based on the recovery command carrying the identification of the old instance of the database to be recovered, and send the configuration command to the middleware by using the obtained configuration information Obtain the business data table of the database to be recovered from the disaster recovery server, and write the obtained business data table into the storage device of the main center based on the sub-database sub-table strategy;

主中心的中间件,用于基于所述配置指令,创建待恢复数据库的新实例;The middleware of the main center is used to create a new instance of the database to be restored based on the configuration instruction;

主中心的存储设备,用于存储所述灾备引擎设备写入的业务数据表。The storage device of the main center is used to store the business data table written by the disaster recovery engine device.

根据本申请实施例的第三方面,提供一种数据库恢复装置,所述装置应用于数据库恢复系统中主中心的灾备引擎设备,所述数据库恢复系统还包含灾备管理设备、灾备中心的灾备服务器,以及主中心的存储设备,所述装置包括:According to the third aspect of the embodiment of the present application, a database recovery device is provided, the device is applied to the disaster recovery engine equipment of the main center in the database recovery system, and the database recovery system also includes the disaster recovery management equipment, the disaster recovery center The disaster recovery server, and the storage device of the main center, the device includes:

第一获取模块,用于基于所述灾备管理设备发送的携带待恢复数据库的老实例的标识的恢复指令,从所述灾备服务器获取待恢复数据库的配置信息;The first obtaining module is configured to obtain configuration information of the database to be restored from the disaster recovery server based on the restoration instruction sent by the disaster recovery management device and carrying the identifier of the old instance of the database to be restored;

第一发送模块,用于利用获取的配置信息向所述中间件发送配置指令,以使所述中间件创建待恢复数据库的新实例;A first sending module, configured to use the obtained configuration information to send a configuration instruction to the middleware, so that the middleware creates a new instance of the database to be restored;

第二获取模块,用于从所述灾备服务器获取待恢复数据库的业务数据表;The second obtaining module is used to obtain the business data table of the database to be restored from the disaster recovery server;

写入模块,用于基于分库分表策略将获取的业务数据表写入所述存储设备。A writing module, configured to write the acquired business data table into the storage device based on the policy of sub-database and sub-table.

应用本申请实施例,灾备引擎设备在接收到灾备管理设备发送的恢复指令之后,基于灾备管理设备发送的携带待恢复数据库的老实例的标识的恢复指令,从灾备服务器获取待恢复数据库的配置信息,并利用获取的配置信息向中间件发送配置指令,以使中间件创建待恢复数据库的新实例;从灾备服务器获取待恢复数据库的业务数据表,并基于分库分表策略将获取的业务数据表写入存储设备,从而完成数据库恢复。基于上述描述可知,整个数据库的恢复过程都是通过灾备引擎设备完成,使得主中心的中间件可以专门处理其他业务对数据库的访问,因此本申请相对现有技术,主中心的中间件对其他业务的处理性能至少能够提升一倍,进而提升了用户的使用体验。同时,由于灾备引擎设备专门用于进行数据库恢复过程,不需要处理其他业务,因此可以很大程度缩短恢复耗时。Applying the embodiment of this application, after receiving the recovery command sent by the disaster recovery management device, the disaster recovery engine device obtains the recovery command from the disaster recovery server based on the recovery command sent by the disaster recovery management device and carrying the identifier of the old instance of the database to be recovered. The configuration information of the database, and use the obtained configuration information to send configuration instructions to the middleware, so that the middleware creates a new instance of the database to be restored; obtain the business data table of the database to be restored from the disaster recovery server, and based on the sub-database sub-table strategy Write the obtained business data table into the storage device, so as to complete the database restoration. Based on the above description, it can be seen that the recovery process of the entire database is completed through the disaster recovery engine device, so that the middleware of the main center can specifically handle the access of other businesses to the database. The processing performance of the business can be at least doubled, thereby improving the user experience. At the same time, since the disaster recovery engine device is specially used for the database recovery process and does not need to deal with other businesses, it can greatly shorten the recovery time.

附图说明Description of drawings

图1为本申请根据一示例性实施例示出的现有的数据库恢复系统结构示意图;FIG. 1 is a schematic structural diagram of an existing database recovery system according to an exemplary embodiment of the present application;

图2为本申请根据一示例性实施例示出的一种数据库恢复系统结构示意图;Fig. 2 is a schematic structural diagram of a database restoration system according to an exemplary embodiment of the present application;

图3为本申请根据一示例性实施例示出的一种数据库恢复方法的实施例流程图;FIG. 3 is a flow chart of an embodiment of a method for restoring a database according to an exemplary embodiment of the present application;

图4为本申请根据一示例性实施例示出的另一种数据库恢复方法的实施例流程图;Fig. 4 is an embodiment flow chart of another database recovery method according to an exemplary embodiment of the present application;

图5为本申请根据一示例性实施例示出的一种灾备引擎设备的硬件结构图;FIG. 5 is a hardware structural diagram of a disaster recovery engine device according to an exemplary embodiment of the present application;

图6为本申请根据一示例性实施例示出的一种数据库恢复装置的实施例结构图。Fig. 6 is a structural diagram of an embodiment of a database recovery device according to an exemplary embodiment of the present application.

具体实施方式Detailed ways

这里将详细地对示例性实施例进行说明,其示例表示在附图中。下面的描述涉及附图时,除非另有表示,不同附图中的相同数字表示相同或相似的要素。以下示例性实施例中所描述的实施方式并不代表与本申请相一致的所有实施方式。相反,它们仅是与如所附权利要求书中所详述的、本申请的一些方面相一致的装置和方法的例子。Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, the same numerals in different drawings refer to the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with aspects of the present application as recited in the appended claims.

在本申请使用的术语是仅仅出于描述特定实施例的目的,而非旨在限制本申请。在本申请和所附权利要求书中所使用的单数形式的“一种”、“所述”和“该”也旨在包括多数形式,除非上下文清楚地表示其他含义。还应当理解,本文中使用的术语“和/或”是指并包含一个或多个相关联的列出项目的任何或所有可能组合。The terminology used in this application is for the purpose of describing particular embodiments only, and is not intended to limit the application. As used in this application and the appended claims, the singular forms "a", "the", and "the" are intended to include the plural forms as well, unless the context clearly dictates otherwise. It should also be understood that the term "and/or" as used herein refers to and includes any and all possible combinations of one or more of the associated listed items.

应当理解,尽管在本申请可能采用术语第一、第二、第三等来描述各种信息,但这些信息不应限于这些术语。这些术语仅用来将同一类型的信息彼此区分开。例如,在不脱离本申请范围的情况下,第一信息也可以被称为第二信息,类似地,第二信息也可以被称为第一信息。取决于语境,如在此所使用的词语“如果”可以被解释成为“在……时”或“当……时”或“响应于确定”。It should be understood that although the terms first, second, third, etc. may be used in this application to describe various information, the information should not be limited to these terms. These terms are only used to distinguish information of the same type from one another. For example, without departing from the scope of the present application, first information may also be called second information, and similarly, second information may also be called first information. Depending on the context, the word "if" as used herein may be interpreted as "at" or "when" or "in response to a determination."

图1为本申请根据一示例性实施例示出的现有的数据库恢复系统结构示意图,图1所示的恢复系统包括灾备管理设备、主中心的中间件和各存储设备(图1列举了3个存储设备),以及灾备中心的灾备服务器。其中,灾备管理设备可以分别与主中心和灾备中心通过网络进行交互,用于从灾备服务器获取待恢复数据库的数据(如元数据和业务数据),并发送至主中心的中间件中,并由中间件完成数据库恢复;主中心的中间件用于管理数据库,例如对数据库进行配置、监控、数据迁移、同步备份,以及处理各业务对数据库的访问(通过为各个数据库创建的实例实现),记录有数据库的元数据(例如数据库的配置信息和分库分表的路由信息)。Fig. 1 is a schematic structural diagram of an existing database restoration system shown in the present application according to an exemplary embodiment. The restoration system shown in Fig. 1 includes disaster recovery management equipment, middleware of the main center and various storage devices (Fig. 1 lists 3 storage device), and the disaster recovery server in the disaster recovery center. Among them, the disaster recovery management device can interact with the main center and the disaster recovery center through the network, and is used to obtain the data (such as metadata and business data) of the database to be restored from the disaster recovery server and send it to the middleware of the main center , and the database recovery is completed by the middleware; the middleware in the main center is used to manage the database, such as configuring, monitoring, data migration, synchronous backup of the database, and handling the access of various businesses to the database (realized by creating instances for each database ), records the metadata of the database (such as the configuration information of the database and the routing information of the sub-database and sub-table).

对于数据库的恢复,可理解为数据灾备的逆向过程,即需要保证业务数据、元数据按照要求(如恢复至哪一时间点、哪些数据库需要恢复等)恢复,并保证恢复数据的一致性。For database recovery, it can be understood as the reverse process of data disaster recovery, that is, it is necessary to ensure that business data and metadata are restored according to requirements (such as the point in time to restore, which databases need to be restored, etc.), and the consistency of restored data must be ensured.

下面结合图1,详细介绍现有技术中灾备管理设备如何与主中心的中间件交互完成数据库的恢复:The following describes in detail how the disaster recovery management device in the prior art interacts with the middleware of the main center to complete the recovery of the database in combination with Figure 1:

当灾备管理设备接收到数据库恢复指令时,基于该指令中携带的时间点和待恢复数据库的实例标识,从灾备服务器中读取并解开该时间点对应的待恢复数据库的元数据文件,以提取待恢复数据库的配置信息,并将待恢复数据库的配置信息写入主中心的中间件,以使中间件根据配置信息创建待恢复数据库的新实例,并自动生成待恢复数据库的路由信息;然后灾备管理设备再从灾备服务器读取并解开待恢复数据库的业务数据文件,以提取业务数据表,并将业务数据表写入主中心的中间件,并由中间件根据生成的路由信息,将业务数据表写入主中心的存储设备中。When the disaster recovery management device receives the database recovery command, based on the time point carried in the command and the instance identifier of the database to be recovered, it reads and unlocks the metadata file of the database to be recovered corresponding to the time point from the disaster recovery server , to extract the configuration information of the database to be restored, and write the configuration information of the database to be restored to the middleware of the main center, so that the middleware can create a new instance of the database to be restored according to the configuration information, and automatically generate the routing information of the database to be restored ; Then the disaster recovery management device reads from the disaster recovery server and untangles the business data file of the database to be recovered to extract the business data table, and writes the business data table into the middleware of the main center, and the middleware generates Routing information, write the business data table into the storage device of the main center.

由于在数据库恢复过程中,元数据写入与业务数据写入需要顺序执行,并且各个待恢复数据库的业务数据也需要根据路由信息顺序写入,Because during the database recovery process, metadata writing and business data writing need to be executed sequentially, and the business data of each database to be recovered also needs to be written sequentially according to the routing information.

在一示例性场景中,假设有10个数据库的实例需要恢复,对应的元数据文件大小有1M左右,平均每个数据库的实例对应的业务数据文件大小为50G,解开之后大小为100G,经过测试,对于元数据文件的读取、解开、写入,需要12秒-15秒,每个数据库的业务数据文件的读取、解开、写入,需要3.5小时,因此对于10个数据库的实例至少需要35个小时(一天多的时间)才能恢复完成。由此可知整个恢复过程相当耗时。In an exemplary scenario, suppose there are 10 database instances that need to be restored, and the corresponding metadata file size is about 1M. On average, the business data file size corresponding to each database instance is 50G, and the size is 100G after unlocking. In the test, it takes 12-15 seconds to read, unpack, and write metadata files, and 3.5 hours to read, unpack, and write business data files for each database. Therefore, for 10 databases It takes at least 35 hours (more than a day) for the instance to recover to complete. It can be seen that the entire recovery process is quite time-consuming.

此外,主中心的中间件除了需要处理待恢复数据库的数据写入过程,还需要处理其他业务对数据库的访问,因此主中心的中间件的处理压力比较大,尤其在需要恢复的数据量大的情况下,会严重影响业务对数据库的访问性能,降低用户使用体验。In addition, the middleware of the main center not only needs to handle the data writing process of the database to be restored, but also needs to handle other business access to the database, so the processing pressure of the middleware of the main center is relatively high, especially in the case of a large amount of data to be restored. In this case, it will seriously affect the performance of business access to the database and reduce the user experience.

基于此,图2为本申请根据一示例性实施例示出的一种数据库恢复系统结构示意图,本申请在上述图1的基础上,在主中心中增加了灾备引擎设备,该灾备引擎设备可以与灾备管理设备,以及灾备中心的灾备服务器通过网络进行交互。在进行数据库恢复过程中,灾备引擎设备基于灾备管理设备发送的恢复指令的触发,从灾备服务器获取待恢复数据库的元数据和业务数据,并分别将元数据恢复至主中心的中间件,业务数据恢复至主中心的存储设备。Based on this, FIG. 2 is a schematic structural diagram of a database recovery system according to an exemplary embodiment of the present application. On the basis of the above-mentioned FIG. 1, the present application adds a disaster recovery engine device in the main center, and the disaster recovery engine device It can interact with the disaster recovery management equipment and the disaster recovery server in the disaster recovery center through the network. In the process of database recovery, the disaster recovery engine device obtains the metadata and business data of the database to be recovered from the disaster recovery server based on the trigger of the recovery command sent by the disaster recovery management device, and restores the metadata to the middleware of the main center , business data is restored to the storage device in the main center.

由此可知,整个恢复系统在完成数据库恢复过程中,由灾备引擎设备完成数据获取及恢复,主中心的中间件专门用于处理其他业务对数据库的访问,从而本申请通过业务数据流和恢复数据流的分离,确保了业务的稳定性、可靠性。另外,由于元数据需要恢复至中间件,业务数据需要恢复至存储设备,因此灾备引擎设备对于元数据的恢复和业务数据的恢复可以同步执行恢复,互不影响,从而可以缩短恢复耗时。It can be seen that in the process of completing the database recovery of the entire recovery system, the disaster recovery engine equipment completes data acquisition and recovery, and the middleware in the main center is specially used to handle other business access to the database. The separation of data streams ensures business stability and reliability. In addition, since the metadata needs to be restored to the middleware and the business data needs to be restored to the storage device, the disaster recovery engine device can restore the metadata and business data simultaneously without affecting each other, thus shortening the recovery time.

下面以具体实施例详细介绍本申请的技术方案:Introduce the technical scheme of the present application in detail below with specific embodiment:

图3为本申请根据一示例性实施例示出的一种数据库恢复方法的实施例流程图,结合上述图2所示的数据库恢复系统结构示意图,该数据库恢复方法可以应用在主中心的灾备引擎设备(如PC机)中。本申请实施例中所涉及的数据库可以是分布式数据库。如图3所示,该数据库恢复方法包括如下步骤:Fig. 3 is a flow chart of an embodiment of a database recovery method shown in the present application according to an exemplary embodiment, combined with the structural diagram of the database recovery system shown in Fig. 2 above, the database recovery method can be applied to the disaster recovery engine of the main center device (such as a PC). The database involved in this embodiment of the present application may be a distributed database. As shown in Figure 3, the database recovery method includes the following steps:

步骤301:基于灾备管理设备发送的携带待恢复数据库的老实例的标识的恢复指令,从灾备服务器获取待恢复数据库的配置信息。Step 301: Obtain configuration information of the database to be restored from the disaster recovery server based on the restoration command sent by the disaster recovery management device and carrying the identifier of the old instance of the database to be restored.

在一实施例中,当某一业务运行异常时,可以对该业务涉及的数据库重新进行恢复,或者某用户的数据库遭到攻击破坏后,需要对该用户的数据库重新进行恢复,或者机房发生火灾,导致主中心中所有数据库的资源池烧毁,需要重新恢复该中心的所有数据库。基于此,通过向灾备管理设备输入待恢复数据库的老实例的标识,触发灾备管理设备生成恢复指令,并将生成的恢复指令发送至灾备引擎设备,从而灾备引擎设备可以接收到灾备管理设备发送的恢复指令。In one embodiment, when a certain business is running abnormally, the database involved in the business can be restored again, or after a user's database is damaged by an attack, the user's database needs to be restored again, or a fire occurs in the computer room , causing the resource pools of all databases in the main center to be burned, and all databases in the center need to be restored. Based on this, by inputting the identifier of the old instance of the database to be restored to the disaster recovery management device, the disaster recovery management device is triggered to generate a recovery command, and the generated recovery command is sent to the disaster recovery engine device, so that the disaster recovery engine device can receive the disaster recovery command. recovery command sent by the backup management device.

其中,待恢复的数据库由一个实例构成,老实例指的是备份到灾备服务器中的数据库对应的实例。本领域技术人员可以理解的是,实例的标识既可以是数字或字母,也可以是数字与字母的结合,本申请在此不进行限定。Wherein, the database to be restored consists of one instance, and the old instance refers to the instance corresponding to the database backed up to the disaster recovery server. Those skilled in the art can understand that the identifiers of examples can be numbers or letters, or a combination of numbers and letters, which is not limited in this application.

在一实施例中,针对从灾备服务器获取待恢复数据库的配置信息的过程,由于灾备服务器为了节省备份数据所占的存储空间,对于数据库的元数据的存储,通常是压缩为一个文件进行存储的,因此灾备引擎设备可以先从灾备服务器读取待恢复数据库的元数据文件,然后再解析并提取元数据文件中待恢复数据库的配置信息。In one embodiment, for the process of obtaining the configuration information of the database to be restored from the disaster recovery server, since the disaster recovery server saves the storage space occupied by the backup data, the metadata storage of the database is usually compressed into a file. Therefore, the disaster recovery engine device can first read the metadata file of the database to be restored from the disaster recovery server, and then parse and extract the configuration information of the database to be restored in the metadata file.

其中,待恢复数据库的配置信息指的是在创建数据库的实例时所需要的元数据,例如,数据库的实例规格、数据库包含的表、数据库生成时间,以及有访问权限的用户等信息。Among them, the configuration information of the database to be restored refers to the metadata required when creating the database instance, for example, the instance specification of the database, the tables contained in the database, the creation time of the database, and the users with access rights.

步骤302:利用获取的配置信息向中间件发送配置指令,以使中间件创建待恢复数据库的新实例。Step 302: Using the obtained configuration information, send a configuration instruction to the middleware, so that the middleware creates a new instance of the database to be restored.

在一实施例中,由于用户在访问数据库数据时,是通过访问中间件中的数据库的实例完成的,因此灾备引擎设备在进行数据库恢复时,需要向中间件发送配置指令,中间件利用配置指令携带的配置信息为待恢复数据库新建一个新实例,从而完成元数据的恢复。其中,中间件创建的待恢复数据库的新实例的标识可以与上述步骤301所述的老实例的标识相同,也可以不相同。In one embodiment, since the user accesses the database data through the instance of the database in the middleware, the disaster recovery engine device needs to send a configuration command to the middleware when restoring the database, and the middleware uses the configuration The configuration information carried in the command creates a new instance for the database to be restored, so as to complete the restoration of metadata. Wherein, the identifier of the new instance of the database to be restored created by the middleware may be the same as or different from the identifier of the old instance described in step 301 above.

需要说明的是,灾备引擎设备在利用获取的配置信息向中间件发送配置指令之后,还可以从元数据文件中提取中间数据表,所述中间数据表指的是在使用待恢复数据库过程中产生的数据表,并将提取的中间数据表发送至中间件创建的待恢复数据库的新实例中,从而可以确保恢复数据的一致性。It should be noted that after the disaster recovery engine device uses the obtained configuration information to send configuration instructions to the middleware, it can also extract the intermediate data table from the metadata file, and the intermediate data table refers to the process of using the database to be restored. The generated data table, and the extracted intermediate data table is sent to the new instance of the database to be restored created by the middleware, so as to ensure the consistency of the restored data.

需要进一步说明的是,灾备引擎设备在利用获取的配置信息向中间件发送配置指令之后,还可以接收中间件返回的待恢复数据库的新实例的标识,并在从元数据文件中提取中间数据表之后,再利用新实例的标识更新中间数据表中记录的老实例的标识,从而在将中间数据表恢复至中间件创建的新实例中后,能够保证业务正常运行。It should be further explained that after the disaster recovery engine device uses the obtained configuration information to send configuration instructions to the middleware, it can also receive the identification of the new instance of the database to be restored returned by the middleware, and extract the intermediate data from the metadata file After the table is created, the identifier of the new instance is used to update the identifier of the old instance recorded in the intermediate data table, so that after the intermediate data table is restored to the new instance created by the middleware, the normal operation of the business can be guaranteed.

步骤303:从灾备服务器获取待恢复数据库的业务数据表,并基于分库分表策略将获取的业务数据表写入存储设备。Step 303: Obtain the business data table of the database to be restored from the disaster recovery server, and write the obtained business data table into the storage device based on the sub-database and table sub-strategy.

在一实施例中,由于每个数据库包含多个业务数据表,且每个业务数据表所占存储空间也比较大,因此灾备服务器在备份数据库时,通常是将数据库包含的业务数据表压缩为文件进行存储,因此灾备引擎设备可以先从灾备服务器度读取待恢复数据库的业务数据文件,然后再解析业务数据文件以提取业务数据表。其中,业务数据表中记录有业务数据。In one embodiment, since each database contains multiple business data tables, and the storage space occupied by each business data table is relatively large, the disaster recovery server usually compresses the business data tables contained in the database when backing up the database. It is stored as a file, so the disaster recovery engine device can first read the business data file of the database to be restored from the disaster recovery server, and then parse the business data file to extract the business data table. Wherein, the service data is recorded in the service data table.

在一实施例中,分库分表策略可以是哈希策略,也可以是权重策略,本申请在此不进行限定。由于灾备引擎设备相对中间件无需处理其他业务,可以专门处理业务数据的写入过程,因此恢复写入耗时短。针对基于分库分表策略将获取的业务数据表写入存储设备的详细描述,可以参见下述图4所示实施例的相关描述,在此暂不详述。In an embodiment, the strategy for sub-database and table-splitting may be a hash strategy or a weight strategy, which is not limited in this application. Compared with the middleware, the disaster recovery engine device does not need to deal with other businesses, and can specifically handle the writing process of business data, so the recovery and writing time is short. For the detailed description of writing the acquired business data table into the storage device based on the sub-database sub-table strategy, refer to the related description of the embodiment shown in FIG. 4 below, which will not be described in detail here.

需要说明的是,上述步骤302和步骤303可以同步执行,以缩短数据库的恢复耗时。It should be noted that the above step 302 and step 303 can be executed synchronously, so as to shorten the time-consuming of restoring the database.

针对上述步骤301至步骤303的过程,基于上述图1所示的示例性场景,10个数据库的实例需要恢复,对应1M左右的元数据文件,平均每个数据库的实例对应的业务数据文件大小为50G,解开之后大小为100G。由于元数据的恢复和业务数据的恢复可以同步执行恢复,且元数据的文件本身并不大,因此元数据的恢复耗时可以忽略不计,只考虑业务数据的恢复耗时,经过测试,对于1个包含50G大小的业务数据文件的数据库的实例,最终恢复至存储设备,需要的耗时仅为25分钟(与现有方案相比缩短了至少3小时)。For the process from step 301 to step 303 above, based on the exemplary scenario shown in Figure 1 above, 10 database instances need to be restored, corresponding to metadata files of about 1M, and the average size of the business data files corresponding to each database instance is 50G, the size after unlocking is 100G. Since the restoration of metadata and business data can be restored simultaneously, and the metadata file itself is not large, the time-consuming of metadata restoration can be ignored. Only the time-consuming of business data restoration is considered. After testing, for 1 A database instance containing 50G business data files is finally restored to the storage device, which takes only 25 minutes (compared with the existing solution, which is shortened by at least 3 hours).

本实施例中,灾备引擎设备在接收到灾备管理设备发送的恢复指令之后,基于灾备管理设备发送的携带待恢复数据库的老实例的标识的恢复指令,从灾备服务器获取待恢复数据库的配置信息,并利用获取的配置信息向中间件发送配置指令,以使中间件创建待恢复数据库的新实例;从灾备服务器获取待恢复数据库的业务数据表,并基于分库分表策略将获取的业务数据表写入存储设备,从而完成数据库恢复。基于上述描述可知,整个数据库的恢复过程都是通过灾备引擎设备完成,使得主中心的中间件可以专门处理其他业务对数据库的访问,因此本申请相对现有技术,主中心的中间件对其他业务的处理性能至少能够提升一倍,进而提升了用户的使用体验。同时,由于灾备引擎设备专门用于进行数据库恢复过程,不需要处理其他业务,因此可以很大程度缩短恢复耗时。In this embodiment, after the disaster recovery engine device receives the recovery command sent by the disaster recovery management device, it obtains the database to be recovered from the disaster recovery server based on the recovery command sent by the disaster recovery management device and carrying the identifier of the old instance of the database to be recovered. configuration information, and use the obtained configuration information to send configuration instructions to the middleware, so that the middleware creates a new instance of the database to be restored; obtains the business data table of the database to be restored from the disaster recovery server, and based on the sub-database sub-table strategy The obtained business data table is written into the storage device, thereby completing the database restoration. Based on the above description, it can be seen that the recovery process of the entire database is completed through the disaster recovery engine device, so that the middleware of the main center can specifically handle the access of other businesses to the database. The processing performance of the business can be at least doubled, thereby improving the user experience. At the same time, since the disaster recovery engine device is specially used for the database recovery process and does not need to deal with other businesses, it can greatly shorten the recovery time.

图4为本申请根据一示例性实施例示出的另一种数据库恢复方法的实施例流程图,基于上述图3所示实施例的基础上,本实施例以如何基于分库分表策略将获取的业务数据表写入存储设备为例进行示例性说明,如图4所示,该数据库恢复方法包括如下步骤:Fig. 4 is an embodiment flow chart of another database restoration method shown in this application according to an exemplary embodiment. Based on the above-mentioned embodiment shown in Fig. 3, this embodiment uses how to obtain The business data table is written into the storage device as an example for illustration, as shown in Figure 4, the database recovery method includes the following steps:

步骤401:基于分库分表策略为各个业务数据表分配存储设备。Step 401: Allocate storage devices for each business data table based on the policy of sub-database and sub-table.

在一实施例中,由于主中心中存储设备的性能会受到业务访问量的影响,因此灾备引擎设备在将获取的业务数据表写入主中心的存储设备之前,需要基于分库分表策略为各个业务数据表分配存储设备,该分库分表策略能够综合各存储设备当前的处理能力,为其分配要写入的业务数据表。In one embodiment, since the performance of the storage device in the main center will be affected by the traffic of business visits, the disaster recovery engine device needs to use the sub-database and sub-table strategy before writing the acquired business data table into the storage device of the main center. Allocate storage devices for each business data table. The sub-database and table-splitting strategy can integrate the current processing capabilities of each storage device and allocate business data tables to be written.

步骤402:通过并行写入方式,将各个业务数据表写入对应的存储设备中。Step 402: Write each business data table into a corresponding storage device by means of parallel writing.

在一实施例中,由于每个数据库通常包含多个业务数据表,而每个数据库之间无任何关联,因此灾备引擎设备可以通过并行写入方式,将待恢复数据库的各个业务数据表写入对应的存储设备中,以进一步缩短恢复耗时。In one embodiment, since each database usually contains a plurality of business data tables, and there is no relationship between each database, the disaster recovery engine device can write each business data table of the database to be restored through parallel writing. to the corresponding storage device to further shorten the recovery time.

基于上述图1所示的示例性场景,10个待恢复数据库,对应1M左右的元数据文件,平均每个数据库的业务数据文件大小为50G,解开之后大小为100G。由于元数据的恢复和业务数据的恢复可以同步执行恢复,且元数据的文件本身并不大,因此元数据的恢复耗时可以忽略不计,只考虑业务数据的恢复耗时,经过测试,对于10个待恢复数据库,每个数据库对应有50G大小的业务数据文件,通过并行方式恢复至存储设备,需要的耗时为35-50分钟之间(不到1小时时间)。Based on the exemplary scenario shown in Figure 1 above, 10 databases to be restored correspond to metadata files of about 1M, and the average size of business data files for each database is 50G, and the size after unlocking is 100G. Since metadata recovery and business data recovery can be performed simultaneously, and the metadata file itself is not large, the time-consuming metadata recovery can be ignored. Only the time-consuming business data recovery is considered. After testing, for 10 There are two databases to be restored, and each database corresponds to a business data file of 50G in size. It takes 35-50 minutes (less than 1 hour) to restore to the storage device in parallel.

步骤403:将各个业务数据表对应的存储设备的地址发送至中间件,以使中间件利用各个业务数据表对应的存储设备的地址更新本地的路由信息。Step 403: Send the address of the storage device corresponding to each service data table to the middleware, so that the middleware uses the address of the storage device corresponding to each service data table to update local routing information.

在一实施例中,中间件本地的路由信息指的是中间件在创建待恢复数据库的新实例之后,为待恢复数据库包含的业务数据表自动生成的路由信息。由于灾备引擎设备为各业务数据表分配的存储设备的地址,与中间件本地为业务数据表生成的路由信息很有可能不一致,而业务数据表的实际写入过程是根据灾备引擎设备分配的存储设备执行的,因此需要利用灾备引擎设备分配的存储设备的地址,去更新中间件中业务数据表的路由信息,以确保数据库恢复完成后,业务能够正常访问数据库。In an embodiment, the local routing information of the middleware refers to the routing information automatically generated by the middleware for the service data table included in the database to be restored after creating a new instance of the database to be restored. Because the address of the storage device assigned by the disaster recovery engine device to each business data table is likely to be inconsistent with the routing information locally generated by the middleware for the business data table, the actual writing process of the business data table is based on the distribution of the disaster recovery engine device. Therefore, it is necessary to use the address of the storage device assigned by the disaster recovery engine device to update the routing information of the business data table in the middleware to ensure that the business can access the database normally after the database recovery is completed.

需要说明的是,由于上述步骤402是灾备引擎设备与主中心的存储设备的交互,步骤403是灾备引擎设备与中间件的交互,两个步骤互不影响,既可以同步执行,也可以顺序执行,且对步骤402和步骤403的前后执行顺序不进行限定。It should be noted that since the above step 402 is the interaction between the disaster recovery engine device and the storage device of the main center, step 403 is the interaction between the disaster recovery engine device and the middleware. The two steps do not affect each other and can be executed synchronously or It is executed sequentially, and there is no limitation on the execution sequence of step 402 and step 403 .

需要进一步说明的是,灾备引擎设备在完成数据库恢复之后,可以将恢复完成的通知消息发送至灾备管理设备,灾备管理设备可以向中间件发送数据库版本号升级指令,以使中间件更新数据库的版本号。It should be further explained that after the disaster recovery engine device completes the database recovery, it can send a recovery completion notification message to the disaster recovery management device, and the disaster recovery management device can send a database version number upgrade command to the middleware to update the middleware The version number of the database.

本实施例中,灾备引擎设备在为各个业务数据表分配存储设备后,通过并行写入方式,将业务数据表写入对应的存储设备中的,由于通常业务数据表的数据量很大,因此通过并行写入,可以进一步缩短恢复耗时。In this embodiment, after the disaster recovery engine device allocates a storage device for each business data table, the business data table is written into the corresponding storage device through a parallel writing method. Since the data volume of the business data table is generally large, Therefore, by writing in parallel, the recovery time can be further shortened.

与前述数据库恢复方法的实施例相对应,本申请还提供了数据库恢复装置的实施例。Corresponding to the foregoing embodiments of the database recovery method, the present application also provides embodiments of a database recovery device.

本申请数据库恢复装置的实施例可以应用在主中心的灾备引擎设备上。装置实施例可以通过软件实现,也可以通过硬件或者软硬件结合的方式实现。以软件实现为例,作为一个逻辑意义上的装置,是通过其所在设备的处理器将非易失性存储器中对应的计算机程序指令读取到内存中运行形成的。从硬件层面而言,如图5所示,为本申请根据一实施例性实施例示出的一种灾备引擎设备的硬件结构图,除了图5所示的处理器、内存、网络接口、以及非易失性存储器之外,实施例中装置所在的设备通常根据该设备的实际功能,还可以包括其他硬件,对此不再赘述。The embodiment of the database recovery device of the present application can be applied to the disaster recovery engine equipment of the main center. The device embodiments can be implemented by software, or by hardware or a combination of software and hardware. Taking software implementation as an example, as a device in a logical sense, it is formed by reading the corresponding computer program instructions in the non-volatile memory into the memory for operation by the processor of the device where it is located. From the perspective of hardware, as shown in Figure 5, it is a hardware structure diagram of a disaster recovery engine device shown in an exemplary embodiment of the present application, except for the processor, memory, network interface, and In addition to the non-volatile memory, the device where the device in the embodiment is located usually may also include other hardware according to the actual function of the device, which will not be repeated here.

图6为本申请根据一示例性实施例示出的一种数据库恢复装置的实施例结构图,该数据库恢复装置可以应用于主中心的灾备引擎设备,如图6所示,所述数据库恢复装置包括:Fig. 6 is a structural diagram of an embodiment of a database recovery device according to an exemplary embodiment of the present application. The database recovery device can be applied to the disaster recovery engine equipment of the main center. As shown in Fig. 6, the database recovery device include:

第一获取模块610,用于基于所述灾备管理设备发送的携带待恢复数据库的老实例的标识的恢复指令,从所述灾备服务器获取待恢复数据库的配置信息;The first acquiring module 610 is configured to acquire the configuration information of the database to be recovered from the disaster recovery server based on the recovery command sent by the disaster recovery management device and carrying the identifier of the old instance of the database to be recovered;

第一发送模块620,用于利用获取的配置信息向所述中间件发送配置指令,以使所述中间件创建待恢复数据库的新实例;The first sending module 620 is configured to use the obtained configuration information to send a configuration instruction to the middleware, so that the middleware creates a new instance of the database to be restored;

第二获取模块630,用于从所述灾备服务器获取待恢复数据库的业务数据表;The second obtaining module 630 is used to obtain the business data table of the database to be restored from the disaster recovery server;

写入模块640,用于基于分库分表策略将获取的业务数据表写入所述存储设备。The writing module 640 is configured to write the acquired business data table into the storage device based on the sub-database and sub-table policy.

在一可选的实现方式中,所述业务数据表包含多个数据表;所述写入模块640,具体用于基于分库分表策略为各个业务数据表分配存储设备;通过并行写入方式,将各个业务数据表写入对应的存储设备中。In an optional implementation, the business data table includes a plurality of data tables; the writing module 640 is specifically configured to allocate storage devices for each business data table based on the sub-database and sub-table strategy; through parallel writing , and write each service data table into a corresponding storage device.

在一可选的实现方式中,所述装置还包括(图6中未示出):In an optional implementation, the device further includes (not shown in FIG. 6):

第二发送模块,用于在所述写入模块640基于分库分表策略为各个业务数据表分配存储设备之后,将各个业务数据表对应的存储设备的地址发送至所述中间件,以使所述中间件利用各个业务数据表对应的存储设备的地址更新本地的路由信息,其中,所述本地的路由信息指的是所述中间件在创建待恢复数据库的新实例之后,为所述待恢复数据库包含的业务数据表自动生成的路由信息。The second sending module is configured to send the address of the storage device corresponding to each business data table to the middleware after the writing module 640 allocates a storage device for each business data table based on the sub-database and sub-table strategy, so that The middleware uses the address of the storage device corresponding to each service data table to update the local routing information, wherein the local routing information means that after the middleware creates a new instance of the database to be restored, The routing information automatically generated by the business data table contained in the recovery database.

在一可选的实现方式中,所述第一发送模块620与所述第二获取模块630及写入模块同步执行。In an optional implementation manner, the first sending module 620 is executed synchronously with the second obtaining module 630 and the writing module.

在一可选的实现方式中,所述第一获取模块610,具体用于从所述灾备服务器读取待恢复数据库的元数据文件;解析并提取所述元数据文件中待恢复数据库的配置信息。In an optional implementation, the first obtaining module 610 is specifically configured to read the metadata file of the database to be restored from the disaster recovery server; parse and extract the configuration of the database to be restored in the metadata file information.

在一可选的实现方式中,所述装置还包括(图6中未示出):In an optional implementation, the device further includes (not shown in FIG. 6):

中间数据表恢复模块,用于在所述第一发送模块620利用获取的配置信息向所述中间件发送配置指令之后,从所述元数据文件中提取中间数据表,所述中间数据表指的是在使用所述待恢复数据库过程中产生的数据表;将提取的中间数据表发送至所述中间件创建的待恢复数据库的新实例中。An intermediate data table recovery module, configured to extract an intermediate data table from the metadata file after the first sending module 620 uses the obtained configuration information to send a configuration instruction to the middleware, the intermediate data table refers to It is a data table generated during the process of using the database to be restored; the extracted intermediate data table is sent to the new instance of the database to be restored created by the middleware.

在一可选的实现方式中,所述装置还包括(图6中未示出):In an optional implementation, the device further includes (not shown in FIG. 6):

更新模块,用于在利用获取的配置信息向所述中间件发送配置指令之后,接收所述中间件返回的待恢复数据库的新实例的标识;在从所述元数据文件中提取中间数据表之后,利用新实例的标识更新所述中间数据表中记录的老实例的标识。An update module, configured to receive the identifier of the new instance of the database to be restored returned by the middleware after using the obtained configuration information to send the configuration instruction to the middleware; after extracting the intermediate data table from the metadata file , using the identifier of the new instance to update the identifier of the old instance recorded in the intermediate data table.

上述装置中各个单元的功能和作用的实现过程具体详见上述方法中对应步骤的实现过程,在此不再赘述。For the implementation process of the functions and effects of each unit in the above device, please refer to the implementation process of the corresponding steps in the above method for details, and will not be repeated here.

对于装置实施例而言,由于其基本对应于方法实施例,所以相关之处参见方法实施例的部分说明即可。以上所描述的装置实施例仅仅是示意性的,其中所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部模块来实现本申请方案的目的。本领域普通技术人员在不付出创造性劳动的情况下,即可以理解并实施。As for the device embodiment, since it basically corresponds to the method embodiment, for related parts, please refer to the part description of the method embodiment. The device embodiments described above are only illustrative, and the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in One place, or it can be distributed to multiple network elements. Part or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this application. It can be understood and implemented by those skilled in the art without creative effort.

本领域技术人员在考虑说明书及实践这里公开的发明后,将容易想到本申请的其它实施方案。本申请旨在涵盖本申请的任何变型、用途或者适应性变化,这些变型、用途或者适应性变化遵循本申请的一般性原理并包括本申请未公开的本技术领域中的公知常识或惯用技术手段。说明书和实施例仅被视为示例性的,本申请的真正范围和精神由下面的权利要求指出。Other embodiments of the present application will be readily apparent to those skilled in the art from consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any modification, use or adaptation of the application, these modifications, uses or adaptations follow the general principles of the application and include common knowledge or conventional technical means in the technical field not disclosed in the application . The specification and examples are to be considered exemplary only, with a true scope and spirit of the application indicated by the following claims.

还需要说明的是,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、商品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、商品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、商品或者设备中还存在另外的相同要素。It should also be noted that the term "comprises", "comprises" or any other variation thereof is intended to cover a non-exclusive inclusion such that a process, method, article, or apparatus comprising a set of elements includes not only those elements, but also includes Other elements not expressly listed, or elements inherent in the process, method, commodity, or apparatus are also included. Without further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of additional identical elements in the process, method, article or apparatus comprising said element.

以上所述仅为本申请的较佳实施例而已,并不用以限制本申请,凡在本申请的精神和原则之内,所做的任何修改、等同替换、改进等,均应包含在本申请保护的范围之内。The above is only a preferred embodiment of the application, and is not intended to limit the application. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the application should be included in the application. within the scope of protection.

Claims (15)

1. a kind of database restoring method, which is characterized in that the method is applied to the calamity at main center in present in database recovery system Standby engine apparatus, the present in database recovery system also include calamity in management equipment, the backup & disaster recovery device of Disaster Preparation Center, and master The middleware of the heart, storage device, the method includes:
Step 1: the recovery of the mark of the honest example of the carrying database to be restored sent for management equipment based on the calamity is referred to It enables, the configuration information of database to be restored is obtained from the backup & disaster recovery device;
Step 2: using obtain configuration information to the middleware send configuration-direct so that the middleware establishment wait for it is extensive The new example in complex data library;
Step 3: obtaining the business datum table of database to be restored from the backup & disaster recovery device, and divide table strategy will based on a point library The storage device is written in the business datum table of acquisition.
2. according to the method described in claim 1, it is characterized in that, the business datum table include multiple tables of data, based on point Library divides table strategy that the storage device is written in the business datum table of acquisition, including:
Table strategy is divided to be that each business datum table distributes storage device based on a point library;
By concurrent writing, each business datum table is written in corresponding storage device.
3. according to the method described in claim 2, it is characterized in that, dividing table strategy to be distributed for each business datum table based on a point library After storage device, the method further includes:
The address of the corresponding storage device of each business datum table is sent to the middleware, so that the middleware is using respectively The local routing iinformation of the address update of the corresponding storage device of a business datum table, wherein the local routing iinformation refers to Be the middleware after the new example for creating database to be restored, the business datum for including for the database to be restored The routing iinformation that table automatically generates.
4. according to the method described in claim 1, it is characterized in that, step 2 execution synchronous with the step 3.
5. according to the method described in claim 1, it is characterized in that, obtaining matching for database to be restored from the backup & disaster recovery device Confidence ceases, including:
The meta data file of database to be restored is read from the backup & disaster recovery device;
Parse and extract the configuration information of database to be restored in the meta data file.
6. according to the method described in claim 5, it is characterized in that, the configuration information using acquisition is matched to middleware transmission After setting instruction, the method further includes:
Intermediate data table is extracted from the meta data file, the intermediate data table refers to using the data to be restored The tables of data generated during library;
The intermediate data table of extraction is sent in the new example for the database to be restored that the middleware creates.
7. according to the method described in claim 6, it is characterized in that, the method further includes:
After sending configuration-direct to the middleware using the configuration information obtained, waiting for of receiving that the middleware returns is extensive The mark of the new example in complex data library;
After extracting intermediate data table in the meta data file, the intermediate data table is updated using the mark of new example The mark of the honest example of middle record.
8. a kind of present in database recovery system, which is characterized in that the system comprises:
Calamity sends the mark for the honest example for carrying database to be restored for the calamity to main center for management equipment for engine apparatus Recovery instruction;
The backup & disaster recovery device of Disaster Preparation Center, the configuration information for storing database to be restored and business datum table;
For engine apparatus, the recovery for the mark based on the honest example for carrying database to be restored instructs the calamity at main center, from The backup & disaster recovery device obtains the configuration information of database to be restored, and is sent and configured to middleware using the configuration information obtained Instruction;The business datum table of database to be restored is obtained from the backup & disaster recovery device, and divides table strategy by acquisition based on a point library The storage device at main center is written in business datum table;
The middleware at main center creates the new example of database to be restored for being based on the configuration-direct;
The storage device at main center, the business datum table being written for engine apparatus for storing the calamity.
9. a kind of database recovery device, which is characterized in that described device is applied to the calamity at main center in present in database recovery system Standby engine apparatus, the present in database recovery system also include calamity in management equipment, the backup & disaster recovery device of Disaster Preparation Center, and master The storage device of the heart, described device include:
First acquisition module, the mark of the honest example for carrying database to be restored for being sent for management equipment based on the calamity Recovery instruction, the configuration information of database to be restored is obtained from the backup & disaster recovery device;
First sending module, for sending configuration-direct to the middleware using the configuration information obtained, so that the centre Part creates the new example of database to be restored;
Second acquisition module, the business datum table for obtaining database to be restored from the backup & disaster recovery device;
Writing module, for dividing table strategy that the storage device is written in the business datum table of acquisition based on point library.
10. device according to claim 9, which is characterized in that the business datum table includes multiple tables of data;
Said write module divides table strategy to be that each business datum table distributes storage device specifically for being based on a point library;By simultaneously Each business datum table is written in corresponding storage device row writing mode.
11. device according to claim 10, which is characterized in that described device further includes:
Second sending module, for dividing table strategy to be that the distribution storage of each business datum table is set based on a point library in said write module After standby, the address of the corresponding storage device of each business datum table is sent to the middleware, so that the middleware is sharp With the local routing iinformation of the address update of the corresponding storage device of each business datum table, wherein the local routing letter Breath refers to the middleware after the new example for creating database to be restored, the business for including for the database to be restored The routing iinformation that tables of data automatically generates.
12. device according to claim 9, which is characterized in that first sending module and second acquisition module And writing module is synchronized and is executed.
13. device according to claim 9, which is characterized in that first acquisition module is specifically used for standby from the calamity Server reads the meta data file of database to be restored;It parses and extracts matching for database to be restored in the meta data file Confidence ceases.
14. device according to claim 13, which is characterized in that described device further includes:
Intermediate data table recovery module, for being sent out to the middleware using the configuration information obtained in first sending module After sending configuration-direct, intermediate data table is extracted from the meta data file, the intermediate data table is referred to using institute State the tables of data generated in data base procedure to be restored;The intermediate data table of extraction waiting for of being sent to that the middleware creates is extensive In the new example in complex data library.
15. device according to claim 14, which is characterized in that described device further includes:
Update module, after sending configuration-direct to the middleware in the configuration information for utilizing acquisition, during reception is described Between part return database to be restored new example mark;From in the meta data file extract intermediate data table after, The mark of the honest example recorded in the intermediate data table is updated using the mark of new example.
CN201810478366.8A 2018-05-18 2018-05-18 A database recovery method, device and system Active CN108762982B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201810478366.8A CN108762982B (en) 2018-05-18 2018-05-18 A database recovery method, device and system
CN201910849759.XA CN110647425A (en) 2018-05-18 2018-05-18 Database recovery method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810478366.8A CN108762982B (en) 2018-05-18 2018-05-18 A database recovery method, device and system

Related Child Applications (1)

Application Number Title Priority Date Filing Date
CN201910849759.XA Division CN110647425A (en) 2018-05-18 2018-05-18 Database recovery method and device

Publications (2)

Publication Number Publication Date
CN108762982A true CN108762982A (en) 2018-11-06
CN108762982B CN108762982B (en) 2019-09-17

Family

ID=64007300

Family Applications (2)

Application Number Title Priority Date Filing Date
CN201810478366.8A Active CN108762982B (en) 2018-05-18 2018-05-18 A database recovery method, device and system
CN201910849759.XA Pending CN110647425A (en) 2018-05-18 2018-05-18 Database recovery method and device

Family Applications After (1)

Application Number Title Priority Date Filing Date
CN201910849759.XA Pending CN110647425A (en) 2018-05-18 2018-05-18 Database recovery method and device

Country Status (1)

Country Link
CN (2) CN108762982B (en)

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110888760A (en) * 2019-11-26 2020-03-17 中国工商银行股份有限公司 Data recovery method and device, and data processing method and device
CN111367888A (en) * 2020-03-03 2020-07-03 杭州安恒信息技术股份有限公司 Database verification method, verification system and related device
CN112433878A (en) * 2020-12-18 2021-03-02 深圳昂楷科技有限公司 Method and device for recovering data in damaged relational database
CN113419896A (en) * 2020-07-24 2021-09-21 阿里巴巴集团控股有限公司 Data recovery method and device, electronic equipment and computer readable medium
CN114079670A (en) * 2020-07-30 2022-02-22 华为技术有限公司 Method, device and communication system for transmitting routing information
CN114780639A (en) * 2022-04-21 2022-07-22 天津银行股份有限公司 Core system construction method based on double-database parallelism
CN115016985A (en) * 2022-06-27 2022-09-06 平安付科技服务有限公司 Data sub-database method and system
CN115061855A (en) * 2022-06-27 2022-09-16 杭州谐云科技有限公司 Backup method and system for distributed middleware
CN115168008A (en) * 2022-07-21 2022-10-11 平安壹钱包电子商务有限公司 Database dynamic switching method and system

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103838755A (en) * 2012-11-23 2014-06-04 景幂机械(上海)有限公司 Remote heterogeneous disaster tolerant system of database
US9858162B2 (en) * 2015-10-23 2018-01-02 International Business Machines Corporation Creation of a provisioning environment based on probability of events

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8548959B2 (en) * 2010-11-29 2013-10-01 Ca, Inc. System and method for minimizing data recovery window
CN102156720A (en) * 2011-03-28 2011-08-17 中国人民解放军国防科学技术大学 Method, device and system for restoring data
CN103838646B (en) * 2014-02-13 2017-10-20 中国科学院国家天文台 A kind of system and method for Ground Application big data disaster-tolerant backup
CN105224637A (en) * 2015-09-24 2016-01-06 珠海许继芝电网自动化有限公司 A kind of based on PostgreSQL database active and standby/the comprehensive method of cluster application

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103838755A (en) * 2012-11-23 2014-06-04 景幂机械(上海)有限公司 Remote heterogeneous disaster tolerant system of database
US9858162B2 (en) * 2015-10-23 2018-01-02 International Business Machines Corporation Creation of a provisioning environment based on probability of events

Cited By (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110888760A (en) * 2019-11-26 2020-03-17 中国工商银行股份有限公司 Data recovery method and device, and data processing method and device
CN111367888A (en) * 2020-03-03 2020-07-03 杭州安恒信息技术股份有限公司 Database verification method, verification system and related device
CN111367888B (en) * 2020-03-03 2023-04-11 杭州安恒信息技术股份有限公司 Database checking method, checking system and related devices
CN113419896A (en) * 2020-07-24 2021-09-21 阿里巴巴集团控股有限公司 Data recovery method and device, electronic equipment and computer readable medium
CN113419896B (en) * 2020-07-24 2023-12-22 阿里巴巴集团控股有限公司 Data recovery method, device, electronic equipment and computer readable medium
CN114079670A (en) * 2020-07-30 2022-02-22 华为技术有限公司 Method, device and communication system for transmitting routing information
CN112433878A (en) * 2020-12-18 2021-03-02 深圳昂楷科技有限公司 Method and device for recovering data in damaged relational database
CN114780639A (en) * 2022-04-21 2022-07-22 天津银行股份有限公司 Core system construction method based on double-database parallelism
CN115016985A (en) * 2022-06-27 2022-09-06 平安付科技服务有限公司 Data sub-database method and system
CN115061855A (en) * 2022-06-27 2022-09-16 杭州谐云科技有限公司 Backup method and system for distributed middleware
CN115168008A (en) * 2022-07-21 2022-10-11 平安壹钱包电子商务有限公司 Database dynamic switching method and system

Also Published As

Publication number Publication date
CN110647425A (en) 2020-01-03
CN108762982B (en) 2019-09-17

Similar Documents

Publication Publication Date Title
CN108762982B (en) A database recovery method, device and system
US11467755B2 (en) Method and system for enabling agentless backup and restore operations on a container orchestration platform
US10310949B1 (en) Disaster restore of big data application with near zero RTO
US9442952B2 (en) Metadata structures and related locking techniques to improve performance and scalability in a cluster file system
US11321291B2 (en) Persistent version control for data transfer between heterogeneous data stores
US10152387B1 (en) Instant start of virtual machine from archive copy on backup media
US11907261B2 (en) Timestamp consistency for synchronous replication
WO2019154394A1 (en) Distributed database cluster system, data synchronization method and storage medium
CN107544871A (en) A kind of disk backup method of virtue machine and device
TW200303468A (en) Deferred copy-on-write of a snapshot
US11079960B2 (en) Object storage system with priority meta object replication
US10587685B2 (en) Cross-platform replication of logical units
US11341159B2 (en) In-stream data load in a replication environment
US11150981B2 (en) Fast recovery from failures in a chronologically ordered log-structured key-value storage system
WO2024078211A1 (en) Backup method for service cluster instance, recovery method for service cluster instance, and related device
US11093465B2 (en) Object storage system with versioned meta objects
US9485308B2 (en) Zero copy volume reconstruction
US11074002B2 (en) Object storage system with meta object replication
CN114328007A (en) Container backup and restoration method, device and medium thereof
CN115878386A (en) Disaster recovery method and device, electronic equipment and storage medium
CN108984356A (en) A kind of IT product test method and device
CN108959533A (en) The snapshot update management method and system of Metadata Service cluster
CN109558205B (en) Disk access method and device
CN116684282B (en) Method and device for initializing newly-added cloud server and computer equipment
CN118520051B (en) Data synchronization method and electronic equipment

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