WO2022126910A1 - 数据库的数据恢复演练方法、装置及存储介质 - Google Patents

数据库的数据恢复演练方法、装置及存储介质 Download PDF

Info

Publication number
WO2022126910A1
WO2022126910A1 PCT/CN2021/083494 CN2021083494W WO2022126910A1 WO 2022126910 A1 WO2022126910 A1 WO 2022126910A1 CN 2021083494 W CN2021083494 W CN 2021083494W WO 2022126910 A1 WO2022126910 A1 WO 2022126910A1
Authority
WO
WIPO (PCT)
Prior art keywords
database instance
data recovery
drill
backup database
backup
Prior art date
Application number
PCT/CN2021/083494
Other languages
English (en)
French (fr)
Inventor
范文聪
谭春辉
Original Assignee
平安科技(深圳)有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 平安科技(深圳)有限公司 filed Critical 平安科技(深圳)有限公司
Publication of WO2022126910A1 publication Critical patent/WO2022126910A1/zh

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1446Point-in-time backing up or restoration of persistent data
    • G06F11/1458Management of the backup or restore process
    • G06F11/1464Management of the backup or restore process for networked environments
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1446Point-in-time backing up or restoration of persistent data
    • G06F11/1458Management of the backup or restore process
    • G06F11/1469Backup restoration techniques
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2201/00Indexing scheme relating to error detection, to error correction, and to monitoring
    • G06F2201/80Database-specific techniques

