Database Disaster Recovery System Construction Method and Device
Through the automated database disaster recovery system construction method on the cloud platform, the problem of high complexity in building the Oracle database ADG system is solved, and efficient and automated disaster recovery system construction is achieved.
Patent Information
- Application Number
- CN202111601421.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-24
- Publication Date
- 2025-06-27
- Estimated Expiration
- 2041-12-24
AI Technical Summary
The active data protection (ADG) system for Oracle databases is complex, and it requires manual data filling and operation configuration on the main and backup machines, resulting in high complexity.
Through the automated database disaster recovery system construction method on the cloud platform, the basic information of the user configured main library and backup library are obtained, verification information is automatically obtained from the host side, database construction scripts are issued, and the host is controlled to perform the configuration operation based on the disaster recovery construction specification.
The complexity of the construction of the database disaster recovery system is reduced. Users only need to provide basic information, and the cloud platform automatically completes the construction process, improving efficiency and reliability.
Smart Images

Figure CN114238284B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of database technologies, and in particular, to a method and device for constructing a disaster recovery system for an Oracle database. Background Art
[0002] In order to improve the security and reliability of an Oracle database, it is necessary to construct a disaster recovery system for the Oracle database. For example, the Active Data Guard (ADG) system is a commonly used disaster recovery architecture for Oracle databases currently. Through this disaster recovery architecture, it can be ensured that when an exception occurs at the primary site of the Oracle database, an emergency switch is made to the standby ADG site to continue providing services.
[0003] However, when building an ADG system, a series of data filling and operation configurations need to be manually performed on the primary machine where the primary database in the ADG system is located and the standby machine where the standby database is located respectively, making the complexity of building this disaster recovery system, namely the ADG system, relatively high. Summary of the Invention
[0004] In view of this, this application provides a method and device for constructing a database disaster recovery system to reduce the complexity of constructing a database disaster recovery system.
[0005] To achieve the above object, this application provides a method for constructing a database disaster recovery system, which is applied to a cloud platform and includes:
[0006] Obtain the basic information of the primary database and the basic information of the standby database configured by the user. The basic information of the primary database includes at least: the identification information of the first host for deploying the primary database, and the basic information of the standby database includes at least: the identification information of the second host for deploying the standby database;
[0007] Based on the identification information of the first host, obtain the primary database verification information for verifying the primary database from the first host;
[0008] Based on the identification information of the second host, obtain the standby database verification information for verifying the standby database from the second host;
[0009] If it is confirmed based on the primary database verification information that the first host meets the conditions for building the primary database, and it is confirmed based on the standby database verification information that the second host meets the conditions for building the standby database, send database building scripts to the first host and the second host respectively;
[0010] Based on the configured disaster recovery building specifications and the database building scripts on the first host and the second host, control the first host to perform the configuration operation for installing the primary database, and control the second host to perform the configuration operation for installing the standby database.
[0011] Optionally, the primary database basic information further includes: a first condition that the capacity of the primary database needs to meet;
[0012] The standby database basic information further includes: a second condition that the capacity of the standby database needs to meet;
[0013] Obtaining, from the first host, primary database verification information for verifying the primary database based on the identification information of the first host includes:
[0014] Based on the identification information of the first host, obtaining the size of the primary database disk group available for the primary database from the first host;
[0015] Obtaining, from the second host, standby database verification information for verifying the standby database based on the identification information of the second host includes:
[0016] Based on the identification information of the second host, obtaining the size of the standby database disk group available for the standby database from the second host;
[0017] Before respectively sending the database construction scripts to the first host and the second host, it further includes:
[0018] Detecting whether the size of the primary database disk group meets the first condition and the size of the standby database disk group meets the second condition;
[0019] Confirming that the first host meets the primary database construction conditions based on the primary database verification information, and confirming that the second host meets the standby database construction conditions based on the standby database verification information includes:
[0020] The size of the primary database disk group meets the first condition and the size of the standby database disk group meets the second condition.
[0021] Optionally, if it is confirmed that the first host meets the primary database construction conditions based on the primary database verification information, and it is confirmed that the second host meets the standby database construction conditions based on the standby database verification information, sending the database construction scripts to the first host and the second host respectively includes:
[0022] If it is confirmed that the first host meets the primary database construction conditions based on the primary database verification information, and it is confirmed that the second host meets the standby database construction conditions based on the standby database verification information, detecting whether the parameters that need to be restarted to take effect in the first host have been modified;
[0023] If the parameters that need to be restarted to take effect in the first host have been modified, sending the database construction scripts to the first host and the second host respectively.
[0024] Optionally, the database deployment script includes a database script for installing the database and a database setup tool script;
[0025] The disaster recovery setup specification based on the configuration and the database deployment scripts running on the first host and the second host control the first host to perform the deployment configuration operation of the primary database, and control the second host to perform the deployment configuration operation of the standby database, including:
[0026] Instruct the first host and the second host to respectively perform database installation and deployment based on the database script, so as to deploy the primary database on the first host and the standby database on the second host;
[0027] According to multiple disaster recovery setup items configured and the order between the multiple disaster recovery setup items, sequentially control the first host to perform the deployment configuration operation of the primary database based on the database setup tool script according to the setup configuration operations indicated by each disaster recovery setup item, and control the second host to perform the deployment configuration operation of the standby database based on the database setup tool script.
[0028] Optionally, after controlling the first host to perform the deployment configuration operation of the primary database and controlling the second host to perform the deployment configuration operation of the standby database, it further includes:
[0029] Clean up the disaster recovery deployment configuration data cached in the cloud platform related to the first host and the second host.
[0030] In another aspect, the present application also provides a database disaster recovery system construction device, which is applied to a cloud platform and includes:
[0031] An information acquisition unit, configured to acquire the primary database basic information and the standby database basic information configured by the user, where the primary database basic information at least includes: the identification information of the first host for deploying the primary database, and the standby database basic information at least includes: the identification information of the second host for deploying the standby database;
[0032] A primary verification information acquisition unit, configured to acquire, from the first host, the primary database verification information for verifying the primary database based on the identification information of the first host;
[0033] A standby verification information acquisition unit, configured to acquire, from the second host, the standby database verification information for verifying the standby database based on the identification information of the second host;
[0034] A script distribution unit, configured to, if it is confirmed based on the master database verification information that the first host meets the conditions for building a primary database, and it is confirmed based on the standby database verification information that the second host meets the conditions for building a standby database, distribute database building scripts to the first host and the second host respectively;
[0035] A building configuration unit, configured to control the first host to perform the loading and configuration operations of the primary database, and control the second host to perform the loading and configuration operations of the standby database, based on the configured disaster recovery building specifications and the database building scripts on the first host and the second host.
[0036] Optionally, the master database basic information obtained by the information obtaining unit further includes: a first condition that the capacity of the primary database needs to meet;
[0037] The standby database basic information obtained by the information obtaining unit further includes: a second condition that the capacity of the standby database needs to meet;
[0038] The master verification information obtaining unit includes:
[0039] A first obtaining subunit, configured to obtain the size of the master database disk group available for the primary database from the first host based on the identification information of the first host;
[0040] The standby verification information obtaining unit includes:
[0041] A second obtaining subunit, configured to obtain the size of the standby database disk group available for the standby database from the second host based on the identification information of the second host;
[0042] The apparatus further includes:
[0043] A verification unit, configured to detect whether the size of the master database disk group meets the first condition and the size of the standby database disk group meets the second condition before the script distribution unit distributes database building scripts to the first host and the second host respectively;
[0044] The building configuration unit is specifically configured to control the first host to perform the loading and configuration operations of the primary database, and control the second host to perform the loading and configuration operations of the standby database, if the size of the master database disk group meets the first condition and the size of the standby database disk group meets the second condition.
[0045] Optionally, the building configuration unit includes:
[0046] A parameter verification subunit, configured to detect whether the parameters that need to be restarted to take effect in the first host have been modified if it is confirmed based on the master library verification information that the first host meets the conditions for building a primary database and it is confirmed based on the standby library verification information that the second host meets the conditions for building a standby database;
[0047] A building configuration subunit, configured to send database building scripts to the first host and the second host respectively if the parameters that need to be restarted to take effect in the first host have been modified.
[0048] Optionally, the database building script sent by the script sending unit includes a database script for installing a database and a database building tool script;
[0049] The building configuration subunit includes:
[0050] An installation instruction subunit, configured to instruct the first host and the second host to perform database installation and deployment based on the database script respectively, so as to deploy a primary database on the first host and a standby database on the second host;
[0051] A control subunit, configured to control the first host to perform the building and configuration operation of the primary database based on the database building tool script and control the second host to perform the building and configuration operation of the standby database based on the database building tool script according to a plurality of disaster tolerance building items configured and the order between the plurality of disaster tolerance building items, and perform the building and configuration operations of the corresponding disaster tolerance building items in sequence.
[0052] Optionally, it further includes:
[0053] A data cleaning unit, configured to clean the disaster tolerance building configuration data cached in the cloud platform related to the first host and the second host after the building configuration subunit controls the first host to perform the building and configuration operation of the primary database and controls the second host to perform the building and configuration operation of the standby database.
[0054] As can be seen from the above, after the cloud platform in this application obtains the basic information of the primary database and the standby database configured by the user, it can automatically obtain the primary database verification information for verifying the primary database from the first host side based on the identification information of the first host used to deploy the primary database in the master control basic information; at the same time, according to the identification information of the second host used to deploy the standby database in the standby database basic information, it can automatically obtain the standby database verification information for verifying the standby database from the second host side. On this basis, when the cloud platform verifies that the first host meets the conditions for building the primary database and the second host meets the conditions for building the standby database based on the obtained primary database verification information and standby database verification information, it can send the database building script to the first host and the second host, and control the first host and the second host to perform the configuration operations related to the construction of the disaster recovery system based on the disaster recovery construction specifications configured by the cloud platform. Thus, it can be seen that during the construction process of the database disaster recovery system, the user only needs to provide the basic information of the primary database and the standby database, without having to perform complex configurations such as disaster recovery construction on the host separately, and can complete the construction of the database disaster recovery system with the help of the cloud platform, greatly reducing the complexity. BRIEF DESCRIPTION OF THE DRAWINGS
[0055] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for the description of the embodiments will be briefly introduced below. Obviously, the drawings in the following description are only the embodiments of the present application. For those of ordinary skill in the art, other drawings can be obtained according to the provided drawings without creative efforts.
[0056] Figure 1 FIG. shows a schematic flow chart of a method for constructing a database disaster recovery system provided by an embodiment of the present application;
[0057] Figure 2 FIG. shows a schematic composition structure diagram of a database disaster recovery system construction device provided by an embodiment of the present application. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0058] The solution of the present application is applicable to constructing a database disaster recovery system, and there are various possibilities for the database of the present application.
[0059] In a possible implementation manner, the databases mentioned in the present application can all refer to Oracle databases. For example, the primary database can be a primary Oracle database, and the standby database can be a standby Oracle database. Correspondingly, the disaster recovery system in the present application can be the ADG architecture of the Oracle database disaster recovery system. Oracle ADG is a database disaster recovery solution, which means that multiple databases can have the same data. Once a certain database fails, it can be quickly switched to another database. At the same time, read-write separation can also be achieved, with the primary database for writing and the standby database for reading, etc.
[0060] Next, in combination with the accompanying drawings in the embodiments of the present application, the technical solutions in the embodiments of the present application will be clearly and completely described. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present application.
[0061] As shown in Figure 1 the figure, it shows a schematic structural diagram of the composition of an embodiment of a method for constructing a database disaster recovery system of the present application. The device in this embodiment can be applied to a cloud platform, and this cloud platform is a cloud server system independent of the database disaster recovery system to be built.
[0062] The method in this embodiment may include:
[0063] S101, obtain the basic information of the primary database and the basic information of the standby database configured by the user.
[0064] Among them, the basic information of the primary database at least includes: the identification information of the first host for deploying the primary database, and the identification information of the second host for deploying the standby database.
[0065] Among them, for the sake of easy distinction, the host for deploying the primary database in the database disaster recovery system is called the first host, and the host for deploying the standby database is called the second host.
[0066] Among them, the identification information of the first host may be the IP address of the first host, or other identification information that can uniquely identify the first host. Similarly, the identification information of the second host may be identification information such as the IP address of the second host.
[0067] As an alternative, the basic information of the primary database may further include: the first condition that the capacity of the primary database needs to meet. For example, the first condition may be that the disk group capacity of the primary database exceeds a set capacity value, etc. Similarly, the basic information of the standby database may include: the second condition that the capacity of the standby database needs to meet. The second condition may be the capacity value that the disk group capacity of the primary database needs to reach or exceed.
[0068] It can be understood that in actual applications, the basic information of the primary database and the basic information of the standby database configured by the user may also include some basic parameters required for subsequent deployment of the primary database and the standby database, etc., and there is no limitation on this.
[0069] It is understandable that the information of the hosts available for deploying the disaster recovery system can also be pre-configured on the cloud platform. On this basis, the user can log in to the cloud platform through the terminal and select the information of the primary database and the standby database from the host selection interface provided by the cloud platform.
[0070] It is understandable that in this application, in addition to constructing the database disaster recovery system on the cloud platform, other content orchestration operations can also be performed. Therefore, in this application, the user can trigger a disaster recovery setup request to the cloud platform by selecting the template to be executed in the cloud platform.
[0071] For example, taking the setup of ADG as an example, referring to Table 1 below, it is a table of some configuration operations that the user can perform based on the cloud platform in this application.
[0072] Table 1
[0073]
[0074] As shown in Table 1, the user can first select the template for setting up the disaster recovery ADG, so that the cloud platform executes according to the ADG setup template to obtain the parameters configured by the user and subsequent operations, etc.
[0075] As can be seen from Table 1, there can be multiple numbers of hosts selected by the user in this application. Therefore, there can be multiple hosts as the standby database. After the user selects the primary, in order to achieve high availability, the selected multiple hosts can also be grouped to build a disaster recovery system.
[0076] In Table 1, the parameters entered by the user into the cloud platform can include the parameters related to the capacity verification of the primary and standby databases, as well as the virtual IP address (VIP address) of the standby database, and there can also be some parameters of combined attributes, etc.
[0077] In particular, from the content of item 5 in Table 1, it can be seen that the cloud platform can also preview and output the basic information of the primary and standby databases configured by the user, so that the user can preview and select or enter the information.
[0078] It is understandable that in this application, before setting up a disaster recovery system such as ADG, the user can also perform some preparatory work offline to ensure that the cloud platform can successfully complete the setup of the disaster recovery system subsequently. It is similar to the conventional preparatory work before setting up the disaster recovery system. For example, before setting up the ADG disaster recovery system, the user can perform some preparatory operations according to Table 2.
[0079] Table 2
[0080]
[0081] Among them, in Table 2 above, the operation refers to some preparatory operations that the user needs to perform before building the ADG, and the object is whether the main database or the standby database that an operation targets. In Table 2, the main database refers to the primary database, and the standby database refers to the standby database. For example, building the ADG may cause product defects, so it is necessary to check whether patches are installed for the versions of the primary database and the standby database during the build.
[0082] S102, based on the identification information of the first host, obtain the primary database verification information for verifying the primary database from the first host.
[0083] S103, based on the identification information of the second host, obtain the standby database verification information for verifying the standby database from the second host.
[0084] For example, according to the identification information such as the IP address of the first host, obtain the size of the disk group in the first host that is used as the primary database (or the primary database is available). For the sake of distinction, the disk group in the first host that is used as the primary database is called the primary disk group, and the size of the primary disk group represents the capacity of the primary disk group.
[0085] Correspondingly, based on the identification information of the second host, the size of the standby disk group available for the standby database can be obtained from the second host. The size of the standby disk group is the size of the standby disk group in the second host that is used as the storage space for the standby database.
[0086] On this basis, the present application can detect whether the size of the primary disk group meets the first condition and the size of the standby disk group meets the second condition to determine whether the first host and the second host meet the conditions for building the database disaster recovery system.
[0087] It can be understood that the above takes two cases of the primary database verification information and the standby database verification information as examples. The primary database verification information and the standby database verification information may also include other parameter information required for pre-verification during the construction of disaster recovery systems such as ADG according to needs, and there is no limitation on this.
[0088] S104, if it is confirmed based on the primary database verification information that the first host meets the primary database building conditions, and it is confirmed based on the standby database verification information that the second host meets the standby database building conditions, send the database building script to the first host and the second host respectively.
[0089] It can be understood that the primary database building conditions and the standby database building conditions are the pre-verification conditions for the primary database and the standby database in building the disaster recovery system. These two conditions can be set according to the characteristics of the disaster recovery system. Based on the differences between the primary database verification information and the standby database verification information, the corresponding building conditions may also vary.
[0090] In a possible implementation, as described above, if it is detected that the size of the main database disk group meets the first condition and the size of the standby database disk group meets the second condition, it can be determined that the first host meets the conditions for building the primary database and the second host meets the conditions for building the standby database.
[0091] It can be understood that in practical applications, before building the disaster recovery system of the database, parameter pre-checks can also be performed on the first host used to deploy the primary database. Correspondingly, after it is confirmed that the first host and the second host respectively meet the database building conditions corresponding to them, it can also be detected whether the parameters that need to be restarted to take effect in the first host have been modified. Among them, the information of the parameters that need to be restarted to take effect in the first host can be preset and stored in the cloud platform, or this part of the information can be included in the basic information of the main database configured in the user configuration interface, and there is no limit to this.
[0092] If the parameters that need to be restarted to take effect in the first host have not been modified, a reminder needs to be output to prompt the user; or, the cloud platform controls the first host to modify the parameters that need to be restarted to take effect.
[0093] Correspondingly, if the parameters that need to be restarted to take effect in the first host have been modified, database building scripts are sent to the first host and the second host respectively. Among them, the database building scripts are some scripts required to install the database and complete the disaster recovery system configuration on the first host and the second host side.
[0094] S105, based on the configured disaster recovery building specifications and the database building scripts on the first host and the second host, control the first host to perform the mounting configuration operation of the primary database, and control the second host to perform the mounting configuration operation of the standby database.
[0095] Among them, the disaster recovery building specifications can define information such as multiple operations and their operation contents required for building the database disaster recovery system. Based on this, this application can perform corresponding operations in sequence according to the disaster recovery building specifications.
[0096] It can be understood that in the process of building the disaster recovery system according to the operations defined in the disaster recovery building specifications, the first host and the second host need to perform relevant configuration operations required for the building. In this application, the corresponding database building scripts have been configured in the first host and the second host, and the first host and the second host can perform relevant building configuration operations in combination with the operation instructions of the cloud platform and the database building scripts.
[0097] For example, in a possible implementation, the database deployment script includes a database script for installing a database and a database setup tool script. Correspondingly, the cloud platform can instruct the first host and the second host to perform database installation and deployment respectively based on the database script, so as to deploy the primary database on the first host and the standby database on the second host.
[0098] On this basis, the cloud platform can, according to multiple disaster recovery setup items configured and the order among the multiple disaster recovery setup items, sequentially control the first host to perform the setup and configuration operation of the primary database based on the database setup tool script according to the setup and configuration operations indicated by each disaster recovery setup item, and control the second host to perform the setup and configuration operation of the standby database based on the database setup tool script.
[0099] Among them, each disaster recovery setup item corresponds to an operation required for setting up a disaster recovery system.
[0100] For example, taking the example of setting up an ADG system for an Oracle database, the specifications for setting up ADG publicly disclosed by Oracle can determine the disaster recovery setup operations required for setting up ADG. For example, during the process of setting up ADG, relatively key operations may include detecting the Network Attached Storage (NAS) mount parameters on the first host, modifying the archive backup script on the first host, and adding standby logs on the first host, etc.
[0101] For example, some key operations involved in setting up the ADG system are listed in Table 3.
[0102] Table 3
[0103]
[0104]
[0105] Among them, the operation corresponding to each serial number in Table 3 is an operation content required to be pointed to during the process of setting up ADG, and the "object" corresponding to each operation is the node or device targeted by the content of the completed operation. Among them, the "primary database node" represents the node where the primary database is deployed, and the "standby database node" represents the node where the standby database is deployed. The column "Description" in Table 3 is some operation descriptions for each operation. For example, the description of "Modify TNSNAMES" in Table 3 is "Modify the TNS file and test whether the standby database is reachable, and the VIP address of the standby database is required", which means that a TNS connection needs to be established on the primary database node and the connection needs to be checked for connectivity.
[0106] Of course, Table 3 only lists some main operations for setting up ADG, and there may be other operation contents involved in actual applications, which are not restricted here.
[0107] As can be seen from the above, after the cloud platform in this application obtains the basic information of the primary database and the basic information of the standby database configured by the user, it can automatically obtain the primary database verification information for verifying the primary database from the first host side based on the identification information of the first host used to deploy the primary database in the master control basic information; at the same time, based on the identification information of the second host used to deploy the standby database in the standby database basic information, it automatically obtains the standby database verification information for verifying the standby database from the second host side. On this basis, when the cloud platform verifies that the first host meets the conditions for building the primary database and the second host meets the conditions for building the standby database based on the obtained primary database verification information and standby database verification information, it can send the database building script to the first host and the second host, and control the first host and the second host to perform the configuration operations related to the construction of the disaster recovery system based on the disaster recovery construction specifications configured by the cloud platform. Thus, it can be seen that during the construction process of the database disaster recovery system, the user only needs to provide the basic information of the primary database and the standby database, and does not need to perform complex configurations such as disaster recovery construction on the host separately, and can complete the construction of the database disaster recovery system with the help of the cloud platform, greatly reducing the complexity.
[0108] It can be understood that in this application, after controlling the first host to perform the configuration operation of installing the primary database and controlling the second host to perform the configuration operation of installing the standby database, it can also:
[0109] Clean up the disaster recovery installation configuration data cached in the cloud platform related to the first host and the second host. For example, some database basic information cached in the cloud platform, relevant parameters obtained from the host, relevant scripts and data generated during the installation process, etc.
[0110] Corresponding to a method for constructing a database disaster recovery system in this application, this application also provides a device for constructing a database disaster recovery system.
[0111] As Figure 2 shown, it shows a schematic diagram of a composition structure of the device for constructing a database disaster recovery system provided by this application. This device is applied to the cloud platform and includes:
[0112] An information acquisition unit 201, configured to acquire the basic information of the primary database and the basic information of the standby database configured by the user. The basic information of the primary database at least includes: the identification information of the first host used to deploy the primary database, and the basic information of the standby database at least includes: the identification information of the second host used to deploy the standby database;
[0113] A primary verification information acquisition unit 202, configured to obtain the primary database verification information for verifying the primary database from the first host based on the identification information of the first host;
[0114] A standby verification information acquisition unit 203, configured to obtain standby database verification information for verifying a standby database from the second host based on the identification information of the second host;
[0115] A script distribution unit 204, configured to, if it is confirmed based on the primary database verification information that the first host meets the primary database construction condition and it is confirmed based on the standby database verification information that the second host meets the standby database construction condition, distribute database construction scripts to the first host and the second host respectively;
[0116] A construction configuration unit 205, configured to control the first host to perform the installation and configuration operation of the primary database and control the second host to perform the installation and configuration operation of the standby database based on the configured disaster recovery construction specification and the database construction scripts on the first host and the second host.
[0117] In a possible implementation manner, the primary database basic information obtained by the information acquisition unit further includes: a first condition that the capacity of the primary database needs to meet;
[0118] The standby database basic information obtained by the information acquisition unit further includes: a second condition that the capacity of the standby database needs to meet;
[0119] The primary verification information acquisition unit includes:
[0120] A first acquisition subunit, configured to obtain the size of the primary database disk group available for the primary database from the first host based on the identification information of the first host;
[0121] The standby verification information acquisition unit includes:
[0122] A second acquisition subunit, configured to obtain the size of the standby database disk group available for the standby database from the second host based on the identification information of the second host;
[0123] The apparatus further includes:
[0124] A verification unit, configured to detect whether the size of the primary database disk group meets the first condition and the size of the standby database disk group meets the second condition before the script distribution unit distributes database construction scripts to the first host and the second host respectively;
[0125] The construction configuration unit is specifically configured to control the first host to perform the installation and configuration operation of the primary database and control the second host to perform the installation and configuration operation of the standby database if the size of the primary database disk group meets the first condition and the size of the standby database disk group meets the second condition.
[0126] In another possible implementation manner, the construction configuration unit includes:
[0127] A parameter verification subunit, configured to detect whether the parameters that need to be restarted to take effect in the first host have been modified if it is confirmed based on the master database verification information that the first host meets the master database setup conditions and it is confirmed based on the standby database verification information that the second host meets the standby database setup conditions;
[0128] A setup configuration subunit, configured to send database setup scripts to the first host and the second host respectively if the parameters that need to be restarted to take effect in the first host have been modified.
[0129] In another possible implementation manner, the database installation script sent by the script sending unit includes a database script for installing a database and a database setup tool script;
[0130] The setup configuration subunit includes:
[0131] An installation instruction subunit, configured to instruct the first host and the second host to perform database installation and deployment respectively based on the database script, so as to deploy a master database on the first host and a standby database on the second host;
[0132] A control subunit, configured to control the first host to perform the setup and configuration operation of the master database based on the database setup tool script, and control the second host to perform the setup and configuration operation of the standby database based on the database setup tool script, according to a plurality of disaster recovery setup items configured and the order between the plurality of disaster recovery setup items, and sequentially performing the setup and configuration operations indicated by each disaster recovery setup item.
[0133] In another possible implementation manner, it further includes:
[0134] A data cleaning unit, configured to clean the disaster recovery setup configuration data cached in the cloud platform related to the first host and the second host after the setup configuration subunit controls the first host to perform the setup and configuration operation of the master database and controls the second host to perform the setup and configuration operation of the standby database.
[0135] It should be noted that the various embodiments in this specification are described in a progressive manner. Each embodiment focuses on the differences from other embodiments. The same or similar parts among the various embodiments can be referred to each other. At the same time, the features recorded in the various embodiments in this specification can be replaced or combined with each other, enabling those skilled in the art to implement or use this application. For the device embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can refer to the partial description of the method embodiments.
[0136] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.
[0137] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.
[0138] The above are only preferred implementations of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.
Claims
1. A method for constructing a database disaster recovery system, characterized in that, Applied to a cloud platform, including: Obtaining the basic information of the primary database and the standby database configured by the user. The basic information of the primary database at least includes: the identification information of the first host for deploying the primary database. The basic information of the standby database at least includes: the identification information of the second host for deploying the standby database; Based on the identification information of the first host, obtaining the primary database verification information for verifying the primary database from the first host; Based on the identification information of the second host, obtaining the standby database verification information for verifying the standby database from the second host; If it is confirmed based on the primary database verification information that the first host meets the primary database construction conditions, and it is confirmed based on the standby database verification information that the second host meets the standby database construction conditions, respectively sending the database construction script to the first host and the second host; Based on the configured disaster recovery construction specification and the database construction scripts on the first host and the second host, controlling the first host to perform the installation and configuration operation of the primary database, and controlling the second host to perform the installation and configuration operation of the standby database; The database installation script includes a database script for installing the database and a database construction tool script; The controlling the first host to perform the installation and configuration operation of the primary database, and controlling the second host to perform the installation and configuration operation of the standby database based on the configured disaster recovery construction specification and the database construction scripts running on the first host and the second host includes: Instructing the first host and the second host to respectively perform database installation and deployment based on the database script, so as to deploy the primary database on the first host and the standby database on the second host; According to the configured multiple disaster recovery construction items and the order between the multiple disaster recovery construction items, sequentially controlling the first host to perform the installation and configuration operation of the primary database based on the database construction tool script according to the construction configuration operation indicated by each disaster recovery construction item, and controlling the second host to perform the installation and configuration operation of the standby database based on the database construction tool script; 2. The method according to claim 1, characterized in that, The basic information of the primary database further includes: the first condition that the capacity of the primary database needs to meet; The basic information of the standby database further includes: the second condition that the capacity of the standby database needs to meet; The obtaining the primary database verification information for verifying the primary database from the first host based on the identification information of the first host includes: Based on the identification information of the first host, obtaining the size of the primary database disk group available for the primary database from the first host; The obtaining the standby database verification information for verifying the standby database from the second host based on the identification information of the second host includes: Based on the identification information of the second host, obtaining the size of the standby database disk group available for the standby database from the second host; Before respectively sending the database construction script to the first host and the second host, further including: Detecting whether the size of the primary database disk group meets the first condition and the size of the standby database disk group meets the second condition; Based on the master database verification information, it is confirmed that the first host meets the conditions for building a primary database, and based on the standby database verification information, it is confirmed that the second host meets the conditions for building a standby database, including: The size of the master database disk group meets the first condition and the size of the standby database disk group meets the second condition.
3. The method according to claim 1 or 2, characterized in that, If it is confirmed based on the master database verification information that the first host meets the conditions for building a primary database, and based on the standby database verification information that the second host meets the conditions for building a standby database, the database building scripts are respectively sent to the first host and the second host, including: If it is confirmed based on the master database verification information that the first host meets the conditions for building a primary database, and based on the standby database verification information that the second host meets the conditions for building a standby database, it is detected whether the parameters that need to be restarted to take effect in the first host have been modified; If the parameters that need to be restarted to take effect in the first host have been modified, the database building scripts are respectively sent to the first host and the second host.
4. The method according to claim 1, wherein After controlling the first host to perform the installation and configuration operation of the primary database and controlling the second host to perform the installation and configuration operation of the standby database, it further includes: Clearing the disaster recovery installation and configuration data cached in the cloud platform related to the first host and the second host.
5. An apparatus for constructing a database disaster recovery system, characterized in that Applied to a cloud platform, including: An information acquisition unit, configured to acquire the master database basic information and the standby database basic information configured by the user. The master database basic information at least includes: the identification information of the first host for deploying the primary database, and the standby database basic information at least includes: the identification information of the second host for deploying the standby database; A master verification information acquisition unit, configured to acquire the master database verification information for verifying the primary database from the first host based on the identification information of the first host; A standby verification information acquisition unit, configured to acquire the standby database verification information for verifying the standby database from the second host based on the identification information of the second host; A script sending unit, configured to, if it is confirmed based on the master database verification information that the first host meets the conditions for building a primary database, and based on the standby database verification information that the second host meets the conditions for building a standby database, send the database building scripts to the first host and the second host respectively; An installation and configuration unit, configured to control the first host to perform the installation and configuration operation of the primary database and control the second host to perform the installation and configuration operation of the standby database based on the configured disaster recovery installation specification and the database building scripts on the first host and the second host; The database installation script sent by the script sending unit includes a database script for installing the database and a database building tool script; The installation and configuration unit includes: An installation instruction subunit, configured to instruct the first host and the second host to respectively perform database installation and deployment based on the database script, so as to deploy the primary database on the first host and deploy the standby database on the second host; A control subunit, configured to, according to a plurality of disaster recovery construction items and the sequence between the plurality of disaster recovery construction items, successively perform construction configuration operations indicated by each disaster recovery construction item, control the first host to perform the hosting configuration operation of the primary database based on the database construction tool script, and control the second host to perform the hosting configuration operation of the standby database based on the database construction tool script.
6. The device according to claim 5, characterized in that, The primary database basic information obtained by the information acquisition unit further includes: a first condition that the capacity of the primary database needs to meet; The standby database basic information obtained by the information acquisition unit further includes: a second condition that the capacity of the standby database needs to meet; The primary verification information acquisition unit includes: A first acquisition subunit, configured to obtain the size of the primary database disk group available for the primary database from the first host based on the identification information of the first host; The standby verification information acquisition unit includes: A second acquisition subunit, configured to obtain the size of the standby database disk group available for the standby database from the second host based on the identification information of the second host; The apparatus further includes: A verification unit, configured to detect whether the size of the primary database disk group meets the first condition and the size of the standby database disk group meets the second condition before the script distribution unit distributes the database construction script to the first host and the second host respectively; The construction configuration unit is specifically configured to, if the size of the primary database disk group meets the first condition and the size of the standby database disk group meets the second condition, control the first host to perform the hosting configuration operation of the primary database, and control the second host to perform the hosting configuration operation of the standby database.
7. The device according to claim 5 or 6, characterized in that, The construction configuration unit includes: A parameter verification subunit, configured to detect whether the parameters that need to be restarted to take effect in the first host have been modified if it is confirmed based on the primary database verification information that the first host meets the primary database construction conditions and it is confirmed based on the standby database verification information that the second host meets the standby database construction conditions; A construction configuration subunit, configured to, if the parameters that need to be restarted to take effect in the first host have been modified, distribute the database construction script to the first host and the second host respectively.
8. The device according to claim 5, characterized in that, It further includes: A data cleaning unit, configured to clean the disaster recovery hosting configuration data cached in the cloud platform related to the first host and the second host after the construction configuration unit controls the first host to perform the hosting configuration operation of the primary database and controls the second host to perform the hosting configuration operation of the standby database.
Citation Information
Patent Citations
Method and device for repairing backup database data of database
CN106802895A
System and method for database disaster tolerance
CN106815097A