Database recovery system and method
By designing the database recovery system, the recovery process of the Oracle database is simplified, the problems of complexity and low efficiency of traditional recovery operations are solved, and fast and efficient database recovery is achieved.
Patent Information
- Application Number
- CN202110552457.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-05-20
- Publication Date
- 2024-09-24
- Estimated Expiration
- 2041-05-20
AI Technical Summary
Traditional Oracle database recovery operations are complex and time-consuming, require high technical levels, and are difficult to meet the rapid recovery needs of enterprises.
A database recovery system is designed, including a storage media module, a recovery control module, a database of first metadata information and a database of second metadata information. It receives user requests through the recovery control module, determines the recovery target host, and uses the preset Use backup tools and metadata information to restore Oracle databases, simplifying the recovery process.
It significantly simplifies the complexity of Oracle database recovery operations, improves recovery efficiency, reduces the requirements for operators' technical level, and shortens recovery time.
Smart Images

Figure CN113238894B
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a database recovery system and method. Background Art
[0002] Currently, Oracle database is the relational database with the highest market share, and major enterprise application systems maintain a large number of Oracle databases. Establishing a centralized backup system to perform periodic database backups and regularly verifying backup data is an important means to avoid data loss risks and complete data protection.
[0003] However, as the number of Oracle deployments in enterprises continues to increase and the deployment platforms are different, the traditional use of recovery manager (RMAN) commands to complete database cross-machine recovery is relatively complex and time-consuming, and requires a high level of technical skills from operators and a deep understanding of the Oracle architecture. These problems make Oracle recovery verification an important challenge faced by various enterprises. Summary of the invention
[0004] In view of this, the present application provides a database recovery system and method for simplifying the operational complexity of recovering an Oracle database and improving the recovery efficiency of an Oracle database.
[0005] The first aspect of the present application provides a database recovery system, comprising:
[0006] A storage medium module, a recovery control module, a database of first metadata information, a database of second metadata information and a recovery target cluster; the recovery target cluster is composed of at least one host; each of the hosts is installed with an Oracle database; the database of the first metadata information is a database for storing backup metadata information generated during production; the database of the second metadata information is a database for storing backup metadata information used during recovery;
[0007] The recovery control module is used to receive a request for recovering an Oracle database uploaded by a user; wherein the request for recovering an Oracle database includes: a target time point for recovery and information of a backup client; the information of the backup client is information of a host that backs up source data of the client; the client uses a preset backup tool to back up data generated by the client to a storage medium module based on metadata information, and synchronizes the backup metadata to a database of the first metadata information;
[0008] The recovery control module is further used to determine the user information of the recovery target host and the database of metadata information corresponding to the backup client according to the information of the backup client and the configuration recovery file; wherein the configuration recovery file includes: information of at least one backup client and user information of the database of metadata information corresponding to the backup client; the recovery target host is a host in the recovery target cluster with the same operating system as the backup client;
[0009] The recovery control module is further used to remotely import the user information of the metadata information database corresponding to the backup client from the first metadata information database to the second metadata information database;
[0010] The recovery control module is further used to call the recovery interface of the recovery target host, and transmit the information of the backup client, the user information of the database of metadata information corresponding to the backup client in the database of the second metadata information, and the target time of recovery to the recovery target host by using the recovery interface;
[0011] The recovery target host is used to restore the Oracle database of the client by using the information of the backup client, the user information of the database of metadata information corresponding to the backup client in the database of the second metadata information, and the target time of recovery.
[0012] Optionally, the recovery control module is further configured to determine, based on the information of the backup client and the configuration recovery file, user information of a database of metadata information corresponding to the recovery target host and the backup client, including:
[0013] A matching module, configured to match a host having the same operating system as the backup client in the recovery target cluster according to the operating system type identifier in the information of the backup client, and use the host as the recovery target host;
[0014] The query module is used to query the configuration recovery file to obtain user information of a database of metadata information corresponding to the backup client.
[0015] Optionally, the user information of the database of metadata information corresponding to the backup client in the database of the second metadata information includes: data files, parameter data, and archive log files of the database of metadata information corresponding to the backup client; the recovery target host is used to use the information of the backup client, the user information of the database of metadata information corresponding to the backup client in the database of the second metadata information, and the target time of recovery to recover the Oracle database of the client, including:
[0016] A configuration module, configured to configure the Oracle environment of the recovery target host according to the data files and parameter data of the database of the metadata information corresponding to the backup client;
[0017] A generation module, used to restore the dynamic parameter file of the Oracle database of the recovery target host and generate a static parameter file of the Oracle database of the recovery target host;
[0018] A modification module, used for modifying the Oracle parameters of the static parameter file according to the host configuration of the recovery target host;
[0019] A restart module, used to restart the recovery target host and activate the Oracle parameters of the modified static parameter file;
[0020] A recovery module, used to restore the control file of the recovery target host;
[0021] A startup module, used to start the Oracle database of the recovery target host to the mount state;
[0022] The recovery module is further used to restore the data files of the recovery target host;
[0023] An archiving module, used for applying the archived log files to restore the Oracle database of the recovery target host to the target recovery time;
[0024] The startup module is also used to start the Oracle database of the recovery target host to an open state.
[0025] Optionally, the configuration module is used to configure the Oracle database of the recovery target host according to the data file and parameter data of the database of the metadata information corresponding to the backup client, including:
[0026] A creation module, used to initialize dbid parameters and create a data storage directory according to the data files and parameter data of the database of metadata information corresponding to the backup client;
[0027] The startup module is also used to start the Oracle database of the recovery target host to the nomount state.
[0028] Optionally, the preset backup tool is a recovery manager.
[0029] Optionally, the database of the first metadata information and the recovery control module are deployed together on the same host.
[0030] Optionally, the database of the second metadata information is deployed in the recovery target cluster.
[0031] A second aspect of the present application provides a method for restoring a database, comprising:
[0032] The recovery control module receives a request for recovering an Oracle database uploaded by a user; wherein the request for recovering an Oracle database includes: a target time point for recovery and information about a backup client; the information about the backup client is information about a host that backs up client source data; the client uses a preset backup tool to back up data generated by the client to a storage medium module based on metadata information, and synchronizes the backup metadata to a database of the first metadata information; the database of the first metadata information is a database for storing backup metadata information generated during production;
[0033] The recovery control module determines the user information of the recovery target host and the database of metadata information corresponding to the backup client according to the information of the backup client and the configuration recovery file; wherein the configuration recovery file includes: information of at least one backup client and user information of the database of metadata information corresponding to the backup client; the recovery target host is a host in the recovery target cluster with the same operating system as the backup client; the recovery target cluster is composed of at least one host; each of the hosts is installed with an Oracle database;
[0034] The recovery control module remotely imports user information of the metadata information database corresponding to the backup client from the first metadata information database to the second metadata information database; wherein the second metadata information database is a database for storing backup metadata information used for recovery;
[0035] The recovery control module calls the recovery interface of the recovery target host, and transmits the information of the backup client, the user information of the database of metadata information corresponding to the backup client in the second metadata information database, and the target time of recovery to the recovery target host by using the recovery interface;
[0036] The recovery target host recovers the Oracle database of the client by using the information of the backup client, the user information of the database of metadata information corresponding to the backup client in the database of the second metadata information, and the target time of recovery.
[0037] Optionally, the recovery control module determines user information of a database of metadata information corresponding to the recovery target host and the backup client according to the information of the backup client and the configuration recovery file, including:
[0038] According to the operating system type identifier in the information of the backup client, a host with the same operating system as the backup client is matched in the recovery target cluster as the recovery target host;
[0039] In the configuration recovery file, user information of a database of metadata information corresponding to the backup client is obtained by querying.
[0040] Optionally, the user information of the database of metadata information corresponding to the backup client in the database of the second metadata information includes: data files, parameter data, and archive log files of the database of metadata information corresponding to the backup client; the recovery target host uses the information of the backup client, the user information of the database of metadata information corresponding to the backup client in the database of the second metadata information, and the target time of recovery to recover the Oracle database of the client, including:
[0041] According to the data files and parameter data of the database of the metadata information corresponding to the backup client, the Oracle environment of the recovery target host is configured;
[0042] Restoring the dynamic parameter file of the Oracle database of the recovery target host, and generating the static parameter file of the Oracle database of the recovery target host;
[0043] Modify the Oracle parameters of the static parameter file according to the host configuration of the recovery target host;
[0044] Restart the recovery target host to activate the modified Oracle parameters of the static parameter file;
[0045] Restoring the control file of the recovery target host;
[0046] Start the Oracle database of the recovery target host to the mount state;
[0047] Restoring the data files of the recovery target host;
[0048] Applying the archived log file to restore the Oracle database of the recovery target host to the recovery target time;
[0049] Start the Oracle database of the recovery target host to the open state.
[0050] Optionally, the configuration module configures the Oracle database of the recovery target host according to the data file and parameter data of the database of the metadata information corresponding to the backup client, including:
[0051] Initialize the dbid parameter and create a data storage directory according to the data file and parameter data of the database of metadata information corresponding to the backup client;
[0052] Start the Oracle database of the recovery target host to the nomount state.
[0053] Optionally, the preset backup tool is a recovery manager.
[0054] Optionally, the database of the first metadata information and the recovery control module are deployed together on the same host.
[0055] Optionally, the database of the second metadata information is deployed in the recovery target cluster.
[0056] It can be seen from the above scheme that the present application provides a database recovery system and method, and the database recovery system includes: a storage medium module, a recovery control module, a database of first metadata information, a database of second metadata information and a recovery target cluster; the recovery target cluster is composed of at least one host; each host is installed with an Oracle database; the database of the first metadata information is a database for storing backup metadata information generated during production; the database of the second metadata information is a database for storing backup metadata information used during recovery. The recovery control module is used to receive a request for recovering an Oracle database uploaded by a user; wherein the request for recovering an Oracle database includes: a target time point for recovery and information of a backup client; the information of the backup client is information of a host that backs up source data of the client; the recovery control module is also used to determine the user information of the recovery target host and the database of metadata information corresponding to the backup client according to the information of the backup client and the configuration recovery file; the recovery target host is a host in the recovery target cluster that has the same operating system as the backup client; the recovery control module is also used to remotely import the user information of the database of metadata information corresponding to the backup client from the database of the first metadata information to the database of the second metadata information, and call the recovery interface of the recovery target host, and use the recovery interface to pass the information of the backup client, the user information of the database of metadata information corresponding to the backup client in the database of the second metadata information, and the target time of recovery to the recovery target host; the recovery target host is used to use the information of the backup client, the user information of the database of metadata information corresponding to the backup client in the database of the second metadata information, and the target time of recovery to recover the Oracle database of the client. In this way, the operation complexity of recovering an Oracle database can be simplified and the recovery efficiency of an Oracle database can be improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0057] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.
[0058] Figure 1 A schematic diagram of a database recovery system provided in an embodiment of the present application;
[0059] Figure 2 A schematic diagram of restoring a target host provided in an embodiment of the present application;
[0060] Figure 3 A specific flow chart of a database recovery method provided in another embodiment of the present application;
[0061] Figure 4 A specific flow chart of a database recovery method provided in another embodiment of the present application. DETAILED DESCRIPTION
[0062] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0063] It should be noted that the concepts of "first", "second", etc. mentioned in this application are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units, and 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 "including one..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0064] The present application embodiment provides a database recovery system, such as Figure 1 As shown, specifically including:
[0065] A storage medium module 10 , a recovery control module 20 , a database 30 of first metadata information, a database 40 of second metadata information, and a recovery target cluster 50 .
[0066] Among them, the recovery target cluster is composed of at least 50 hosts; each host is installed with an Oracle database; different hosts belong to different operating system platforms. It can be understood that multiple hosts can be set for operating system platforms with more users to reduce the processing burden of the database recovery system at the same time; the database 30 of the first metadata information is a database for storing backup metadata information generated during production; the database 40 of the second metadata information is a database for storing backup metadata information used during recovery.
[0067] It should be noted that the database of the first metadata information can be deployed together with the recovery control module on the same host; the database of the second metadata information can be directly deployed on the recovery target cluster.
[0068] The recovery control module 20 is used to receive a request for recovering an Oracle database uploaded by a user.
[0069] Among them, the request to restore the Oracle database includes: the target time point of recovery and the information of the backup client; the information of the backup client is the information of the host that backs up the client source data; the client uses a preset backup tool to back up the data generated by the client to the storage medium module 10 based on the metadata information, and synchronizes the backup metadata to the database 30 of the first metadata information.
[0070] It should be noted that the preset backup tool may be, but is not limited to, other tools that can back up data, such as a recovery manager, which is not limited here. Specifically, the recovery manager tool can be used through the hosting network to back up the data generated by the client based on the metadata information, thereby obtaining backup metadata, and then synchronously storing the backup metadata in the first metadata information database 30.
[0071] The recovery control module 20 is further used to determine user information of a database of metadata information corresponding to the recovery target host and the backup client according to the information of the backup client and the configuration recovery file.
[0072] The configuration recovery file includes: information of at least one backup client and user information of a database of metadata information corresponding to the backup client; the recovery target host is a host in the recovery target cluster 50 with the same operating system as the backup client.
[0073] Since the determined recovery target host is a host in the recovery target cluster 50 with the same operating system as the backup client, and the hosts in the recovery target cluster belong to different operating system platforms, the database recovery system provided by the present application can restore the Oracle database in a timely manner regardless of the type of operating system used by the client of the user.
[0074] Optionally, in another embodiment of the present application, the recovery control module 20 is further configured to determine user information of a database of metadata information corresponding to the recovery target host and the backup client according to the information of the backup client and the configuration recovery file, including:
[0075] The matching module 21 is used to match a host with the same operating system as the backup client in the recovery target cluster 50 according to the operating system type identifier in the information of the backup client, and use it as the recovery target host.
[0076] The query module 22 is used to query the configuration recovery file to obtain user information of the database of metadata information corresponding to the backup client.
[0077] The recovery control module 20 is further used to remotely import the user information of the metadata information database corresponding to the backup client from the first metadata information database 30 to the second metadata information database 40 .
[0078] Therefore, when the target host subsequently restores the Oracle database of the client, the data in the second metadata information database 40 can be used for restoration, thereby not affecting the first metadata information database 30 used for production.
[0079] Specifically, it can be but is not limited to using Oracle remote import and export tools through a hosting network to remotely import user information of the metadata information database corresponding to the backup client from the first metadata information database 30 to the second metadata information database 40. The methods are very diverse and are not limited here.
[0080] The recovery control module 20 is also used to call the recovery interface of the recovery target host, and use the recovery interface to pass the backup client information, the user information of the metadata information database corresponding to the backup client in the second metadata information database 40, and the target time of recovery to the recovery target host.
[0081] It should be noted that the recovery control module 20 may, but is not limited to, remotely call the recovery interface of the recovery target host through the hosting network, which is not limited here.
[0082] The recovery target host is used to recover the Oracle database of the client by using the information of the backup client, the user information of the metadata information database corresponding to the backup client in the second metadata information database 40 and the target time of recovery.
[0083] Optionally, in another embodiment of the present application, the user information of the database of metadata information corresponding to the backup client in the second metadata information database 40 includes: data files, parameter data, and archive log files of the database of metadata information corresponding to the backup client; the recovery target host is used to use the information of the backup client, the user information of the database of metadata information corresponding to the backup client in the second metadata information database, and the target time of recovery to restore the Oracle database of the client, such as Figure 2 As shown, including:
[0084] The configuration module 61 is used to configure the Oracle environment of the recovery target host according to the data files and parameter data of the database of the metadata information corresponding to the backup client.
[0085] The generation module 62 is used to restore the dynamic parameter file of the Oracle database of the recovery target host and generate the static parameter file of the Oracle database of the recovery target host.
[0086] The modification module 63 is used to modify the Oracle parameters of the static parameter file according to the host configuration of the recovery target host.
[0087] The restart module 64 is used to restart the recovery target host and activate the Oracle parameters of the modified static parameter file.
[0088] The recovery module 65 is used to recover the control files of the target host.
[0089] The startup module 66 is used to start the Oracle database of the recovery target host to the mount state.
[0090] In the mount state, users can create threads and mount databases, but cannot open them.
[0091] The recovery module 65 is also used to recover the data files of the target host.
[0092] The archiving module 67 is used to apply the archived log files to restore the Oracle database of the recovery target host to the target recovery time.
[0093] The startup module 66 is also used to start the Oracle database of the recovery target host to an open state.
[0094] The open state is a normal startup state, in which users can create threads, mount databases, and open databases. That is, the Oracle database of the recovery target host has been restored to the target recovery time required for the Oracle database of the client.
[0095] Optionally, in another embodiment of the present application, the configuration module 61 is used to configure the Oracle environment of the recovery target host according to the data files and parameter data of the database of the metadata information corresponding to the backup client, including:
[0096] The creation module 611 is used to initialize the dbid parameter and create a data storage directory according to the data file and parameter data of the database of the metadata information corresponding to the backup client.
[0097] The startup module 66 is also used to start the Oracle database of the recovery target host to the nomount state.
[0098] In the nomount state, users can only create threads but cannot mount or open the database.
[0099] As can be seen from the above scheme, the present application provides a database recovery system, which receives the target time point of recovery uploaded by the user and the information of the backup client through the recovery control module 20; the information of the backup client is the information of the host with the client source data backed up; the client uses the preset backup tool to back up the data generated by the client to the storage medium module 10 based on the metadata information, and synchronizes the backup metadata to the first metadata information database 30. The recovery control module 20 determines the user information of the recovery target host and the database of metadata information corresponding to the backup client according to the information of the backup client and the configuration recovery file. Among them, the configuration recovery file includes: the information of at least one backup client and the user information of the database of metadata information corresponding to the backup client; the recovery target host is the host with the same operating system as the backup client in the recovery target cluster 50. The recovery control module 20 remotely imports the user information of the database of metadata information corresponding to the backup client from the database 30 of the first metadata information to the database 40 of the second metadata information. The recovery control module 20 calls the recovery interface of the recovery target host, and uses the recovery interface to pass the information of the backup client, the user information of the database of metadata information corresponding to the backup client in the database 40 of the second metadata information, and the target time of recovery to the recovery target host. The recovery target host uses the information of the backup client, the user information of the metadata information database corresponding to the backup client in the second metadata information database 40, and the target time of recovery to restore the Oracle database of the client, so as to simplify the operation complexity of restoring the Oracle database and improve the recovery efficiency of the Oracle database.
[0100] Based on the database recovery system shown in the above embodiment of the present application, the present application also discloses a database recovery method, such as Figure 3 As shown, including:
[0101] S301. The recovery control module receives an Oracle database recovery request uploaded by a user.
[0102] Among them, the request to restore the Oracle database includes: the target time point of recovery and the information of the backup client; the information of the backup client is the information of the host that backs up the client source data; the client uses a preset backup tool to back up the data generated by the client to the storage medium module based on the metadata information, and synchronizes the backup metadata to the database of the first metadata information; the database of the first metadata information is a database used to store the backup metadata information generated during production.
[0103] It should be noted that the preset backup tool may be, but is not limited to, a recovery manager. The database of the first metadata information may be deployed on the same host in combination with the recovery control module. The database of the second metadata information may be directly deployed on the recovery target cluster.
[0104] S302: The recovery control module determines user information of a database of metadata information corresponding to the recovery target host and the backup client according to the information of the backup client and the configuration recovery file.
[0105] Among them, the configuration recovery file includes: information of at least one backup client and user information of the database of metadata information corresponding to the backup client; the recovery target host is a host in the recovery target cluster with the same operating system as the backup client; the recovery target cluster consists of at least one host; and each host has an Oracle database installed.
[0106] Optionally, in another embodiment of the present application, an implementation of step S302 specifically includes:
[0107] According to the operating system type identifier in the information of the backup client, a host with the same operating system as the backup client is matched in the recovery target cluster and used as the recovery target host.
[0108] In the configuration recovery file, query and obtain the user information of the database of the metadata information corresponding to the backup client.
[0109] S303: The recovery control module remotely imports the user information of the metadata information database corresponding to the backup client from the first metadata information database to the second metadata information database.
[0110] The database of the second metadata information is a database for storing backup metadata information used during recovery.
[0111] S304, the recovery control module calls the recovery interface of the recovery target host, and uses the recovery interface to transmit the backup client information, the user information of the metadata information database corresponding to the backup client in the second metadata information database, and the recovery target time to the recovery target host.
[0112] S305: The recovery target host recovers the Oracle database of the client by using the information of the backup client, the user information of the database of metadata information corresponding to the backup client in the second metadata information database, and the target time of recovery.
[0113] Optionally, in another embodiment of the present application, the user information of the database of metadata information corresponding to the backup client in the second metadata information database includes: data files, parameter data and archive log files of the database of metadata information corresponding to the backup client, an implementation manner of step S305, such as Figure 4 As shown, including:
[0114] S401: According to the data files and parameter data of the database of the metadata information corresponding to the backup client, configure the Oracle environment of the recovery target host.
[0115] Optionally, in another embodiment of the present application, in an implementation manner of step S401, crying includes:
[0116] According to the data files and parameter data of the database of the metadata information corresponding to the backup client, the dbid parameter is initialized and the data storage directory is created.
[0117] Start the Oracle database on the recovery target host to the nomount state.
[0118] S402: Restore the dynamic parameter file of the Oracle database of the recovery target host, and generate a static parameter file of the Oracle database of the recovery target host.
[0119] S403. Modify the Oracle parameters of the static parameter file according to the host configuration of the recovery target host.
[0120] S404. Restart the recovery target host and activate the modified Oracle parameters of the static parameter file.
[0121] S405: Restore the control file of the target host.
[0122] S406. Start the Oracle database of the recovery target host to the mount state.
[0123] S407, restore the data files of the target host.
[0124] S408. Apply the archived log files to restore the Oracle database of the recovery target host to the target recovery time.
[0125] S409, start the Oracle database of the recovery target host to an open state.
[0126] It should be noted that the specific execution process of the database recovery method disclosed in the above-mentioned embodiment of the present application is the same as the specific principles of each module in the database recovery system shown in the above-mentioned embodiment of the present application. Please refer to the corresponding part of the database recovery method shown in the above-mentioned embodiment of the present invention, and no further details will be given here.
[0127] As can be seen from the above scheme, in a database recovery method provided by the present application, first, when the recovery control module receives the target time point of recovery uploaded by the user and the information of the backup client, the recovery control module determines the user information of the recovery target host and the database of metadata information corresponding to the backup client according to the information of the backup client and the configuration recovery file; wherein the configuration recovery file includes: information of at least one backup client and user information of the database of metadata information corresponding to the backup client; the recovery target host is a host with the same operating system as the backup client in the recovery target cluster. Then, the recovery control module remotely imports the user information of the database of metadata information corresponding to the backup client from the database of the first metadata information to the database of the second metadata information. The recovery control module then calls the recovery interface of the recovery target host, and uses the recovery interface to pass the information of the backup client, the user information of the database of metadata information corresponding to the backup client in the database of the second metadata information, and the target time of recovery to the recovery target host. Finally, the recovery target host uses the information of the backup client, the user information of the database of metadata information corresponding to the backup client in the database of the second metadata information, and the target time of recovery to restore the client's Oracle database. In order to achieve the purpose of simplifying the operation complexity of recovering the Oracle database and improving the recovery efficiency of the Oracle database.
[0128] In the above embodiments disclosed in the present application, it should be understood that the disclosed apparatus and method can also be implemented in other ways. The apparatus and method embodiments described above are merely schematic. For example, the flowcharts and block diagrams in the accompanying drawings show the possible architecture, functions and operations of the apparatus, method and computer program product according to multiple embodiments of the present disclosure. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of a code, and the module, program segment or a part of the code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of boxes in the block diagram and / or flowchart can be implemented with a dedicated hardware-based system that performs a specified function or action, or can be implemented with a combination of dedicated hardware and computer instructions.
[0129] In addition, each functional module in each embodiment of the present disclosure can be integrated together to form an independent part, or each module can exist separately, or two or more modules can be integrated to form an independent part. If the function is implemented in the form of a software functional module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present disclosure is essentially or the part that contributes to the prior art or the part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including several instructions to enable a computer device (which can be a personal computer, a live broadcast device, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present disclosure. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program code.
[0130] The present application can be implemented or used by professionals and technicians. Various modifications to these embodiments will be apparent to professionals and technicians in the field, and the general principles defined herein can 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.
Claims
1. A database recovery system, characterized in that: include: A storage medium module, a recovery control module, a database of first metadata information, a database of second metadata information, and a recovery target cluster; The recovery target cluster consists of at least one host; each of the hosts is installed with an Oracle database; The database of the first metadata information is a database for storing backup metadata information generated during production; The database of the second metadata information is a database for storing backup metadata information used during recovery; The recovery control module is used to receive a request for recovering an Oracle database uploaded by a user; wherein the request for recovering an Oracle database includes: a target time point for recovery and information of a backup client; the information of the backup client is information of a host that backs up source data of the client; the client uses a preset backup tool to back up data generated by the client to a storage medium module based on metadata information, and synchronizes the backup metadata to a database of the first metadata information; A matching module, configured to match a host having the same operating system as the backup client in the recovery target cluster according to the operating system type identifier in the information of the backup client, and use the host as the recovery target host; A query module, used to query the configuration recovery file to obtain user information of the database of metadata information corresponding to the backup client; wherein the configuration recovery file includes: information of at least one backup client and user information of the database of metadata information corresponding to the backup client; the recovery target host is a host in the recovery target cluster with the same operating system as the backup client; The recovery control module is further used to remotely import the backup metadata information of the user in the metadata information database corresponding to the backup client from the first metadata information database to the second metadata information database; The recovery control module is further used to call the recovery interface of the recovery target host, and transmit the information of the backup client, the user information of the database of metadata information corresponding to the backup client in the database of the second metadata information, and the target time of recovery to the recovery target host by using the recovery interface; wherein the user information of the database of metadata information corresponding to the backup client in the database of the second metadata information includes: data files, parameter data, and archive log files of the database of metadata information corresponding to the backup client; A configuration module, configured to configure the Oracle environment of the recovery target host according to the data files and parameter data of the database of the metadata information corresponding to the backup client; A generation module, used to restore the dynamic parameter file of the Oracle database of the recovery target host and generate a static parameter file of the Oracle database of the recovery target host; A modification module, used for modifying the Oracle parameters of the static parameter file according to the host configuration of the recovery target host; A restart module, used to restart the recovery target host and activate the Oracle parameters of the modified static parameter file; A recovery module, used to restore the control file of the recovery target host; A startup module, used to start the Oracle database of the recovery target host to the mount state; The recovery module is further used to restore the data files of the recovery target host; An archiving module, used for applying the archived log files to restore the Oracle database of the recovery target host to the target recovery time; The startup module is also used to start the Oracle database of the recovery target host to an open state.
2. The database recovery system according to claim 1, characterized in that: The configuration module is used to configure the Oracle database of the recovery target host according to the data file and parameter data of the database of the metadata information corresponding to the backup client, including: A creation module, used to initialize dbid parameters and create a data storage directory according to the data files and parameter data of the database of metadata information corresponding to the backup client; The startup module is also used to start the Oracle database of the recovery target host to the nomount state.
3. The database recovery system according to claim 1, characterized in that: The preset backup tool is recovery manager.
4. The database recovery system according to claim 1, characterized in that: The database of the first metadata information and the recovery control module are deployed together on the same host.
5. The database recovery system according to claim 1, characterized in that: The database of the second metadata information is deployed in the recovery target cluster.
6. A method for restoring a database, characterized in that: include: The recovery control module receives a request for recovering an Oracle database uploaded by a user; wherein the request for recovering an Oracle database includes: a target time point for recovery and information about a backup client; the information about the backup client is information about a host that backs up client source data; the client uses a preset backup tool to back up data generated by the client to a storage medium module based on metadata information, and synchronizes the backup metadata to a database of first metadata information; the database of the first metadata information is a database for storing backup metadata information generated during production; According to the operating system type identifier in the information of the backup client, a host with the same operating system as the backup client is matched in the recovery target cluster as the recovery target host; In the configuration recovery file, query and obtain user information of the database of metadata information corresponding to the backup client; wherein the configuration recovery file includes: information of at least one backup client and user information of the database of metadata information corresponding to the backup client; the recovery target host is a host in the recovery target cluster with the same operating system as the backup client; the recovery target cluster is composed of at least one host; each of the hosts is installed with an Oracle database; The recovery control module remotely imports the user information of the metadata information database corresponding to the backup client from the first metadata information database to the second metadata information database; wherein the second metadata information database is a database for storing the backup metadata information used for recovery; The recovery control module calls the recovery interface of the recovery target host, and uses the recovery interface to transmit the information of the backup client, the user information of the metadata information database corresponding to the backup client in the second metadata information database, and the target time of recovery to the recovery target host; wherein the user information of the metadata information database corresponding to the backup client in the second metadata information database includes: data files, parameter data, and archive log files of the metadata information database corresponding to the backup client; According to the data files and parameter data of the database of the metadata information corresponding to the backup client, the Oracle environment of the recovery target host is configured; Restoring the dynamic parameter file of the Oracle database of the recovery target host, and generating the static parameter file of the Oracle database of the recovery target host; Modify the Oracle parameters of the static parameter file according to the host configuration of the recovery target host; Restart the recovery target host to activate the modified Oracle parameters of the static parameter file; Restoring the control file of the recovery target host; Start the Oracle database of the recovery target host to the mount state; Restoring the data files of the recovery target host; Applying the archive log file to restore the Oracle database of the recovery target host to the recovery target time; Start the Oracle database of the recovery target host to the open state.