Definitions

  • the present application relates to the field of computer technology, and in particular, to a data recovery drill method, device and storage medium for a database.
  • the present application provides a data recovery drill method, device and storage medium for a database, which can automate the data recovery drill of a database, improve the efficiency of the data recovery drill, reduce the user operation complexity of the data recovery drill, and save the implementation cost of the data recovery drill .
  • the present application provides a data recovery drill method for a database, the method comprising: acquiring database instance information of a backup database instance of a database, and formulating a data recovery drill plan corresponding to the backup database instance according to the database instance information,
  • the above-mentioned data recovery drill plan includes at least the data recovery drill time of the above-mentioned backup database instance; when the above-mentioned data recovery drill time arrives, the above-mentioned backup database instance is subjected to a recovery drill based on the above-mentioned data recovery drill plan and a temporary database is generated when the recovery drill is completed.
  • the present application provides a data recovery exercise device for a database, the device comprising: an acquisition module for acquiring database instance information of a backup database instance of data; an exercise formulation module for acquiring the above-mentioned data obtained by the above-mentioned acquisition module
  • the database instance information formulates a data recovery drill plan corresponding to the above-mentioned backup database instance, and the above-mentioned data recovery drill plan includes at least the data recovery drill time of the above-mentioned backup database instance;
  • the drill execution module is used for when the above-mentioned data recovery drill time arrives, based on the above
  • the data recovery drill plan performs a recovery drill on the above-mentioned backup database instance and generates a temporary database instance when the recovery drill is completed;
  • the drill verification module is used to determine the above-mentioned backup database instance according to the above-mentioned backup database instance and the above-mentioned temporary database instance generated by the above-mentioned drill execution module.
  • the report generation module is used to generate a data recovery drill report of the backup database instance when the drill verification module determines that the recovery drill of the backup database instance is successful; the report push module is used to send the backup database instance to the backup database instance.
  • the service terminal pushes the above-mentioned data recovery drill report generated by the above-mentioned report generation module.
  • the present application provides a computer device, including: a processor, a memory, a transceiver, and a network interface; the processor is connected to the memory, the transceiver, and the network interface, wherein the network interface is used to provide a data communication function,
  • the memory is used to store a computer program, and the transceiver and the processor are used to call the computer program to execute the following method: acquiring database instance information of a backup database instance of a database, and formulating data corresponding to the backup database instance according to the database instance information Recovery drill plan, the data recovery drill plan includes at least the data recovery drill time of the backup database instance; when the data recovery drill time comes, the backup database instance is recovered based on the data recovery drill plan, and the recovery drill is completed A temporary database instance is generated when the above-mentioned backup database instance and the above-mentioned temporary database instance are used; whether the above-mentioned backup database instance recovery drill is successful is determined according to the above-mentioned backup database instance;
  • the present application provides a computer-readable storage medium, where the computer-readable storage medium stores a computer program, the computer program includes program instructions, and when the program instructions are executed by a processor, execute the following method: obtaining a database database instance information of the backup database instance, and formulate a data recovery drill plan corresponding to the backup database instance according to the database instance information, and the data recovery drill plan includes at least the data recovery drill time of the backup database instance; When the time comes, perform a recovery drill on the above-mentioned backup database instance based on the above-mentioned data recovery drill plan and generate a temporary database instance when the recovery drill is completed; determine whether the above-mentioned backup database instance recovery drill is successful according to the above-mentioned backup database instance and the above-mentioned temporary database instance; If the recovery drill of the backup database instance is successful, a data recovery drill report of the backup database instance is generated, and the database recovery drill report is pushed to the service terminal of the backup database instance.
  • the business party can choose the drill report generated by a single instance, multiple instances, or all instances of the database in the dimensions of monthly, quarter, and year. There is no need to manually write the drill report, and no manual intervention is required in the whole process.
  • the data recovery drill system automatically Execution, simple operation and high applicability.
  • FIG. 1 is a schematic structural diagram of a network architecture provided by the present application.
  • FIG. 2 is a schematic flowchart of a data recovery drill method for a database provided by the present application.
  • FIG. 3 is another schematic flowchart of a data recovery drill method for a database provided by the present application.
  • FIG. 4 is a schematic structural diagram of a data recovery exercise device for a database provided by the present application.
  • FIG. 5 is a schematic structural diagram of a data recovery exercise device for a database provided by the present application.
  • FIG. 6 is a schematic structural diagram of a computer device provided by the present application.
  • the technical solution of the present application relates to the field of big data technology, such as database technology, to implement data recovery drills and promote the construction of smart cities.
  • FIG. 1 is a schematic structural diagram of a network architecture provided by the present application.
  • the network architecture may include a server 10, a database 20, and a service terminal cluster, and the service terminal cluster may include multiple service terminals.
  • the service terminal cluster may specifically include a service terminal 100a, a service terminal 100b, a service terminal Terminals 100c, . . . , service terminals 100n.
  • the server 10 may be an independent physical server, or may provide cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content distribution networks ( content delivery network, CDN), big data and artificial intelligence platforms and other basic cloud computing services cloud servers.
  • Each service terminal in the service terminal cluster may include but is not limited to: the above-mentioned terminals may include mobile phones, tablet computers, notebook computers, handheld computers, smart speakers, mobile internet devices (mobile internet devices, MIDs), point of sale (point of sale) sales, POS), wearable devices (such as smart watches, smart bracelets, etc.), etc.
  • the above-mentioned database 20 refers to a general data processing system of a unit or an application field, which stores a collection of relevant data belonging to enterprises and business departments, groups and individuals.
  • the data in the database is established from a global point of view, and is organized, described and stored according to a certain data model. Its structure is based on the natural connection between the data, which can provide all necessary access paths, and the data is no longer aimed at a certain application, but is oriented to the whole organization, with overall structural characteristics.
  • the above-mentioned database 20 may be Oracle, MySQL, SQL Server, PostgrcSQL, DB2, Couchbase and so on.
  • the service terminal 100a, the service terminal 100b, the service terminal 100c, . . . , and the service terminal 100n can be respectively connected to the above-mentioned server 10 through a network, so that each service terminal can exchange data with the server 10 through the network connection.
  • a network connection is also established between the above-mentioned server 10 and the database 20, so that the server 10 can perform data interaction with the database 20 through the network connection.
  • the server 10 receives the exercise report acquisition request from the service terminal 100a or the service terminal 100b, the service terminal 100c, . . . , and the service terminal 100n.
  • the server 10 determines from the database 20 the target database recovery drill report generated in the target generation time dimension, and pushes the target database recovery report to the service terminal 100a or the service terminal 100b, the service terminal 100c, . . . , and the service terminal 100n based on the above push path Exercise report.
  • the database data recovery drill method provided in this application can be applied to data backup and recovery scenarios of any type of data, such as financial data backup and recovery scenarios, medical data backup and recovery scenarios, inventory data backup and recovery scenarios, or other data backup and recovery scenarios.
  • the recovery scenario can be determined according to the actual application scenario, which is not limited here.
  • FIG. 2 is a schematic flowchart of a data recovery drill of a database provided by the present application.
  • the method can be executed by a data recovery drill system carried on a computer device, in other words, the data recovery drill system can run on the computer device, and the data recovery drill system can call the data recovery drill system associated with each business function instance associated with the backup database instance.
  • the associated function module is used to execute the data recovery drill plan of each backup database instance.
  • the computer device may be the server 10 in the embodiment corresponding to FIG. 1 , which will not be limited here.
  • This application will take a computer device as an example for description, and the method shown in FIG. 2 may include the following steps S101-S105.
  • Step S101 acquiring database instance information of the backup database instance of the database.
  • the data recovery drill system can perform real-time analysis of the entire process of backup and recovery drills of all database data on the cloud. For example, for database instance data backup, the data recovery drill system can determine the type of database environment. Whether to enable backup. Backups are enabled if the database environment is a production environment.
  • the content backed up here includes the account list of the database instance, database configuration information, database log files and data files and other data of the database instance, so as to ensure that when a logical error occurs in the database data or a physical device failure requires database data recovery, the system can be recovered through the recovery exercise system. The backed up data can be restored successfully.
  • the recovery drill of a database instance is mainly for the data that has been backed up.
  • the database instance that has been backed up can be described as a backup database instance below.
  • the data recovery drill system obtains the database instance information of the backup database instance of the database, so as to subsequently formulate a recovery drill plan for the above-mentioned database instance information.
  • the database instance here specifically refers to the memory structure plus a set of background processes. It can be understood that the database is used to store the database for a long time, and the memory can only store data temporarily, and the disk can actually store the data.
  • a group of background processes in the instance need to read the data from the disk into the memory of the instance, and then write the data from the memory of the instance to the database through a group of background processes through the operation of the data in the memory. middle.
  • one instance can be used for one database, and multiple instances can also be used for one database at the same time.
  • the relationship between the instance and the database is a one-to-many relationship.
  • the database instance information of the backup database instance obtained by the data recovery drill system includes all data information including the account list of the database instance.
  • Step S102 formulate a data recovery drill plan corresponding to the above-mentioned backup database instance according to the above-mentioned database instance information.
  • a scenario in which data recovery drills are required may be the business party's own recovery drill requirements for database services.
  • the data recovery drill system can automatically obtain database instance information, and then use the database environment information, such as production environment information, development environment information, and test environment. Information, etc., automatically formulate data recovery drill plans for all database instances in the database that are backed up by the data recovery drill system.
  • the above data recovery drill plan may include the target backup database instance and the data recovery drill time of the target backup database instance.
  • the target backup database instance can be any backup database instance that is backed up by using the data recovery drill system.
  • the above-mentioned database recovery drill time is usually not set within the change window time, and the change window time specifically refers to the agreed and periodic time for performing certain operations on the system, during which changes or releases have minimal impact on system services.
  • the data recovery drill time generated by the data recovery drill system conflicts with the change window time
  • the data recovery drill system sends a corresponding time conflict prompt to the cloud console, and the data recovery drill system receives from the cloud control platform the cloud control platform based on the above changes
  • the window time conflict prompts the returned data recovery drill initiation time, and changes the data recovery drill time of the above backup database instance to the above data recovery drill initiation time to avoid conflicts between the data recovery drill time generated by the data recovery drill system and the change window time. question.
  • the cloud control platform may be a user operation interface of a computer device, such as a user interface (user interface, UI) of the computer device.
  • UI user interface
  • the data recovery drill system runs in the background of a computer device
  • the user interface may be a front-end user interface provided by the computer device for the administrator of the data recovery drill system to operate.
  • the administrator of the data recovery drill system can monitor the data recovery drill of the data recovery drill system based on the user interface, or provide technical support during the data recovery drill by the data recovery drill system.
  • the data recovery drill time generated by the data recovery drill system conflicts with the change window time
  • the data recovery drill system outputs time conflict prompt information to the above-mentioned user operation interface, so as to issue a time conflict alarm to the administrator.
  • the administrator can view the time conflict prompt information and the data recovery drill time based on the user operation interface, and then set the data recovery drill initiation time based on the change window time and data recovery drill time to reset the data recovery drill time, and restore the above data.
  • the recovery drill initiation time is fed back to the data recovery drill system.
  • the data recovery exercise system can automatically generate a new data recovery exercise plan, and the operation is flexible.
  • the new data recovery drill plan here is mainly a change in the data recovery drill time, and the drill content included in the data recovery drill plan can remain unchanged. That is to say, if a database instance recovery drill fails, re-select a data recovery drill time to perform the same content recovery drill.
  • Step S103 performing a recovery exercise on the above-mentioned backup database instance based on the above-mentioned data recovery exercise plan, and generating a temporary database instance when the recovery exercise is completed.
  • the data recovery drill system when the data recovery drill system automatically formulates data recovery drill plans for backup database instances, the data recovery drill system can formulate corresponding data recovery drill plans for different backup database instances, and the data recovery drill plans for different backup database instances
  • the data recovery drill time increases sequentially.
  • the data recovery drill system can regularly check the data recovery drill time and automatically initiate the execution of the corresponding data recovery drill plan when the above data recovery drill time arrives. After the data recovery drill is completed, a temporary database instance is generated.
  • the above data recovery drill plan also includes multiple business function instances associated with the above backup database instance.
  • the data recovery drill system can call each function module associated with each business function instance associated with the above backup database instance. , and perform the data recovery drill task of each of the above service function instances through the above functional modules.
  • performing the above data recovery drill task may be that the data recovery drill system can be adapted to application programming interfaces (APIs) of different functional modules, and the above functions are remotely invoked through a network protocol. module to perform the data recovery drill tasks of the above service function instances.
  • APIs application programming interfaces
  • module to perform the data recovery drill tasks of the above service function instances When the data recovery drill is completed, a temporary service function instance is generated.
  • the temporary service function instance here can be the backup database instance generated by the data recovery drill system and has the same service as the backup database instance of the service terminal. Function database instance.
  • Step S104 according to the above-mentioned backup database instance and the above-mentioned temporary database instance, determine whether the recovery drill of the above-mentioned backup database instance is successful.
  • the generated temporary database instance can be started and verified, and the data recovery drill system can analyze in real time whether the recovered temporary database instance can be started smoothly. Check whether the database version number of the temporary database instance is consistent or whether the location of the database log records is consistent to determine whether the data recovery drill plan is successful. If the database version numbers of the temporary database instance and the backup database instance are consistent, it is determined that the recovery drill of the backup database instance is successful; or, if the positions of the database log records of the temporary database instance and the backup database instance are consistent, then the backup database instance is determined to be in the same location. The recovery drill for the database instance was successful. The above verification process does not need to log in to the database instance, which ensures the security of the database account.
  • the recovered temporary database instance will be immediately cleared and released by the data recovery drill system after it starts normally, which ensures the security of database data information. Instance data is not leaked, which ensures the security of database instance data.
  • Step S105 Generate a data recovery drill report of the backup database instance, and push the data recovery drill report to the service terminal of the backup database instance.
  • the data recovery drill system determines the generation time dimension of the data recovery drill report, and based on each backup database generated within one generation time dimension in the above database
  • the instance data recovery drill report generates a database recovery drill report for the above database.
  • the above-mentioned generation time dimension includes a year, a quarter or a month
  • the above-mentioned one generation time dimension includes a year, a quarter or a month.
  • the foregoing database recovery drill report of the backup database is a set of data recovery drill reports for a database instance generated within a generation time dimension.
  • the data recovery drill system determines from the database the data recovery drill report produced within the target generation time dimension.
  • the target database recovery drill report, and the target database recovery drill report is pushed to the service terminal based on the above push path information.
  • the above-mentioned push path can be a contact method such as a letter on the system site, an email, or a mobile phone. If the above-mentioned target generation time dimension is one month, the target database recovery drill report is the data recovery drill report of each backup database instance within a month. gather.
  • the above-mentioned data recovery drill system generates a database recovery drill report of the backup database instance when receiving a request for obtaining a drill report with a push path of a data recovery drill report and a target generation time dimension sent by a service terminal.
  • the data recovery drill system may receive a request from the business terminal to generate a time-dimensioned drill report acquisition request with the system internal message as the push path and one month as the goal
  • a database recovery drill report of the backup database instance for one month is generated, and the database recovery drill report is sent to the business terminal of the backup database instance through the system internal message.
  • the data recovery drill system can automatically obtain database instance information synchronously, and formulate data corresponding to the backup database instance by formulating the data corresponding to the backup database instance for the backed up database instance.
  • Recovery drill plan When the data recovery drill time arrives, the backup database instance will be automatically recovered based on the data recovery drill plan, and a temporary database instance will be generated when the recovery drill is completed.
  • the database can be started and verified for the generated temporary database instance. The data recovery drill system analyzes in real time whether the recovered database can be successfully started.
  • the data recovery drill system can automatically generate and save all drill records performed by all databases of the business party according to time dimensions such as yearly, quarterly, and monthly.
  • the business party can choose the drill report generated by a single instance, multiple instances, or all instances of the database in the dimensions of monthly, quarter, and year. There is no need to manually write the drill report, and the whole process does not require manual intervention. It is automatically executed by the data recovery drill system, which can improve data Restore drill efficiency, reduce the complexity of user operations for data recovery drills, and save implementation costs for data recovery drills.
  • FIG. 3 is another schematic flowchart of a data recovery drill method for a database provided by the present application.
  • the method may be performed by a computer device, and optionally, the computer device may be the server 10 in the embodiment corresponding to FIG. 1 , which will not be limited here.
  • This application will take a computer device as an example for description, and the method shown in FIG. 3 may include the following steps S201-S206.
  • Step S201 Obtain database instance information of a first backup database instance of the database, and formulate a data recovery drill plan corresponding to the backup database instance according to the above information.
  • step S201 For the specific implementation of this step S201, reference may be made to the description of steps S101-S102 in the embodiment corresponding to FIG. 2, which will not be repeated here.
  • Step S202 when the second backup database instance of the database is detected, obtain the database instance information of the second backup database instance, and formulate a corresponding data recovery drill plan according to the above information.
  • the above-mentioned backup database instance may be the first backup database instance in the database.
  • the first backup database instance may be a database instance in the database that has been generated and backed up.
  • the data recovery drill system formulates a data recovery drill plan corresponding to the first backup database instance according to the first backup database instance information and/or performs a data recovery drill on the first backup database instance based on the data recovery drill plan, if The data recovery drill system detects the second backup database instance of the database, obtains the database instance information of the second backup database instance, and formulates the data recovery corresponding to the second backup database instance according to the database instance information of the second backup database instance.
  • Exercise plan if the data recovery drill system detects the second backup database instance of the database, obtains the database instance information of the second backup database instance, and formulates the data recovery corresponding to the second backup database instance according to the database instance information of the second backup database instance.
  • the second backup database instance is a database instance that is generated and backed up in the first backup database instance, and the data recovery drill time of the second backup database instance is the data recovery drill time of the first backup database instance. after.
  • the data recovery drill system when the data recovery drill system performs data recovery drills on each backup database instance, only one designated host is required to perform the recovery drill task, which is completely physically isolated from the production database, so as to ensure that the running production is not affected. Therefore, during the data recovery exercise of the backup database, a new database instance will still be generated.
  • the production library here can be a database that provides services to the outside world, and the backup data is mainly stored in the exchange library. When the data recovery drill system performs the recovery drill, the production database runs normally and generates a database instance.
  • the data recovery drill system When the data recovery drill system detects the second backup database instance, it formulates the above second backup database instance according to the obtained database instance information of the second backup database instance. Backup the data recovery drill plan corresponding to the database instance. For the detected second backup database instance, the data recovery drill system will formulate a corresponding data recovery drill plan for it, while for the offline database instance, the data recovery drill system will delete the corresponding data recovery drill plan, host resources and The storage resources are reused, so there is no need to spend too much hardware resources for recovery drills, which saves the implementation cost of data recovery drills.
  • Step S203 when the above data recovery drill time arrives, determine whether the number of data recovery drill tasks in the data recovery availability zone of the current recovery time window is greater than or equal to the task number threshold.
  • the data recovery drill system will check whether the number of data recovery drill tasks in the current data recovery availability zone is greater than or equal to the task number threshold, where the data recovery availability zone is Specifically, it refers to different modules in the same data center computer room. For example, a company has a computer room in a certain place, and the same computer room has different floors. The third floor is called “SZA” and the fourth floor is called “SZB". Then the third and fourth floors belong to Different data recovery availability zones.
  • the above backup database instance Adhering to the principle of prioritizing business continuity, if the number of data recovery drill tasks in the above data recovery availability zone is less than the task number threshold, the above backup database instance will be restored based on the above data recovery drill plan and will be generated when the recovery drill is completed. Steps for a temporary database instance. If the number of data recovery drill tasks in the above data recovery availability zone is greater than or equal to the task number threshold, the data recovery drill time of the above backup database instance is changed to the next recovery time window of the current recovery time window.
  • the recovery time window here can be It is a fixed period of time during which data recovery drills are performed.
  • Step S204 perform a recovery drill on the backup database instance based on the data recovery drill plan, and generate a temporary database instance when the recovery drill is completed.
  • step S204 may refer to the description of step S103 in the embodiment corresponding to FIG. 2 above, which will not be repeated here.
  • Step S205 according to the backup database instance and the temporary database instance, determine whether the recovery drill of the backup database instance is successful.
  • step S205 For the specific implementation of this step S205, reference may be made to the description of step S104 in the embodiment corresponding to FIG. 2 above, which will not be repeated here.
  • Step S206 Generate a data recovery drill report of the backup database instance, and push the data recovery drill report to the service terminal of the backup database instance.
  • step S206 may refer to the description of step S105 in the embodiment corresponding to FIG. 2 above, which will not be repeated here.
  • the data recovery drill system only needs one designated recovery host to perform the recovery drill task when performing recovery drills on each database instance, and is completely physically isolated from the production database to ensure that the running production database is not affected.
  • a corresponding data recovery drill plan is automatically formulated.
  • the corresponding data recovery drill plan is automatically deleted.
  • the corresponding drill plan is automatically formulated, and the operation is flexible. Regardless of whether the data recovery drill succeeds or fails, the data recovery drill system will delete the recovered temporary database instance and reuse the host resources and storage resources without spending too much hardware resources for the data recovery drill.
  • the data recovery drill plan will be automatically postponed to the next recovery time window for execution, and the operation is flexible.
  • the database can be started and verified for the generated temporary database instance.
  • the data recovery drill system analyzes in real time whether the recovered database can be successfully started, and compares whether the database version numbers of the backup database instance and the temporary database instance are consistent. , Whether the location of the database log records is the same, to judge whether the data recovery drill plan is successful, there is no need to log in to the database instance, which ensures the security of the database account.
  • the recovery drill system can automatically generate and save all drill records performed by all databases of the business party according to time dimensions such as year, quarter, and month.
  • the business party can choose the drill report generated by a single instance, multiple instances, or all instances of the database in the dimensions of monthly, quarterly and annual. There is no need to manually write the drill report, and no manual intervention is required in the whole process. High applicability.
  • FIG. 4 is a schematic structural diagram of a data recovery exercise device for a database provided by the present application.
  • the data recovery exercise device of the database can be a computer program (including program code) running in the computer equipment, for example, the data recovery exercise device of the database is an application software; the data recovery exercise device of the database can be used to execute this The corresponding steps in the method provided by the application.
  • the data recovery exercise device of the database can be applied to computer equipment, and the information recommendation device 1 may include: an acquisition module 10, an exercise formulation module 20, an exercise execution module 30, an exercise verification module 40, and a report generation module 50 and The report push module 60 .
  • the obtaining module 10 is configured to obtain database instance information of the backup database instance of the data.
  • the drill formulation module 20 is configured to formulate a data recovery drill plan corresponding to the backup database instance according to the database instance information obtained by the acquisition module, and the data recovery drill plan includes at least the data recovery drill time of the backup database instance.
  • the drill execution module 30 is configured to perform a recovery drill on the backup database instance based on the data recovery drill plan when the data recovery drill time arrives, and generate a temporary database instance when the recovery drill is completed.
  • the exercise verification module 40 is configured to determine whether the recovery exercise of the above-mentioned backup database instance is successful according to the above-mentioned backup database instance and the temporary database instance generated by the above-mentioned exercise execution module 30 .
  • the report generation module 50 is configured to generate a data recovery exercise report of the backup database instance when the exercise verification module 40 determines that the recovery exercise of the backup database instance is successful.
  • the report pushing module 60 is configured to push the above-mentioned data recovery exercise report generated by the above-mentioned report generating module to the above-mentioned service terminal of the above-mentioned backup database instance.
  • the data recovery exercise device for the above-mentioned database further includes: a backup module 70 for judging the environment type of the database. If the environment type of the above-mentioned database is a production environment, then The database instance of the above database is backed up to obtain the backup database instance of the above database.
  • the above-mentioned exercise execution module 30 includes: a first determination unit 301, configured to determine whether the number of data recovery exercise tasks in the data recovery availability zone of the current recovery time window when the above-mentioned data recovery exercise time arrives is greater than or equal to the number of tasks threshold; the exercise unit 302 is configured to execute the above-mentioned backup database based on the above-mentioned data recovery exercise plan when the above-mentioned first determining unit 301 determines that the number of data recovery exercise tasks in the above-mentioned data recovery availability zone is less than the number of tasks threshold
  • the instance performs a recovery drill and generates a temporary database instance when the recovery drill is completed; the first time changing unit 303 is used for if the number of data recovery drill tasks in the above-mentioned data recovery availability zone determined according to the above-mentioned first determining unit 301 is greater than or When it is equal to the threshold of the number of tasks, change the data recovery drill time of the above backup database instance to the next recovery
  • the above-mentioned drill execution module 30 further includes: a prompt push unit 304, configured to send a notification to the cloud control platform if the above-mentioned data recovery drill time conflicts with the change window time when the above-mentioned data recovery drill time arrives. Send a change window time conflict prompt; the second time change unit 305 is configured to receive, from the above-mentioned cloud control platform, the data recovery drill initiation time returned by the above-mentioned cloud control platform based on the above-mentioned change window time conflict prompt, and restore the data of the above-mentioned backup database instance The drill time is changed to the above data recovery drill start time.
  • a prompt push unit 304 configured to send a notification to the cloud control platform if the above-mentioned data recovery drill time conflicts with the change window time when the above-mentioned data recovery drill time arrives.
  • Send a change window time conflict prompt the second time change unit 305 is configured to receive, from the above-mentioned cloud control platform, the data recovery drill
  • the above-mentioned data recovery drill plan further includes a plurality of business function instances associated with the above-mentioned backup database instance; the above-mentioned drill execution module 30 is further configured to: invoke the association of each business function instance associated with the above-mentioned backup database instance Each functional module of the above-mentioned functional module executes the data recovery drill task of each of the above-mentioned business function instances.
  • the above-mentioned exercise verification module 40 includes: a version number verification unit 401 for verifying whether the database version numbers of the above-mentioned temporary database instance and the above-mentioned backup database instance are consistent, if the above-mentioned temporary database instance and the above-mentioned backup database instance are consistent If the database version number of the instance is consistent, it is determined that the recovery drill of the above-mentioned backup database instance is successful; the location verification unit 402 is used to verify whether the positions of the database log records of the above-mentioned temporary database instance and the above-mentioned backup database instance are consistent, if the above-mentioned temporary database instance is consistent with the above-mentioned If the location of the database log records of the backup database instance is consistent, it is determined that the recovery drill of the backup database instance is successful.
  • a version number verification unit 401 for verifying whether the database version numbers of the above-mentioned temporary database instance and the above-mentioned backup database instance are consistent, if the above
  • the apparatus for data recovery exercise of the database further includes: a clearing module 80, configured to clear the temporary database instance after the recovery exercise of the backup database instance is successful.
  • the backup database instance is the first backup database instance in the database, after the data recovery drill plan corresponding to the backup database instance is formulated according to the database instance information.
  • the obtaining module 110 is further configured to obtain the database instance information of the second backup database instance when the second backup database instance of the database is detected.
  • the exercise formulating module 20 is further configured to: formulate a data recovery exercise plan corresponding to the second backup database instance according to the database instance information of the second backup database instance.
  • the second backup database instance is a database instance that is generated and backed up after the first backup database instance in the database, and the data recovery drill time of the second backup database instance is the data recovery drill of the first backup database instance. after time.
  • the above-mentioned report generation module 50 is further configured to: determine the generation time dimension of the data recovery exercise report, and generate the above-mentioned data recovery exercise report based on the data recovery exercise report of each backup database instance generated within a generation time dimension in the above-mentioned database The data recovery drill report of the database; wherein, the above-mentioned generation time dimension includes a year, a quarter or a month, and the above-mentioned one generation time dimension includes a year, a quarter or a month.
  • the above-mentioned report pushing module 60 further includes: a receiving unit 601, configured to receive a drill report acquisition request from a service terminal, where the above-mentioned drill report acquisition request carries the push path and target generation time of the data recovery drill report Dimension; the second determining unit 602 is configured to determine, from the above-mentioned database, a target database recovery exercise report generated based on the target generation time dimension carried in the exercise report acquisition request received by the above-mentioned receiving unit 601 .
  • the pushing unit 603 is configured to push the above-mentioned target database recovery drill report to the above-mentioned service terminal based on the push path carried in the drill-report acquisition request received by the above-mentioned receiving unit 601 .
  • step S101 to step S105 in the embodiment and/or the description of step S201 to step S206 in the embodiment corresponding to FIG. 3 above will not be repeated here.
  • the description of the beneficial effects of using the same method will not be repeated.
  • the computer device 1000 may include: at least one processor 1001 , such as a CPU, at least one network interface 1004 , transceiver 1003 , memory 1005 , and at least one communication bus 1002 .
  • the communication bus 1002 is used to realize the connection and communication between these components.
  • the network interface 1004 may optionally include a standard wired interface or a wireless interface (eg, a WI-FI interface).
  • the memory 1005 may be a high-speed random access memory (random memory) access memory, RAM) memory, or non-volatile memory (non-volatile memory), such as at least one disk memory.
  • the memory 1005 may optionally also be at least one storage device located remotely from the aforementioned processor 1001 .
  • the memory 1005 as a computer storage medium may include an operating system, a network communication module, and a device control application program.
  • the network interface 1004 is mainly used for the user terminal to perform network communication; and the processor 1001 and the transceiver 1003 can be used to call the device control application program stored in the memory 1005 to realize: the above-mentioned transceiver
  • the processor 1003 is configured to obtain the database instance information of the backup database instance of the database; the above-mentioned processor 1001 is configured to formulate a data recovery drill plan corresponding to the above-mentioned backup database instance according to the above-mentioned database instance information, and the above-mentioned data recovery drill plan at least includes the above-mentioned backup
  • the data recovery drill time of the database instance; the processor 1001 is further configured to, when the data recovery drill time arrives, perform a recovery drill on the backup database instance based on the data recovery drill plan and generate a temporary database instance when the recovery drill is completed;
  • the above-mentioned processor 1001 is further configured to determine whether the above-mentioned backup database instance recovery exercise is successful according to the above-
  • the transceiver 1003 is further configured to push the database recovery drill report generated by the processor 1001 to the service terminal of the backup database instance.
  • the processor 1001 is further configured to determine the environment type of the database. If the environment type of the database is a production environment, back up the database instance of the database to obtain the backup database instance of the database. .
  • the processor 1001 is further configured to: determine whether the number of data recovery drill tasks in the data recovery availability zone in the current recovery time window is greater than or equal to the task number threshold ; If the number of data recovery drill tasks in the above-mentioned data recovery availability zone is less than the task number threshold, then perform the steps of performing a recovery drill on the above-mentioned backup database instance based on the above-mentioned data recovery drill plan and generating a temporary database instance when the recovery drill is completed; If the number of data recovery drill tasks in the data recovery availability zone is greater than or equal to the task number threshold, the data recovery drill time of the above-mentioned backup database instance is changed to the next recovery time window of the current recovery time window.
  • the transceiver 1003 is further configured to send a change window time conflict prompt to the cloud control platform.
  • the above-mentioned cloud control platform receives the data recovery drill initiation time returned by the above-mentioned cloud control platform based on the above-mentioned change window time conflict prompt, and the above-mentioned processor 1001 is further configured to change the data recovery drill time of the above-mentioned backup database instance to the above-mentioned data recovery drill initiation time .
  • the above-mentioned data recovery drill plan further includes a plurality of business function instances associated with the above-mentioned backup database instance; the above-mentioned processor 1001 is configured to: call each business function instance associated with the above-mentioned backup database instance.
  • a function module through which the above-mentioned various function modules are used to perform the data recovery drill task of each of the above-mentioned business function instances.
  • the processor 1001 is configured to verify whether the database version numbers of the temporary database instance and the backup database instance are consistent, and determine whether the temporary database instance is consistent with the database version numbers of the backup database instance.
  • the recovery drill of the above-mentioned backup database instance is successful; or, verify whether the positions of the database log records of the above-mentioned temporary database instances and the above-mentioned backup database instances are consistent, if the positions of the above-mentioned temporary database instances and the database log records of the above-mentioned backup database instances are consistent, then determine The recovery drill of the above backup database instance is successful.
  • the above-mentioned processor 1001 is further configured to: clear the above-mentioned temporary database instance after the recovery exercise of the above-mentioned backup database instance is successful.
  • the above-mentioned backup database instance is the first backup database instance in the above-mentioned database; after the above-mentioned formulating a data recovery drill plan corresponding to the above-mentioned backup database instance according to the above-mentioned database instance information, the above-mentioned processor 1001 is further used for : when the second backup database instance of the above-mentioned database is detected, formulate a data recovery drill plan corresponding to the above-mentioned second backup database instance according to the database instance information of the above-mentioned second backup database instance obtained by the above-mentioned transceiver 1003; wherein, the above-mentioned No.
  • the second backup database instance is a database instance that is generated and backed up after the first backup database instance in the above database, and the data recovery drill time of the second backup database instance is after the data recovery drill time of the first backup database instance.
  • the above-mentioned processor 1001 is further configured to: determine the generation time dimension of the data recovery exercise report, and generate the data recovery exercise report of each backup database instance generated in a generation time dimension in the above-mentioned database, and generate the above-mentioned database's data recovery exercise report.
  • a data recovery drill report wherein the generation time dimension includes a year, a quarter, or a month, and the generation time dimension includes a year, a quarter, or a month.
  • the transceiver 1003 is further configured to receive a request for obtaining a drill report from a service terminal, where the request for obtaining a drill report carries the push path of the data recovery drill report and the target generation time dimension; the processor 1001 , is also used to determine from the above-mentioned database the target database recovery exercise report generated in the target generation time dimension carried in the exercise report acquisition request received from the above-mentioned transceiver 1003, and the above-mentioned transceiver 1003 is also used to send the The above-mentioned service terminal pushes the above-mentioned target database recovery drill report.
  • the computer device 1000 described in this application may execute the description of the data recovery exercise method for the database in the foregoing embodiments corresponding to FIG. 2 and/or FIG.
  • the description of the data recovery exercise device for the database in the corresponding embodiment is not repeated here.
  • the description of the beneficial effects of using the same method will not be repeated.
  • the present application also provides a computer-readable storage medium, and the computer-readable storage medium stores the computer program executed by the data recovery exercise device of the aforementioned database, and the computer
  • the program includes program instructions, and when the processor executes the program instructions, it can execute the description of the data recovery exercise method for the database in the foregoing embodiment corresponding to FIG. 2 and/or FIG. 3 , and therefore will not be repeated here.
  • the description of the beneficial effects of using the same method will not be repeated.
  • program instructions may be deployed to execute on one computing device, or on multiple computing devices located at one site, or alternatively, on multiple computing devices distributed across multiple sites and interconnected by a communications network
  • multiple computing devices distributed in multiple locations and interconnected by a communication network can form a blockchain system.
  • the storage medium involved in this application such as a computer-readable storage medium, may be non-volatile or volatile.
  • the above-mentioned computer-readable storage medium may be the information recommendation apparatus provided in any of the foregoing embodiments or an internal storage unit of the above-mentioned device, such as a hard disk or a memory of an electronic device.
  • the computer-readable storage medium may also be an external storage device of the electronic device, such as a pluggable hard disk, a smart media card (SMC), a secure digital (SD) card equipped on the electronic device, flash memory card card), etc.
  • the above-mentioned computer-readable storage medium may also include a magnetic disk, an optical disk, a read-only memory (read-only memory, ROM), or a random access memory, and the like.
  • the computer-readable storage medium may also include both an internal storage unit of the electronic device and an external storage device.
  • the computer-readable storage medium is used to store the computer program and other programs and data required by the electronic device.
  • the computer-readable storage medium can also be used to temporarily store data that has been or will be output.

Landscapes

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

Abstract

本申请公开了一种数据库的数据恢复演练方法、装置、计算机设备及存储介质,该方法包括:获取数据库的备份数据库实例的数据库实例信息,并制定备份数据库实例对应的数据恢复演练计划;当数据恢复演练时间到来时,基于数据恢复演练计划对备份数据库实例进行恢复演练并在恢复演练完成时生成临时数据库实例;根据备份数据库实例和临时数据库实例确定备份数据库实例的恢复演练是否成功,若备份数据库实例的恢复演练成功,则生成备份数据库实例的数据恢复演练报告,并向备份数据库实例的业务终端推送数据恢复演练报告。采用本申请,可以实现数据库的数据恢复演练自动化,可提高数据恢复演练效率,节省数据恢复演练的实现成本。

Description

数据库的数据恢复演练方法、装置及存储介质
本申请要求于2020年12月18日提交中国专利局、申请号为202011511684.3,发明名称为“数据库的数据恢复演练方法、装置及存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及计算机技术领域,尤其涉及一种数据库的数据恢复演练方法、装置及存储介质。
背景技术
随着企业对业务连续性的重视程度越来越高,为了避免数据丢失造成的不可挽回的业务损失,备份数据的定时恢复演练是最后的一根救命稻草。目前,发明人意识到,市面上针对数据库数据备份与恢复的产品均需要人工设计从数据恢复到启动验证的演练流程、召集数据库上下游应用管理员制定关联演练序列、进行演练完成后的关联方验证,最后提供的演练报告也是由人工撰写,操作复杂且耗时耗费人力,效率低下。这对于备份恢复覆盖率要求高的企业来说,不仅大大增加了人力成本,而且对于备份管理人员专业水平的依赖性高,稳定性差。
技术问题
本申请提供一种数据库的数据恢复演练方法、装置及存储介质,可以实现数据库的数据恢复演练自动化,可提高数据恢复演练效率,降低数据恢复演练的用户操作复杂性,节省数据恢复演练的实现成本。
技术解决方案
第一方面,本申请提供了一种数据库的数据恢复演练方法,该方法包括:获取数据库的备份数据库实例的数据库实例信息,并根据上述数据库实例信息制定上述备份数据库实例对应的数据恢复演练计划,上述数据恢复演练计划中至少包括上述备份数据库实例的数据恢复演练时间;当上述数据恢复演练时间到来时,基于上述数据恢复演练计划对上述备份数据库实例进行恢复演练并在恢复演练完成时生成临时数据库实例;根据上述备份数据库实例和上述临时数据库实例确定上述备份数据库实例恢复演练是否成功;若上述备份数据库实例的恢复演练成功,则生成上述备份数据库实例的数据恢复演练报告,并向上述备份数据库实例的业务终端推送上述数据库恢复演练报告。
第二方面,本申请提供了一种数据库的数据恢复演练装置,该装置包括:获取模块,用于获取数据的备份数据库实例的数据库实例信息;演练制定模块,用于根据上述获取模块获取的上述数据库实例信息制定上述备份数据库实例对应的数据恢复演练计划,上述数据恢复演练计划中至少包括上述备份数据库实例的数据恢复演练时间;演练执行模块,用于当上述数据恢复演练时间到来时,基于上述数据恢复演练计划对上述备份数据库实例进行恢复演练并在恢复演练完成时生成临时数据库实例;演练验证模块,用于根据上述备份数据库实例和上述演练执行模块生成的上述临时数据库实例确定上述备份数据库实例的恢复演练是否成功;报告生成模块,用于在上述演练验证模块确定上述备份数据库实例的恢复演练成功时,生成上述备份数据库实例的数据恢复演练报告;报告推送模块,用于向上述备份数据库实例的业务终端推送上述报告生成模块生成的上述数据恢复演练报告。
第三方面,本申请提供了一种计算机设备,包括:处理器、存储器、收发器以及网络接口;该处理器与存储器、收发器、网络接口相连,其中,网络接口用于提供数据通信功能,该存储器用于存储计算机程序,该收发器和处理器用于调用该计算机程序,以执行以下方法:获取数据库的备份数据库实例的数据库实例信息,并根据上述数据库实例信息制定上述备份数据库实例对应的数据恢复演练计划,上述数据恢复演练计划中至少包括上述备份数据库实例的数据恢复演练时间;当上述数据恢复演练时间到来时,基于上述数据恢复演练计划对上述备份数据库实例进行恢复演练并在恢复演练完成时生成临时数据库实例;根据上述备份数据库实例和上述临时数据库实例确定上述备份数据库实例恢复演练是否成功;若上述备份数据库实例的恢复演练成功,则生成上述备份数据库实例的数据恢复演练报告,并向上述备份数据库实例的业务终端推送上述数据库恢复演练报告。
第四方面,本申请提供了一种计算机可读存储介质,该计算机可读存储介质存储有计算机程序,该计算机程序包括程序指令,该程序指令当被处理器执行时,执行以下方法:获取数据库的备份数据库实例的数据库实例信息,并根据上述数据库实例信息制定上述备份数据库实例对应的数据恢复演练计划,上述数据恢复演练计划中至少包括上述备份数据库实例的数据恢复演练时间;当上述数据恢复演练时间到来时,基于上述数据恢复演练计划对上述备份数据库实例进行恢复演练并在恢复演练完成时生成临时数据库实例;根据上述备份数据库实例和上述临时数据库实例确定上述备份数据库实例恢复演练是否成功;若上述备份数据库实例的恢复演练成功,则生成上述备份数据库实例的数据恢复演练报告,并向上述备份数据库实例的业务终端推送上述数据库恢复演练报告。
有益效果
在本申请中,业务方可自行选择数据库单个实例、多个实例、全部实例以月度、季度、年度为维度生成的演练报告,无需人工撰写演练报告,全程无需人工干预,由数据恢复演练系统自动执行,操作简单,适用性高。
附图说明
图1是本申请提供的网络架构的结构示意图。
图2是本申请提供的数据库的数据恢复演练方法的一流程示意图。
图3是本申请提供的数据库的数据恢复演练方法的另一流程示意图。
图4是本申请提供的数据库的数据恢复演练装置的结构示意图。
图5是本申请提供的数据库的数据恢复演练装置的结构示意图。
图6是本申请提供的计算机设备的结构示意图。
本发明的实施方式
下面将结合本申请中的附图,对本申请中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。
本申请的技术方案涉及大数据技术领域,如可具体涉及数据库技术,以实现数据恢复演练,推动智慧城市的建设。
请参见图1,图1是本申请提供的网络架构的结构示意图。如图1所示,该网络架构可以包括服务器10、数据库20以及业务终端集群,该业务终端集群可以包括多个业务终端,如图1所示,具体可以包括业务终端100a、业务终端100b、业务终端100c、…、业务终端100n。
其中,服务器10可以为独立的物理服务器,也可以是提供云服务、云数据库、云计算、云函数、云存储、网络服务、云通信、中间件服务、域名服务、安全服务、内容分发网络(content delivery network,CDN)、大数据以及人工智能平台等基础云计算服务的云服务器。业务终端集群中的每个业务终端均可以包括但不限于:上述终端可以包括手机、平板电脑、笔记本电脑、掌上电脑、智能音响、移动互联网设备(mobile internet device,MID)、销售点(point of sales,POS)、可穿戴设备(例如智能手表、智能手环等)等。上述数据库20指的是一个单位或是一个应用领域的通用数据处理系统,它存储的是属于企业和事业部门、团体和个人的有关数据的集合。数据库中的数据是从全局观点出发建立的,按一定的数据模型进行组织、描述和存储。其结构基于数据间的自然联系,从而可提供一切必要的存取路径,且数据不再针对某一应用,而是面向全组织,具有整体的结构化特征。在一些可行的实施方式中,上述数据库20可以为Oracle、MySQL、SQL Server、PostgrcSQL、DB2、Couchbase等。
如图1所示,业务终端100a、业务终端100b、业务终端100c、…、业务终端100n可以分别与上述服务器10进行网络连接,以便于每个业务终端可以通过该网络连接与服务器10进行数据交互;可以理解,上述服务器10与数据库20之间同样建立有网络连接,以便于服务器10可以通过该网络连接与数据库20进行数据交互。例如,服务器10接收业务终端100a或者业务终端100b、业务终端100c、…、业务终端100n的演练报告获取请求,基于上述携带有数据库恢复演练报告推送路径和目标生成时间维度的演练报告获取请求,上述服务器10从数据库20中确定出上述目标生成时间维度内生成的目标数据库恢复演练报告,并基于上述推送路径向业务终端100a或者业务终端100b、业务终端100c、…、业务终端100n推送上述目标数据库恢复演练报告。
本申请提供的数据库的数据恢复演练方法可适用于任一类别数据的数据备份与恢复场景,比如金融数据备份与恢复场景、医疗数据备份与恢复场景、库存数据备份与恢复场景或者其它数据备份与恢复场景,具体可根据实际应用场景确定,在此不做限制。
下面将结合图2至图6对本申请的数据库的数据恢复演练方法、数据库的数据恢复演练装置以及计算机设备进行说明。
请参见图2,图2是本申请提供的数据库的数据恢复演练的一流程示意图。该方法可以由承载于计算机设备上的数据恢复演练系统执行,换句话说,数据恢复演练系统可以在该计算机设备上运行,该数据恢复演练系统可调用备份数据库实例所关联的各个业务功能实例所关联的功能模块来执行各备份数据库实例的数据恢复演练计划。为方便描述,下面将以数据恢复演练系统为本申请实施例提供的方法的执行主体为例进行说明。可选的,该计算机设备可以为上述图1所对应实施例中的服务器10,这里将不对其进行限定。本申请将以计算机设备为服务器为例进行说明,如图2所示的方法可以包括以下步骤S101-步骤S105。
步骤S101,获取数据库的备份数据库实例的数据库实例信息。
在一些可行的实施方式中,数据恢复演练系统可以对所有云上数据库数据的备份与恢复演练进行全程的实时分析,比如对于数据库实例数据的备份,数据恢复演练系统可以通过判断数据库环境类型来判断是否启用备份。如果数据库环境为生产环境,则启用备份。这里备份的内容包括数据库实例的账号列表、数据库配置信息、数据库日志文件与数据文件等数据库实例的所有数据,以确保数据库数据发生逻辑错误或物理设备故障需要进行数据库数据恢复时,通过恢复演练系统备份的数据可以被成功恢复。数据库实例的恢复演练主要是针对已备份出来的数据进行恢复演练的,为方便描述,下面可将备份完成的数据库实例作为备份数据库实例进行说明。当上述数据库实例备份完成后,数据恢复演练系统获取数据库的备份数据库实例的数据库实例信息,用以后续针对上述数据库实例信息制定恢复演练计划。这里的数据库实例具体指内存结构加一组后台进程,可以理解的是数据库是用来长久储存数据库的,而内存只能临时存储数据,磁盘才能真正存储数据。因此在使用数据库时需要由实例中的一组后台进程从磁盘上将数据读入到实例的内存中,然后经过在内存中对数据的操作再从实例的内存中经过一组后台进程写到数据库中。需要注意的是,一个实例可以用于一个数据库,多个实例也可以同时用于一个数据库,实例和数据库的关系是一对多的关系。在本申请可选的实施例中,数据恢复演练系统获取的备份数据库实例的数据库实例信息包括数据库实例的账号列表在内的所有数据信息。
步骤S102,根据上述数据库实例信息制定上述备份数据库实例对应的数据恢复演练计划。
在一些可行的实施方式中,需要进行数据恢复演练的场景可以为业务方自身对数据库业务的恢复演练需求。比如,当业务方数据库需要对数据库进行数据备份并对备份数据进行恢复演练时,数据恢复演练系统可自动获取数据库实例信息,然后根据数据库的环境信息,比如生产环境信息、开发环境信息、测试环境信息等,针对数据库内的所有使用数据恢复演练系统备份的数据库实例自动制定数据恢复演练计划。上述数据恢复演练计划可以包括目标备份数据库实例以及目标备份数据库实例的数据恢复演练时间。这里,目标备份数据库实例可以是使用数据恢复演练系统备份完成的任意一个备份数据库实例。可选的,上述数据库恢复演练时间通常不设置在变更窗口时间内,变更窗口时间具体指约定的、周期性的对系统实施一定操作的时间,在此期间实施变更或发布对系统服务的影响最小。当数据恢复演练系统生成的数据恢复演练时间与变更窗口时间冲突时,数据恢复演练系统向云控制台发出对应的时间冲突提示,上述数据恢复演练系统从云控制平台接收上述云控制平台基于上述变更窗口时间冲突提示返回的数据恢复演练发起时间,并将上述备份数据库实例的数据恢复演练时间更改至上述数据恢复演练发起时间,以避免数据恢复演练系统生成的数据恢复演练时间与变更窗口时间冲突的问题。
这里,云控制平台可以是计算机设备的用户操作界面,比如计算机设备的用户界面(user interface,UI)。可以理解,数据恢复演练系统是在计算机设备后台运行,该用户界面可以是该计算机设备提供给数据恢复演练系统的管理人员进行操作的前端用户操作界面。数据恢复演练系统的管理人员可基于该用户界面对数据恢复演练系统的数据恢复演练进行监控,或者在数据恢复演练系统进行数据恢复演练的过程中提供技术支持。当数据恢复演练系统生成的数据恢复演练时间与变更窗口时间冲突时,数据恢复演练系统输出时间冲突提示信息至上述用户操作界面,以向管理人员发出时间冲突的告警。管理人员可基于该用户操作界面查看时间冲突提示信息以及数据恢复演练时间,进而可基于变更窗口时间和数据恢复演练时间设定数据恢复演练发起时间以重新设定数据恢复演练时间,并将上述数据恢复演练发起时间反馈至数据恢复演练系统。
可选的,在一些可行的实施方式中,对于演练失败的数据库实例,数据恢复演练系统可自动生成新的数据恢复演练计划,操作灵活。这里新的数据恢复演练计划主要是数据恢复演练时间上的改变,数据恢复演练计划中包括的演练内容可以保持不变。也就是说若一个数据库实例恢复演练失败则重新选择一个数据恢复演练时间进行同样内容的恢复演练。
步骤S103,基于上述数据恢复演练计划对上述备份数据库实例进行恢复演练并在恢复演练完成时生成临时数据库实例。
在一些可行的实施方式中,数据恢复演练系统在对备份数据库实例自动制定数据恢复演练计划时,数据恢复演练系统可对不同的备份数据库实例制定对应的数据恢复演练计划且不同的备份数据库实例的数据恢复演练时间依次递增,数据恢复演练系统可定时查看数据恢复演练时间并在上述数据恢复演练时间到来时自动发起执行对应的数据恢复演练计划,数据恢复演练完成后生成临时数据库实例。上述数据恢复演练计划中还包括上述备份数据库实例关联的多个业务功能实例,当上述数据恢复演练时间到来时,数据恢复演练系统可调用上述备份数据库实例关联的各业务功能实例关联的各功能模块,通过上述各功能模块执行上述各业务功能实例的数据恢复演练任务。在本申请可选的实施例中,执行上述数据恢复演练任务可以为,数据恢复演练系统可适配不同功能模块的应用程序编程接口(application programming interface,API),通过网络协议远程调用上述各功能模块来执行上述各业务功能实例的数据恢复演练任务,数据恢复演练完成时生成临时业务功能实例,这里的临时业务功能实例可以是数据恢复演练系统恢复生成的与业务终端的备份数据库实例具有相同业务功能的数据库实例。
步骤S104,根据上述备份数据库实例和上述临时数据库实例确定上述备份数据库实例的恢复演练是否成功。
在一些可行的实施方式中,数据恢复演练计划完成时可对生成的临时数据库实例启动并进行验证,由数据恢复演练系统实时分析恢复出来的临时数据库实例是否可以顺利启动,通过对比备份数据库实例与临时数据库实例的数据库版本号是否一致或者数据库日志记录的位置是否一致,以判断数据恢复演练计划是否成功。若上述临时数据库实例与上述备份数据库实例的数据库版本号一致则确定上述备份数据库实例的恢复演练成功;或者,若上述临时数据库实例与上述备份数据库实例的数据库日志记录的位置一致,则确定上述备份数据库实例的恢复演练成功。上述验证流程不需要登录数据库实例,保障了数据库账号的安全性。当数据恢复演练系统完成数据库相关验证,恢复出来的临时数据库实例正常启动后就会被数据恢复演练系统立即清除释放,保障了数据库数据信息的安全性,业务方可以自行查看销毁记录,以确保数据库实例数据不被泄露,保障了数据库实例数据的安全性。
步骤S105,生成上述备份数据库实例的数据恢复演练报告,并向上述备份数据库实例的业务终端推送上述数据恢复演练报告。
在一些可行的实施例中,若上述备份数据库实例的数据恢复演练成功,则数据恢复演练系统确定出数据恢复演练报告的生成时间维度,并基于上述数据库中一个生成时间维度内生成的各备份数据库实例的数据恢复演练报告生成上述数据库的数据库恢复演练报告。其中,上述生成时间维度包括年度、季度或者月度,上述一个生成时间维度包括一年、一个季度或者一个月。上述备份数据库的数据库恢复演练报告为针对一个生成时间维度内生成的数据库实例的数据恢复演练报告集合。当数据恢复演练系统接收到业务终端发送的携带有数据恢复演练报告的推送路径以及目标生成时间维度的演练报告获取请求时,上述数据恢复演练系统从数据库中确定出上述目标生成时间维度内生产的目标数据库恢复演练报告,并基于上述推送路径信息向业务终端推送上述目标数据库恢复演练报告。可选的,上述推送路径可以为系统站内信、邮件、手机等联络方式,若上述目标生成时间维度为一个月,则目标数据库恢复演练报告为一个月内各备份数据库实例的数据恢复演练报告的集合。在一种可行的实施方式中,上述数据恢复演练系统接收到业务终端发送的携带有数据恢复演练报告的推送路径以及目标生成时间维度的演练报告获取请求时,生成备份数据库实例的数据库恢复演练报告,并向上述备份数据库实例的业务终端推送上述数据库恢复演练报告可以为,数据恢复演练系统接收到业务终端发送的,以系统站内信为推送路径以一个月为目标生成时间维度的演练报告获取请求时,基于各备份数据库实例的数据恢复演练报告生成一个月的备份数据库实例的数据库恢复演练报告,并通过系统站内信向上述备份数据库实例的业务终端发送上述数据库恢复演练报告。
在本申请中,当业务方数据库需要对数据库进行数据备份并对备份数据进行数据恢复演练时,数据恢复演练系统可自动同步获取数据库实例信息,通过对已备份数据库实例制定备份数据库实例对应的数据恢复演练计划,当数据恢复演练时间到来时,基于制定的数据恢复演练计划对已备份数据库实例自动进行恢复演练并在恢复演练完成时生成临时数据库实例。数据恢复演练计划完成时可对生成的临时数据库实例启动数据库并完成验证,由数据恢复演练系统实时分析恢复出来的数据库是否可以顺利启动,通过对备份数据库实例与临时数据库实例的数据库版本号是否一致、数据库日志记录的位置是否一致,以判断数据恢复演练计划是否成功,不需要登录数据库实例,保障了数据库账号的安全性。数据恢复演练计划成功时数据恢复演练系统可自动生成和保存业务方所有数据库按照年度、季度、月度等时间维度执行的所有演练记录。业务方可自行选择数据库单个实例、多个实例、全部实例以月度、季度、年度为维度生成的演练报告,无需人工撰写演练报告,全程无需人工干预,由数据恢复演练系统自动执行,可提高数据恢复演练效率,降低数据恢复演练的用户操作复杂性,节省数据恢复演练的实现成本。
请参见图3,图3是本申请提供的数据库的数据恢复演练方法的另一流程示意图。该方法可以由计算机设备执行,可选的,该计算机设备可以为上述图1所对应实施例中的服务器10,这里将不对其进行限定。本申请将以计算机设备为服务器为例进行说明,如图3所示的方法可以包括以下步骤S201-步骤S206。
步骤S201,获取数据库的第一备份数据库实例的数据库实例信息,根据上述信息制定备份数据库实例对应的数据恢复演练计划。
其中,该步骤S201的具体实施方式可参见上述图2所对应实施例中对步骤S101-S102的描述,这里将不再赘述。
步骤S202,当检测到数据库的第二备份数据库实例时,获取第二备份数据库实例的数据库实例信息,根据上述信息制定对应的数据恢复演练计划。
在一些可行的实施方式中,上述备份数据库实例可以为数据库中的第一备份数据库实例,这里,第一备份数据库实例可以是数据库中已经生成并且完成备份的数据库实例。当数据恢复演练系统根据上述第一备份数据库实例信息制定上述第一备份数据库实例对应的数据恢复演练计划和/或基于该数据恢复演练计划对第一备份数据库实例进行数据恢复演练的过程中,若数据恢复演练系统检测到数据库的第二备份数据库实例,则获取上述第二备份数据库实例的数据库实例信息,并根据上述第二备份数据库实例的数据库实例信息制定上述第二备份数据库实例对应的数据恢复演练计划。其中,上述第二备份数据库实例为上述数据库中在上述第一备份数据库实例生成并完成备份的数据库实例,上述第二备份数据库实例的数据恢复演练时间在上述第一备份数据库实例的数据恢复演练时间之后。在本申请可选的实施例中,数据恢复演练系统对各备份数据库实例进行数据恢复演练时只需要一台指定主机来执行恢复演练任务,与生产库完全物理隔离,保证不影响运行中的生产库,因此在备份数据库的数据恢复演练过程中,依然会有新的数据库实例生成。这里的生产库可以是对外提供服务的数据库,而备份数据主要存放在交换库中。当数据恢复演练系统执行恢复演练时,生产库正常运行并生成数据库实例,当数据恢复演练系统检测到第二备份数据库实例时,根据获取的上述第二备份数据库实例的数据库实例信息制定上述第二备份数据库实例对应的数据恢复演练计划。对于检测到的第二备份数据库实例数据恢复演练系统会为其制定对应的数据恢复演练计划,而对于已经下线的数据库实例,数据恢复演练系统则会删除对应的数据恢复演练计划,主机资源和存储资源的重复利用,因此不需要花太多硬件资源来进行恢复演练,节省了数据恢复演练的实现成本。
步骤S203,当上述数据恢复演练时间到来时,确定当前恢复时间窗口数据恢复可用区中数据恢复演练任务的数量是否大于或者等于任务数量阈值。
在一些可行的实施方式中,在数据恢复演练计划开始前,数据恢复演练系统会校验当前的数据恢复可用区中数据恢复演练任务的数量是否大于或者等于任务数量阈值,这里的数据恢复可用区具体指同一数据中心机房的不同模块,比如某公司在某地有一个机房,同一个机房有不同的楼层,3楼叫“SZA”,4楼叫“SZB”,那么3楼和4楼就属于不同的数据恢复可用区。秉持着优先保障业务连续性原则,若上述数据恢复可用区中数据恢复演练任务的数量小于任务数量阈值,则执行基于上述数据恢复演练计划对上述备份数据库实例进行恢复演练并在恢复演练完成时生成临时数据库实例的步骤。若上述数据恢复可用区中数据恢复演练任务的数量大于或者等于任务数量阈值,则将上述备份数据库实例的数据恢复演练时间更改为当前恢复时间窗口的下一个恢复时间窗口,这里的恢复时间窗口可以是固定的进行数据恢复演练的一段时间。
步骤S204,基于数据恢复演练计划对备份数据库实例进行恢复演练并在恢复演练完成时生成临时数据库实例。
其中,该步骤S204的具体实施方式可参见上述图2所对应实施例中对步骤S103的描述,这里将不再赘述。
步骤S205,根据备份数据库实例和临时数据库实例确定备份数据库实例的恢复演练是否成功。
其中,该步骤S205的具体实施方式可参见上述图2所对应实施例中对步骤S104的描述,这里将不再赘述。
步骤S206,生成备份数据库实例的数据恢复演练报告,并向备份数据库实例的业务终端推送数据恢复演练报告。
其中,该步骤S206的具体实施方式可参见上述图2所对应实施例中对步骤S105的描述,这里将不再赘述。
在本申请中,数据恢复演练系统对各数据库实例进行恢复演练时只需要一台指定的恢复主机来执行恢复演练任务,与生产库完全物理隔离,保证不影响运行中的生产库。对于检测出的第二备份数据库实例自动制定对应的数据恢复演练计划,数据库实例下线则自动删除对应的数据恢复演练计划,对数据恢复演练失败的数据库实例自动制定对应的演练计划,操作灵活。不论数据恢复演练成功或失败数据恢复演练系统都会将恢复出来的临时数据库实例删除掉,主机资源和存储资源的重复利用,不需要花太多硬件资源来进行数据恢复演练。且秉持着优先保障业务连续性原则,若当前的数据恢复可用区存在大量的备份或恢复任务则自动将数据恢复演练计划延期至下一个恢复时间窗口来执行,操作灵活。数据恢复演练计划完成时可对生成的临时数据库实例启动数据库并完成验证,由数据恢复演练系统实时分析恢复出来的数据库是否可以顺利启动,通过对比备份数据库实例与临时数据库实例的数据库版本号是否一致、数据库日志记录的位置是否一致,以判断数据恢复演练计划是否成功,不需要登录数据库实例,保障了数据库账号的安全性。数据恢复演练计划成功时恢复演练系统可自动生成和保存业务方所有数据库按照年度、季度、月度等时间维度执行的所有演练记录。业务方可自行选择数据库单个实例、多个实例、全部实例以月度、季度、年度为维度生成的演练报告,无需人工撰写演练报告,全程无需人工干预,由数据恢复演练系统自动执行,操作简单,适用性高。
进一步地,请参见图4,图4是本申请提供的数据库的数据恢复演练装置的一结构示意图。该数据库的数据恢复演练装置可以是运行于计算机设备中的一个计算机程序(包括程序代码),例如,该数据库的数据恢复演练装置为一个应用软件;该数据库的数据恢复演练装置可以用于执行本申请提供的方法中的相应步骤。如图4所示,该数据库的数据恢复演练装置可以应用于计算机设备,信息推荐装置1可以包括:获取模块10、演练制定模块20、演练执行模块30、演练验证模块40、报告生成模块50以及报告推送模块60。
获取模块10,用于获取数据的备份数据库实例的数据库实例信息。
演练制定模块20,用于根据上述获取模块获取的上述数据库实例信息制定上述备份数据库实例对应的数据恢复演练计划,上述数据恢复演练计划中至少包括上述备份数据库实例的数据恢复演练时间。
演练执行模块30,用于在上述数据恢复演练时间到来时,基于上述数据恢复演练计划对上述备份数据库实例进行恢复演练并在恢复演练完成时生成临时数据库实例。
演练验证模块40,用于根据上述备份数据库实例和上述演练执行模块30生成的临时数据库实例确定上述备份数据库实例的恢复演练是否成功。
报告生成模块50,用于在上述演练验证模块40确定上述备份数据库实例的恢复演练成功时,则生成上述备份数据库实例的数据恢复演练报告。
报告推送模块60,用于向上述备份数据库实例的业务终端推送上述报告生成模块生成的上述数据恢复演练报告。
在一种可能的实施方式中,请一并参见图5,上述数据库的数据恢复演练装置还包括:备份模块70,用于判断数据库的环境类型,若上述数据库的环境类型为生产环境,则对上述数据库的数据库实例进行备份以得到上述数据库的备份数据库实例。
在一种可能的实施方式中,上述演练执行模块30包括:第一确定单元301,用于在上述数据恢复演练时间到来时,确定当前恢复时间窗口数据恢复可用区中数据恢复演练任务的数量是否大于或者等于任务数量阈值;演练单元302,用于在上述第一确定单元301确定上述数据恢复可用区中数据恢复演练任务的数量小于任务数量阈值时,执行基于上述数据恢复演练计划对上述备份数据库实例进行恢复演练并在恢复演练完成时生成临时数据库实例的步骤;第一时间更改单元303,用于若根据上述第一确定单元301确定的上述数据恢复可用区中数据恢复演练任务的数量大于或者等于任务数量阈值时,将上述备份数据库实例的数据恢复演练时间更改为当前恢复时间窗口的下一个恢复时间窗口。
在一种可能的实施方式中,上述演练执行模块30还包括:提示推送单元304,用于在上述数据恢复演练时间到来时,若上述数据恢复演练时间与变更窗口时间冲突,则向云控制平台发送变更窗口时间冲突提示;第二时间更改单元305,用于从上述云控制平台接收上述云控制平台基于上述变更窗口时间冲突提示返回的数据恢复演练发起时间,并将上述备份数据库实例的数据恢复演练时间更改至上述数据恢复演练发起时间。
在一种可能的实施方式中,上述数据恢复演练计划中还包括上述备份数据库实例关联的多个业务功能实例;上述演练执行模块30还用于:调用上述备份数据库实例关联的各业务功能实例关联的各功能模块,通过上述各功能模块执行上述各业务功能实例的数据恢复演练任务。
在一种可能的实施方式中,上述演练验证模块40包括:版本号验证单元401,用于验证上述临时数据库实例与上述备份数据库实例的数据库版本号是否一致,若上述临时数据库实例与上述备份数据库实例的数据库版本号一致则确定上述备份数据库实例的恢复演练成功;位置验证单元402,用于验证上述临时数据库实例与上述备份数据库实例的数据库日志记录的位置是否一致,若上述临时数据库实例与上述备份数据库实例的数据库日志记录的位置一致,则确定上述备份数据库实例的恢复演练成功。
在一种可能的实施方式中,上述数据库的数据恢复演练装置还包括:清除模块80,用于在上述备份数据库实例的恢复演练成功之后,清除上述临时数据库实例。
在一种可能的实施方式中,上述备份数据库实例为上述数据库中的第一备份数据库实例,上述根据上述数据库实例信息制定上述备份数据库实例对应的数据恢复演练计划之后。
上述获取模块110还用于:在检测到上述数据库的第二备份数据库实例时,获取上述第二备份数据库实例的数据库实例信息。
上述演练制定模块20还用于:根据上述第二备份数据库实例的数据库实例信息制定上述第二备份数据库实例对应的数据恢复演练计划。
其中,上述第二备份数据库实例为上述数据库中在上述第一备份数据库实例之后生成并完成备份的数据库实例,上述第二备份数据库实例的数据恢复演练时间在上述第一备份数据库实例的数据恢复演练时间之后。
在一种可能的实施方式中,上述报告生成模块50还用于:确定数据恢复演练报告的生成时间维度,基于上述数据库中一个生成时间维度内生成的各备份数据库实例的数据恢复演练报告生成上述数据库的数据恢复演练报告;其中,上述生成时间维度包括年度、季度或者月度,上述一个生成时间维度包括一年、一个季度或者一个月。
在一种可能的实施方式中,上述报告推送模块60还包括:接收单元601,用于接收业务终端的演练报告获取请求,上述演练报告获取请求中携带数据恢复演练报告的推送路径和目标生成时间维度;第二确定单元602,用于从上述数据库中确定出基于上述接收单元601接收的演练报告获取请求中携带的目标生成时间维度内生成的目标数据库恢复演练报告。推送单元603,用于基于上述接收单元601接收的演练报告获取请求中携带的推送路径向上述业务终端推送上述目标数据库恢复演练报告。
其中,该获取模块10、演练制定模块20、演练执行模块30、演练验证模块40、报告生成模块50、报告推送模块60、备份模块70以及清除模块80的具体实现方式可以参见上述图2所对应实施例中对步骤S101-步骤S105的描述和/或上述图3所对应实施例中对步骤S201-步骤S206的描述,这里将不再继续进行赘述。另外,对采用相同方法的有益效果描述,也不再进行赘述。
进一步地,请参见图6,图6是本申请提供的计算机设备的一结构示意图。如图6所示,该计算机设备1000可以包括:至少一个处理器1001,例如CPU,至少一个网络接口1004,收发器1003,存储器1005,至少一个通信总线1002。其中,通信总线1002用于实现这些组件之间的连接通信。其中网络接口1004可选地可以包括标准的有线接口、无线接口(如WI-FI接口)。存储器1005可以是高速随机存储记忆体(random access memory,RAM)存储器,也可以是非不稳定的存储器(non-volatile memory),例如至少一个磁盘存储器。存储器1005可选地还可以是至少一个位于远离前述处理器1001的存储装置。如图6所示,作为一种计算机存储介质的存储器1005中可以包括操作系统、网络通信模块以及设备控制应用程序。
在图6所示的计算机设备1000中,网络接口1004主要用于用户终端进行网络通信;而处理器1001和收发器1003可以用于调用存储器1005中存储的设备控制应用程序,以实现:上述收发器1003,用于获取数据库的备份数据库实例的数据库实例信息;上述处理器1001,用于根据上述数据库实例信息制定上述备份数据库实例对应的数据恢复演练计划,上述数据恢复演练计划中至少包括上述备份数据库实例的数据恢复演练时间;上述处理器1001,还用于当上述数据恢复演练时间到来时,基于上述数据恢复演练计划对上述备份数据库实例进行恢复演练并在恢复演练完成时生成临时数据库实例;上述处理器1001,还用于根据上述备份数据库实例和上述临时数据库实例确定上述备份数据库实例恢复演练是否成功,若上述备份数据库实例的恢复演练成功,则生成上述备份数据库实例的数据恢复演练报告。
上述收发器1003,还用于向上述备份数据库实例的业务终端推送上述处理器1001生成的数据库恢复演练报告。
在一种可能的实施方式中,上述处理器1001,还用于判断数据库的环境类型,若上述数据库的环境类型为生产环境,则对上述数据库的数据库实例进行备份以得到上述数据库的备份数据库实例。
在一种可能的实施方式中,当上述数据恢复演练时间到来时,上述处理器1001,还用于:确定当前恢复时间窗口数据恢复可用区中数据恢复演练任务的数量是否大于或者等于任务数量阈值;若上述数据恢复可用区中数据恢复演练任务的数量小于任务数量阈值,则执行基于上述数据恢复演练计划对上述备份数据库实例进行恢复演练并在恢复演练完成时生成临时数据库实例的步骤;若上述数据恢复可用区中数据恢复演练任务的数量大于或者等于任务数量阈值,则将上述备份数据库实例的数据恢复演练时间更改为当前恢复时间窗口的下一个恢复时间窗口。
在一种可能的实施方式中,当上述数据恢复演练时间到来时,若上述数据恢复演练时间与变更窗口时间冲突,上述收发器1003,还用于向云控制平台发送变更窗口时间冲突提示,从上述云控制平台接收上述云控制平台基于上述变更窗口时间冲突提示返回的数据恢复演练发起时间,上述处理器1001,还用于将上述备份数据库实例的数据恢复演练时间更改至上述数据恢复演练发起时间。
在一种可能的实施方式中,上述数据恢复演练计划中还包括上述备份数据库实例关联的多个业务功能实例;上述处理器1001用于:调用上述备份数据库实例关联的各业务功能实例关联的各功能模块,通过上述各功能模块执行上述各业务功能实例的数据恢复演练任务。
在一种可能的实施方式中,上述处理器1001,用于验证上述临时数据库实例与上述备份数据库实例的数据库版本号是否一致,若上述临时数据库实例与上述备份数据库实例的数据库版本号一致则确定上述备份数据库实例的恢复演练成功;或者,验证上述临时数据库实例与上述备份数据库实例的数据库日志记录的位置是否一致,若上述临时数据库实例与上述备份数据库实例的数据库日志记录的位置一致,则确定上述备份数据库实例的恢复演练成功。
在一种可能的实施方式中,上述处理器1001还用于:上述备份数据库实例的恢复演练成功之后,清除上述临时数据库实例。
在一种可能的实施方式中,上述备份数据库实例为上述数据库中的第一备份数据库实例;上述根据上述数据库实例信息制定上述备份数据库实例对应的数据恢复演练计划之后,上述处理器1001还用于:当检测到上述数据库的第二备份数据库实例时,根据上述收发器1003获取的上述第二备份数据库实例的数据库实例信息,制定上述第二备份数据库实例对应的数据恢复演练计划;其中,上述第二备份数据库实例为上述数据库中在上述第一备份数据库实例之后生成并完成备份的数据库实例,上述第二备份数据库实例的数据恢复演练时间在上述第一备份数据库实例的数据恢复演练时间之后。
一种可能的实施方式中,上述处理器1001还用于:确定数据恢复演练报告的生成时间维度,基于上述数据库中一个生成时间维度内生成的各备份数据库实例的数据恢复演练报告生成上述数据库的数据恢复演练报告;其中,上述生成时间维度包括年度、季度或者月度,上述一个生成时间维度包括一年、一个季度或者一个月。
在一种可能的实施方式中,上述收发器1003还用于,接收业务终端的演练报告获取请求,上述演练报告获取请求中携带数据恢复演练报告的推送路径和目标生成时间维度;上述处理器1001,还用于从上述数据库中确定出从上述收发器1003接收的演练报告获取请求中携带的目标生成时间维度内生成的目标数据库恢复演练报告,上述收发器1003,还用于基于上述推送路径向上述业务终端推送上述目标数据库恢复演练报告。
应当理解,本申请中所描述的计算机设备1000可执行前文图2和/或图3所对应实施例中对该数据库的数据恢复演练方法的描述,也可执行前文图4和/或图5所对应实施例中对该数据库的数据恢复演练装置的描述,在此不再赘述。另外,对采用相同方法的有益效果描述,也不再进行赘述。
此外,这里需要指出的是:本申请还提供了一种计算机可读存储介质,且该计算机可读存储介质中存储有前文提及的数据库的数据恢复演练装置所执行的计算机程序,且该计算机程序包括程序指令,当该处理器执行该程序指令时,能够执行前文图2和/或图3所对应实施例中对该数据库的数据恢复演练方法的描述,因此,这里将不再进行赘述。另外,对采用相同方法的有益效果描述,也不再进行赘述。对于本申请所涉及的计算机可读存储介质实施例中未披露的技术细节,请参照本申请方法实施例的描述。作为示例,程序指令可被部署为在一个计算设备上执行,或者在位于一个地点的多个计算设备上执行,又或者,在分布在多个地点且通过通信网络互连的多个计算设备上执行,分布在多个地点且通过通信网络互连的多个计算设备可以组成区块链系统。
可选的,本申请涉及的存储介质如计算机可读存储介质可以是非易失性的,也可以是易失性的。
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机程序来指令相关的硬件来完成,上述的程序可存储于一计算机可读取存储介质中,该程序在执行时,可包括如上述各方法的实施例的流程。其中,上述计算机可读存储介质可以是前述任一实施例提供的信息推荐装置或者上述设备的内部存储单元,例如电子设备的硬盘或内存。该计算机可读存储介质也可以是该电子设备的外部存储设备,例如该电子设备上配备的插接式硬盘,智能存储卡(smart media card, SMC),安全数字(secure digital, SD)卡,闪存卡(flash card)等。上述计算机可读存储介质还可以包括磁碟、光盘、只读存储记忆体(read-only memory,ROM)或随机存储记忆体等。进一步地,该计算机可读存储介质还可以既包括该电子设备的内部存储单元也包括外部存储设备。该计算机可读存储介质用于存储该计算机程序以及该电子设备所需的其它程序和数据。该计算机可读存储介质还可以用于暂时地存储已经输出或者将要输出的数据。
本申请的权利要求书和说明书及附图中的术语“第一”、“第二”等是用于区别不同对象,而不是用于描述特定顺序。此外,术语“包括”和“具有”以及它们任何变形,意图在于覆盖不排他的包含。例如包含了一系列步骤或单元的过程、方法、系统、产品或设备没有限定于已列出的步骤或单元,而是可选地还包括没有列出的步骤或单元,或可选地还包括对于这些过程、方法、产品或设备固有的其它步骤或单元。在本文中提及“实施例”意味着,结合实施例描述的特定特征、结构或特性可以包含在本申请的至少一个实施例中。在说明书中的各个位置展示该短语并不一定均是指相同的实施例,也不是与其它实施例互斥的独立的或备选的实施例。本领域技术人员显式地和隐式地理解的是,本文所描述的实施例可以与其它实施例相结合。在本申请说明书和所附权利要求书中使用的术语“和/或”是指相关联列出的项中的一个或多个的任何组合以及所有可能组合,并且包括这些组合。
本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、计算机软件或者二者的结合来实现,为了清楚地说明硬件和软件的可互换性,在上述说明中已经按照功能一般性地描述了各示例的组成及步骤。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。
以上所揭露的仅为本申请较佳实施例而已,当然不能以此来限定本申请之权利范围,因此依本申请权利要求所作的等同变化,仍属本申请所涵盖的范围。

Claims (20)

  1. 一种数据库的数据恢复演练方法,其中,所述方法包括:
    获取数据库的备份数据库实例的数据库实例信息,并根据所述数据库实例信息制定所述备份数据库实例对应的数据恢复演练计划,所述数据恢复演练计划中至少包括所述备份数据库实例的数据恢复演练时间;
    当所述数据恢复演练时间到来时,基于所述数据恢复演练计划对所述备份数据库实例进行恢复演练并在恢复演练完成时生成临时数据库实例;
    根据所述备份数据库实例和所述临时数据库实例确定所述备份数据库实例的恢复演练是否成功;
    若所述备份数据库实例的恢复演练成功,则生成所述备份数据库实例的数据恢复演练报告,并向所述备份数据库实例的业务终端推送所述数据恢复演练报告。
  2. 根据权利要求1所述的方法,其中,当所述数据恢复演练时间到来时,所述方法还包括:
    确定当前恢复时间窗口数据恢复可用区中数据恢复演练任务的数量是否大于或者等于任务数量阈值;
    若所述数据恢复可用区中数据恢复演练任务的数量小于任务数量阈值,则执行基于所述数据恢复演练计划对所述备份数据库实例进行恢复演练并在恢复演练完成时生成临时数据库实例的步骤;
    若所述数据恢复可用区中数据恢复演练任务的数量大于或者等于任务数量阈值,则将所述备份数据库实例的数据恢复演练时间更改为当前恢复时间窗口的下一个恢复时间窗口。
  3. 根据权利要求1所述的方法,其中,当所述数据恢复演练时间到来时,所述方法还包括:
    若所述数据恢复演练时间与变更窗口时间冲突,则向云控制平台发送变更窗口时间冲突提示;
    从所述云控制平台接收所述云控制平台基于所述变更窗口时间冲突提示返回的数据恢复演练发起时间,并将所述备份数据库实例的数据恢复演练时间更改至所述数据恢复演练发起时间。
  4. 根据权利要求2或3所述的方法,其中,所述数据恢复演练计划中还包括所述备份数据库实例关联的多个业务功能实例;所述基于所述数据恢复演练计划对所述备份数据库实例进行恢复演练包括:
    调用所述备份数据库实例关联的各业务功能实例关联的各功能模块,通过所述各功能模块执行所述各业务功能实例的数据恢复演练任务。
  5. 根据权利要求1所述的方法,其中,所述根据所述备份数据库实例和所述临时数据库实例确定所述备份数据库实例的恢复演练是否成功,包括:
    验证所述临时数据库实例与所述备份数据库实例的数据库版本号是否一致,若所述临时数据库实例与所述备份数据库实例的数据库版本号一致则确定所述备份数据库实例的恢复演练成功;
    或者,验证所述临时数据库实例与所述备份数据库实例的数据库日志记录的位置是否一致,若所述临时数据库实例与所述备份数据库实例的数据库日志记录的位置一致,则确定所述备份数据库实例的恢复演练成功。
  6. 根据权利要求1-3任一项所述的方法,其中,所述备份数据库实例为所述数据库中的第一备份数据库实例;所述根据所述数据库实例信息制定所述备份数据库实例对应的数据恢复演练计划之后,所述方法还包括:
    当检测到所述数据库的第二备份数据库实例时,获取所述第二备份数据库实例的数据库实例信息,并根据所述第二备份数据库实例的数据库实例信息制定所述第二备份数据库实例对应的数据恢复演练计划;
    其中,所述第二备份数据库实例为所述数据库中在所述第一备份数据库实例之后生成并完成备份的数据库实例,所述第二备份数据库实例的数据恢复演练时间在所述第一备份数据库实例的数据恢复演练时间之后。
  7. 根据权利要求6所述的方法,其中,所述方法还包括:
    确定数据恢复演练报告的生成时间维度,基于所述数据库中一个生成时间维度内生成的各备份数据库实例的数据恢复演练报告生成所述数据库的数据库恢复演练报告;
    其中,所述生成时间维度包括年度、季度或者月度,所述一个生成时间维度包括一年、一个季度或者一个月。
  8. 一种数据库的数据恢复演练装置,其中,包括:
    获取模块,用于获取数据的备份数据库实例的数据库实例信息;
    演练制定模块,用于根据所述获取模块获取的所述数据库实例信息制定所述备份数据库实例对应的数据恢复演练计划,所述数据恢复演练计划中至少包括所述备份数据库实例的数据恢复演练时间;
    演练执行模块,用于当所述数据恢复演练时间到来时,基于所述数据恢复演练计划对所述备份数据库实例进行恢复演练并在恢复演练完成时生成临时数据库实例;
    演练验证模块,用于根据所述备份数据库实例和所述演练执行模块生成的所述临时数据库实例确定所述备份数据库实例的恢复演练是否成功;
    报告生成模块,用于在所述演练验证模块确定所述备份数据库实例的恢复演练成功时,生成所述备份数据库实例的数据恢复演练报告;
    报告推送模块,用于向所述备份数据库实例的业务终端推送所述报告生成模块生成的所述数据恢复演练报告。
  9. 一种计算机设备,其中,包括:处理器、存储器、收发器以及网络接口;
    所述处理器与存储器、收发器以及网络接口相连,其中,网络接口用于提供数据通信功能,所述存储器用于存储程序代码,所述收发器和所述处理器用于调用所述程序代码,执行以下方法:
    获取数据库的备份数据库实例的数据库实例信息,并根据所述数据库实例信息制定所述备份数据库实例对应的数据恢复演练计划,所述数据恢复演练计划中至少包括所述备份数据库实例的数据恢复演练时间;
    当所述数据恢复演练时间到来时,基于所述数据恢复演练计划对所述备份数据库实例进行恢复演练并在恢复演练完成时生成临时数据库实例;
    根据所述备份数据库实例和所述临时数据库实例确定所述备份数据库实例的恢复演练是否成功;
    若所述备份数据库实例的恢复演练成功,则生成所述备份数据库实例的数据恢复演练报告,并向所述备份数据库实例的业务终端推送所述数据恢复演练报告。
  10. 根据权利要求9所述的计算机设备,其中,当所述数据恢复演练时间到来时,所述处理器还用于执行:
    确定当前恢复时间窗口数据恢复可用区中数据恢复演练任务的数量是否大于或者等于任务数量阈值;
    若所述数据恢复可用区中数据恢复演练任务的数量小于任务数量阈值,则执行基于所述数据恢复演练计划对所述备份数据库实例进行恢复演练并在恢复演练完成时生成临时数据库实例的步骤;
    若所述数据恢复可用区中数据恢复演练任务的数量大于或者等于任务数量阈值,则将所述备份数据库实例的数据恢复演练时间更改为当前恢复时间窗口的下一个恢复时间窗口。
  11. 根据权利要求9所述的计算机设备,其中,当所述数据恢复演练时间到来时,所述处理器还用于执行:
    若所述数据恢复演练时间与变更窗口时间冲突,则向云控制平台发送变更窗口时间冲突提示;
    从所述云控制平台接收所述云控制平台基于所述变更窗口时间冲突提示返回的数据恢复演练发起时间,并将所述备份数据库实例的数据恢复演练时间更改至所述数据恢复演练发起时间。
  12. 根据权利要求10或11所述的计算机设备,其中,所述数据恢复演练计划中还包括所述备份数据库实例关联的多个业务功能实例;执行所述基于所述数据恢复演练计划对所述备份数据库实例进行恢复演练包括:
    调用所述备份数据库实例关联的各业务功能实例关联的各功能模块,通过所述各功能模块执行所述各业务功能实例的数据恢复演练任务。
  13. 根据权利要求9所述的计算机设备,其中,执行所述根据所述备份数据库实例和所述临时数据库实例确定所述备份数据库实例的恢复演练是否成功,包括:
    验证所述临时数据库实例与所述备份数据库实例的数据库版本号是否一致,若所述临时数据库实例与所述备份数据库实例的数据库版本号一致则确定所述备份数据库实例的恢复演练成功;
    或者,验证所述临时数据库实例与所述备份数据库实例的数据库日志记录的位置是否一致,若所述临时数据库实例与所述备份数据库实例的数据库日志记录的位置一致,则确定所述备份数据库实例的恢复演练成功。
  14. 根据权利要求9-11任一项所述的计算机设备,其中,所述备份数据库实例为所述数据库中的第一备份数据库实例;所述根据所述数据库实例信息制定所述备份数据库实例对应的数据恢复演练计划之后,所述处理器还用于执行:
    当检测到所述数据库的第二备份数据库实例时,获取所述第二备份数据库实例的数据库实例信息,并根据所述第二备份数据库实例的数据库实例信息制定所述第二备份数据库实例对应的数据恢复演练计划;
    其中,所述第二备份数据库实例为所述数据库中在所述第一备份数据库实例之后生成并完成备份的数据库实例,所述第二备份数据库实例的数据恢复演练时间在所述第一备份数据库实例的数据恢复演练时间之后。
  15. 一种计算机可读存储介质,其中,所述计算机可读存储介质存储有计算机程序,所述计算机程序包括程序指令,所述程序指令被处理器执行时,执行以下方法:
    获取数据库的备份数据库实例的数据库实例信息,并根据所述数据库实例信息制定所述备份数据库实例对应的数据恢复演练计划,所述数据恢复演练计划中至少包括所述备份数据库实例的数据恢复演练时间;
    当所述数据恢复演练时间到来时,基于所述数据恢复演练计划对所述备份数据库实例进行恢复演练并在恢复演练完成时生成临时数据库实例;
    根据所述备份数据库实例和所述临时数据库实例确定所述备份数据库实例的恢复演练是否成功;
    若所述备份数据库实例的恢复演练成功,则生成所述备份数据库实例的数据恢复演练报告,并向所述备份数据库实例的业务终端推送所述数据恢复演练报告。
  16. 根据权利要求15所述的计算机可读存储介质,其中,当所述数据恢复演练时间到来时,所述程序指令被处理器执行时还用于:
    确定当前恢复时间窗口数据恢复可用区中数据恢复演练任务的数量是否大于或者等于任务数量阈值;
    若所述数据恢复可用区中数据恢复演练任务的数量小于任务数量阈值,则执行基于所述数据恢复演练计划对所述备份数据库实例进行恢复演练并在恢复演练完成时生成临时数据库实例的步骤;
    若所述数据恢复可用区中数据恢复演练任务的数量大于或者等于任务数量阈值,则将所述备份数据库实例的数据恢复演练时间更改为当前恢复时间窗口的下一个恢复时间窗口。
  17. 根据权利要求15所述的计算机可读存储介质,其中,当所述数据恢复演练时间到来时,所述程序指令被处理器执行时还用于:
    若所述数据恢复演练时间与变更窗口时间冲突,则向云控制平台发送变更窗口时间冲突提示;
    从所述云控制平台接收所述云控制平台基于所述变更窗口时间冲突提示返回的数据恢复演练发起时间,并将所述备份数据库实例的数据恢复演练时间更改至所述数据恢复演练发起时间。
  18. 根据权利要求16或17所述的计算机可读存储介质,其中,所述数据恢复演练计划中还包括所述备份数据库实例关联的多个业务功能实例;执行所述基于所述数据恢复演练计划对所述备份数据库实例进行恢复演练包括:
    调用所述备份数据库实例关联的各业务功能实例关联的各功能模块,通过所述各功能模块执行所述各业务功能实例的数据恢复演练任务。
  19. 根据权利要求15所述的计算机可读存储介质,其中,执行所述根据所述备份数据库实例和所述临时数据库实例确定所述备份数据库实例的恢复演练是否成功,包括:
    验证所述临时数据库实例与所述备份数据库实例的数据库版本号是否一致,若所述临时数据库实例与所述备份数据库实例的数据库版本号一致则确定所述备份数据库实例的恢复演练成功;
    或者,验证所述临时数据库实例与所述备份数据库实例的数据库日志记录的位置是否一致,若所述临时数据库实例与所述备份数据库实例的数据库日志记录的位置一致,则确定所述备份数据库实例的恢复演练成功。
  20. 根据权利要求15-17任一项所述的计算机可读存储介质,其中,所述备份数据库实例为所述数据库中的第一备份数据库实例;所述根据所述数据库实例信息制定所述备份数据库实例对应的数据恢复演练计划之后,所述程序指令被处理器执行时还用于:
    当检测到所述数据库的第二备份数据库实例时,获取所述第二备份数据库实例的数据库实例信息,并根据所述第二备份数据库实例的数据库实例信息制定所述第二备份数据库实例对应的数据恢复演练计划;
    其中,所述第二备份数据库实例为所述数据库中在所述第一备份数据库实例之后生成并完成备份的数据库实例,所述第二备份数据库实例的数据恢复演练时间在所述第一备份数据库实例的数据恢复演练时间之后。
PCT/CN2021/083494 2020-12-18 2021-03-29 数据库的数据恢复演练方法、装置及存储介质 WO2022126910A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202011511684.3A CN112527564A (zh) 2020-12-18 2020-12-18 数据库的数据恢复演练方法、装置及存储介质
CN202011511684.3 2020-12-18

Publications (1)

Publication Number Publication Date
WO2022126910A1 true WO2022126910A1 (zh) 2022-06-23

Family

ID=75001767

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/083494 WO2022126910A1 (zh) 2020-12-18 2021-03-29 数据库的数据恢复演练方法、装置及存储介质

Country Status (2)

Country Link
CN (1) CN112527564A (zh)
WO (1) WO2022126910A1 (zh)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112527564A (zh) * 2020-12-18 2021-03-19 平安科技(深圳)有限公司 数据库的数据恢复演练方法、装置及存储介质
CN115292097B (zh) * 2022-08-22 2023-05-23 广州鼎甲计算机科技有限公司 数据库实例创建方法、装置、设备、存储介质和程序产品

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106095614A (zh) * 2016-05-27 2016-11-09 上海新炬网络信息技术有限公司 一种数据库容灾演练管控系统
CN106776140A (zh) * 2016-12-21 2017-05-31 博飞信息科技(上海)有限公司 超容灾备恢复一体机的装置及方法
CN111190769A (zh) * 2019-12-27 2020-05-22 柏科数据技术(深圳)股份有限公司 一种用于自动演练的灾备技术
WO2020131482A1 (en) * 2018-12-18 2020-06-25 Storage Engine, Inc. Methods, apparatuses and systems for cloud-based disaster recovery
CN112527564A (zh) * 2020-12-18 2021-03-19 平安科技(深圳)有限公司 数据库的数据恢复演练方法、装置及存储介质

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106095614A (zh) * 2016-05-27 2016-11-09 上海新炬网络信息技术有限公司 一种数据库容灾演练管控系统
CN106776140A (zh) * 2016-12-21 2017-05-31 博飞信息科技(上海)有限公司 超容灾备恢复一体机的装置及方法
WO2020131482A1 (en) * 2018-12-18 2020-06-25 Storage Engine, Inc. Methods, apparatuses and systems for cloud-based disaster recovery
CN111190769A (zh) * 2019-12-27 2020-05-22 柏科数据技术(深圳)股份有限公司 一种用于自动演练的灾备技术
CN112527564A (zh) * 2020-12-18 2021-03-19 平安科技(深圳)有限公司 数据库的数据恢复演练方法、装置及存储介质

Also Published As

Publication number Publication date
CN112527564A (zh) 2021-03-19

Similar Documents

Publication Publication Date Title
US20200272620A1 (en) Transaction processing at non-relational databases
US9350749B2 (en) Application attack monitoring
US11036598B2 (en) Notification mechanism for disaster recovery events
AU2017255443B2 (en) Monitoring of application program interface integrations
US20130282537A1 (en) Utilizing multiple versions of financial allocation rules in a budgeting process
US10122815B1 (en) Dynamic class mapping in messaging middleware
US20170228296A1 (en) Hierarchical system manager rollback
WO2022126910A1 (zh) 数据库的数据恢复演练方法、装置及存储介质
US20180307472A1 (en) Simultaneous deployment on cloud devices and on on-premise devices
US11151025B1 (en) Generating software test plans based at least in part on monitored traffic of a production application
CN103678446B (zh) 基于数据视图和数据库表的改进的模式映射
US8862937B2 (en) Method and system for migrating data from multiple sources
US20180307575A1 (en) Automated test generation for multi-interface and multi-platform enterprise virtualization management environment
AU2013200887A1 (en) Multi-entity test case execution workflow
CN110555150A (zh) 一种数据监控方法、装置、设备和存储介质
US10970159B1 (en) Automated system maintenance capabilities for a computing system
WO2023050676A1 (zh) 对象处理方法以及电子设备
US20090138510A1 (en) Method and apparatus for associating help desk ticket with affected data processing system
US9830173B1 (en) Proxy simulation service for testing stateless systems
US8903774B2 (en) Techniques for leveraging replication to provide rolling point in time backup with simplified restoration through distributed transactional re-creation
CN111240981A (zh) 一种接口测试方法、系统及平台
US12020039B2 (en) Compute instance warmup operations
WO2022241945A1 (zh) 一种数据处理方法、设备以及计算机可读存储介质
CN115330171A (zh) 业务流程控制方法、装置、计算机设备及可读存储介质
CN115168203A (zh) 接口模拟方法、装置、系统、计算机设备和存储介质

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21904850

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 21904850

Country of ref document: EP

Kind code of ref document: A1