Database backup method and device, equipment, storage medium and program product
By acquiring backup strategy information, generating status tracking tables, and monitoring the database backup strategy status in real time, the problem of lack of archiving for long-term backups in large database backups is solved, achieving backup integrity and recoverability.
Patent Information
- Application Number
- CN202511227621.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-29
- Publication Date
- 2025-12-16
AI Technical Summary
During large database backups, the lack of archiving in long-term backups leads to insufficient backup integrity, making it impossible to restore the database from the annual full backup.
By acquiring backup strategy information, identifying long-term backup needs, generating a status tracking table, monitoring the backup strategy's job status in real time, and adjusting the backup strategy based on the updated status tracking table, the integrity of long-term backups is ensured.
It enables archived backups to meet long-term retention requirements during long-term backups, improving backup integrity and recoverability, and preventing newly generated archived logs during full backups from being overwritten by short-term backups.
Smart Images

Figure CN121144104A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of distributed technology, and in particular to a database backup method, apparatus, device, storage medium, and program product. Background Technology
[0002] Data backup is a core task in information technology and database management, aimed at ensuring data security and business continuity.
[0003] In existing technologies, databases are combined with centralized backup software, and the backup retention period is adjusted to an annual period according to a preset adjustment cycle, thereby avoiding the need to back up the database again for long periods. However, when dealing with large databases, full backups extend to subsequent days. At this time, archived backups from those subsequent days will be automatically called. If the archived backups have not been backed up to tape by the end of the full backup, while short-term backups are still executed as scheduled, the newly generated archived logs during the full backup period will be overwritten by subsequent short-term backups, thus expiring prematurely. When it is necessary to restore the annual full backup, the database cannot be opened due to the lack of newly generated archived logs during the full backup period.
[0004] Therefore, existing technologies suffer from insufficient backup integrity. Summary of the Invention
[0005] This application provides a database backup method, apparatus, device, storage medium, and program product to address the situation where long-term backups lack archiving when dealing with large, multi-day backup databases, thereby improving backup integrity.
[0006] Firstly, this application provides a database backup method, including:
[0007] Obtain backup strategy information for the database to be backed up;
[0008] Based on the backup strategy information, identify whether the database to be backed up has a long-term backup requirement;
[0009] If the database to be backed up has a long-term backup requirement, a status tracking table will be generated based on the backup strategy information.
[0010] Monitor the backup strategy job status of the database to be backed up in real time;
[0011] Update the status tracking table according to the backup strategy job status to obtain the updated status tracking table;
[0012] Adjust the backup strategy based on the updated status tracking table.
[0013] Secondly, this application provides a database backup device, comprising:
[0014] The acquisition module is used to obtain backup strategy information for the database to be backed up;
[0015] The identification module is used to identify whether the database to be backed up has a long-term backup requirement based on the backup strategy information.
[0016] The generation module is used to generate a status tracking table based on the backup strategy information if the database to be backed up has a long-term backup requirement.
[0017] The monitoring module is used to monitor the backup strategy operation status of the database to be backed up in real time.
[0018] The update module is used to update the status tracking table according to the backup strategy job status to obtain the updated status tracking table;
[0019] The adjustment module is used to adjust the backup strategy based on the updated status tracking table.
[0020] Thirdly, this application provides an electronic device, including: a processor, and a memory communicatively connected to the processor;
[0021] The memory stores the instructions that the computer executes;
[0022] The processor executes computer execution instructions stored in memory to implement the first aspect and / or various possible embodiments of the first aspect as described above.
[0023] Fourthly, a computer-readable storage medium storing computer-executable instructions that, when executed by a processor, are used to implement the first aspect and / or various possible embodiments of the first aspect.
[0024] Fifthly, a computer program product includes a computer program that, when executed by a processor, implements the first aspect and / or various possible embodiments of the first aspect.
[0025] The database backup method, apparatus, device, storage medium, and program products provided in this application obtain backup strategy information of the database to be backed up and identify whether the database to be backed up has a long-term backup requirement. If the database to be backed up has a long-term backup requirement, a status tracking table is generated according to the backup strategy information to monitor the backup strategy operation status of the database to be backed up in real time. The status tracking table is updated according to the backup strategy operation status to obtain an updated status tracking table, thereby adjusting the backup strategy. This ensures that the archive backups during long-term backups meet the long-term retention capability and improve the integrity of the backup. Attached Figure Description
[0026] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.
[0027] Figure 1 A schematic diagram of a database backup system architecture provided in this application embodiment;
[0028] Figure 2 A flowchart illustrating a database backup method provided in this application embodiment. Figure 1 ;
[0029] Figure 3 A flowchart illustrating a database backup method provided in this application embodiment. Figure 2 ;
[0030] Figure 4 A flowchart illustrating a database backup method provided in this application embodiment. Figure 3 ;
[0031] Figure 5 A flowchart illustrating a database backup method provided in this application embodiment. Figure 4 ;
[0032] Figure 6 This is a schematic diagram of the structure of a database backup device provided in an embodiment of this application;
[0033] Figure 7 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application.
[0034] The accompanying drawings illustrate specific embodiments of this application, which will be described in more detail below. These drawings and descriptions are not intended to limit the scope of the concept in any way, but rather to illustrate the concepts of this application to those skilled in the art through reference to particular embodiments. Detailed Implementation
[0035] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.
[0036] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties. Furthermore, the collection, storage, use, processing, transmission, provision, disclosure, and application of the relevant data all comply with the relevant laws, regulations, and standards of the relevant countries and regions, have taken necessary confidentiality measures, do not violate public order and good morals, and provide corresponding operation access points for users to choose to authorize or refuse.
[0037] It should be noted that the database backup method, apparatus, device, storage medium, and program product provided in this application can be used in the field of distributed technology, or in any field other than the field of distributed technology. The application field of the database backup method, apparatus, device, storage medium, and program product in this application is not limited.
[0038] First, let me explain the terms used in this application:
[0039] System log: refers to the file in which the operating system or application records logs on a daily basis;
[0040] Centralized backup: refers to a method of archiving and backing up files;
[0041] Offline backup: refers to a backup method that preserves files on magnetic tape media;
[0042] Backup centralization software refers to a tool that centrally manages and executes data backup tasks. Backup centralization software includes a backup master server, a media server, and clients.
[0043] Backup domain: refers to the scope of backup. For example, a centralized backup software includes a backup master server, and a backup master server includes up to 100 media servers. The management scope of a backup master server is a backup domain.
[0044] Long-term backup: refers to a backup method with a backup retention period of 5 to 20 years, a backup frequency of monthly backups, and regular backups to tape to ensure long-term backup retention.
[0045] Archive backup tool: refers to a tool that comes with the database system and links with centralized backup software to provide an interface for backup.
[0046] In existing technologies, in order to ensure that long-term data is backed up offline and thus restore historical data, a period is usually selected each month and the retention period for long-term data backup is adjusted to an annual period to avoid backing up the long-term database again.
[0047] The backup process typically involves backing up data, archived logs, and control files. However, when the database is large, a full backup cannot be completed within a day, causing the backup data to be carried over to subsequent days. In this case, short-cycle backups are still executed as planned, but the archived logs newly generated during the full backup period cannot enter the archived log backup stage because the full backup is not completed. As a result, the archived logs newly generated during the full backup period are overwritten by subsequent short-cycle backups, causing them to expire prematurely. When it is necessary to restore the annual full backup, the archived logs newly generated during the full backup period are deleted due to the short-cycle strategy, leaving only the data and control files. The backup integrity is insufficient, and the database cannot be opened.
[0048] To address the aforementioned issues, the core concept of this application is to automatically analyze backup jobs at regular intervals, check backup status, and update backup strategies in a timely manner, thereby enabling archived backups during long-term backups to meet the requirements for long-term retention.
[0049] Optionally, Figure 1 This application provides a schematic diagram of a database backup system architecture, as shown in the embodiments. Figure 1 As shown, the database backup system architecture includes a database 101, backup centralization software 102, a backup status monitoring unit 103, a backup strategy adjustment unit 104, and a status tracking table 105. The backup status monitoring unit 103 and the backup strategy adjustment unit 104 are connected to the backup centralization software 102 and the status tracking table 105, respectively. The backup status monitoring unit 103 monitors the execution status of backup strategies in real time, identifies long-term backup requirements, and updates the status tracking table 105. The backup strategy adjustment unit 104 periodically obtains the job status of all currently executing backup strategies through the backup centralization software 102. The database 101 and the backup centralization software 102 are connected to achieve database backup.
[0050] The technical solution of this application and how the technical solution of this application solves the above-mentioned technical problems are described in detail below with specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments. The embodiments of this application will now be described with reference to the accompanying drawings.
[0051] Figure 2 A flowchart illustrating a database backup method provided in this application embodiment. Figure 1 ,like Figure 2 As shown, the method includes:
[0052] S201. Obtain backup strategy information for the database to be backed up.
[0053] Optionally, obtain backup strategy information for the database to be backed up, including:
[0054] The backup strategy list of the database to be backed up is obtained through the application programming interface of the centralized backup software; the backup strategy list includes at least one backup strategy, as well as the backup type and backup frequency of the backup strategy.
[0055] In this embodiment, the backup types include full backup and incremental archiving; the backup frequency includes once a week and once a month.
[0056] S202. Based on the backup strategy information, identify whether the database to be backed up has a long-term backup requirement.
[0057] Optionally, based on backup strategy information, identify whether the database to be backed up has a long-term backup requirement, including:
[0058] Determine whether the database to be backed up has a long-term backup requirement based on at least one of the following: the number of backup strategies, backup type, and backup frequency in the backup strategy list.
[0059] In this embodiment, if the backup type is full backup and the backup frequency is once a week, the backup strategy is a short-term full backup strategy; if the backup type is full backup and the backup frequency is once a month, the backup strategy is a long-term full backup strategy. When the backup strategy list in the database to be backed up includes two full backup strategies, it is determined that the database to be backed up has a long-term backup requirement.
[0060] For example, if the backup strategy list in the database to be backed up contains a short-term full backup strategy with a backup type of full backup and a backup frequency of once a week, and a long-term full backup strategy with a backup type of full backup and a backup frequency of once a month, then it is determined that the database to be backed up has a long-term backup requirement.
[0061] S203. If the database to be backed up has a long-term backup requirement, a status tracking table is generated based on the backup strategy information.
[0062] In this embodiment, the status tracking table includes the unique name of the database to be backed up, short-term full backup strategy, long-term full backup strategy, short-cycle archiving strategy, and adjustment status; the adjustment status includes normal, abnormal, and long-term execution, and the initial value of the adjustment status is normal.
[0063] S204. Monitor the backup strategy job status of the database to be backed up in real time.
[0064] In this embodiment, the backup strategy job status includes running, completed, and failed; according to a preset monitoring cycle, the backup strategy job status of the backup strategy in the database to be backed up is obtained through the application programming interface of the centralized backup software, wherein the preset monitoring cycle can be 5 minutes.
[0065] S205. Update the status tracking table according to the backup strategy job status to obtain the updated status tracking table.
[0066] In this embodiment, if the backup strategy operation status of the long-term full backup strategy is running, the adjustment status in the update status tracking table is updated to long-term execution; if the backup strategy operation status of the long-term full backup strategy is completed or failed, the adjustment status in the update status tracking table is updated to normal, and the operation result of the backup strategy is recorded, wherein the operation result of the backup strategy includes success or failure.
[0067] S206. Adjust the backup strategy based on the updated status tracking table.
[0068] In this embodiment, if the status in the updated status tracking table is adjusted to "long-term execution", the retention period parameters and tape pool configuration parameters of the long-term full backup strategy are obtained through the application programming interface of the centralized backup software. Based on the retention period parameters and tape pool configuration parameters of the long-term full backup strategy, the retention period parameters and tape pool configuration parameters in the short-term archiving strategy are updated synchronously to make the retention period parameters and tape pool configuration parameters of the long-term full backup strategy and the short-term archiving strategy consistent. At the same time, the short-term full backup strategy is commented out to temporarily disable the short-term full backup strategy and prevent conflicts between the short-term full backup strategy and the long-term full backup strategy.
[0069] The database backup method provided in this application obtains backup strategy information of the database to be backed up through the application programming interface of centralized backup software to identify whether the database to be backed up has long-term backup requirements, rationally plan backup resources, and reduce resource waste; it generates a status tracking table to monitor the execution status of the backup strategy in real time to ensure the smooth progress of the backup process; it also updates the status tracking table regularly to promptly identify and respond to problems that occur during the backup process, ensuring data security and recoverability; and it adjusts the backup strategy according to the updated status tracking table, synchronously updating the parameters of the long-term full backup strategy and the short-term archiving strategy, avoiding conflicts between the long-term full backup strategy and the short-term archiving strategy, and improving the efficiency and stability of the backup system.
[0070] Figure 3 A flowchart illustrating a database backup method provided in this application embodiment. Figure 2 In the above Figure 2 Based on the illustrated embodiments, as Figure 3 As shown, the generation of the status tracking table based on the backup strategy information in step S203 above is explained in detail, including:
[0071] S301. Obtain the preset tracking fields; wherein, the preset tracking fields include the database unique name, short-term full backup strategy, short-term archive strategy, long-term full backup strategy, and adjustment status.
[0072] In this embodiment, the short-cycle archiving strategy is an incremental archiving strategy corresponding to short-cycle full backup.
[0073] S302. Filter the backup strategy information according to the preset tracking fields.
[0074] In this embodiment, by using preset tracking fields, databases to be backed up are selected from the backup strategy information that have a short-term full backup strategy with a backup type of full backup and a backup frequency of once a week, and a long-term full backup strategy with a backup type of full backup and a backup frequency of once a month. In other words, databases with long-term backup requirements are selected.
[0075] S303. Generate a status tracking table based on the filtering results and preset tracking fields.
[0076] In this embodiment, the databases to be backed up that have long-term backup requirements, along with their unique database names, short-term full backup strategy names, short-term archive strategy names, long-term full backup strategy names, and adjustment status, are written into a predefined status tracking table.
[0077] The database backup method provided in this application provides a way to filter backup strategy information by obtaining preset tracking fields, identify databases that have long-term backup requirements, generate a status tracking table to record backup strategy information and adjust status, thereby improving the efficiency and accuracy of backup management.
[0078] Optionally, after S303, the backup strategy job status of the database to be backed up is monitored in real time, including:
[0079] S304. Monitor the backup strategy job status of the database to be backed up in real time through the application programming interface of the centralized backup software; the backup strategy job status includes running, completed, and failed.
[0080] In this embodiment, by monitoring the backup strategy operation status of the database to be backed up in real time, the response speed during the backup process can be effectively improved and the response time reduced, thereby achieving fast backup.
[0081] Figure 4 A flowchart illustrating a database backup method provided in this application embodiment. Figure 3 In the above Figure 2 Based on the illustrated embodiments, as Figure 4 As shown, the process of updating the status tracking table according to the backup strategy job status in step S205 above to obtain the updated status tracking table is described in detail, including:
[0082] S401. Based on the backup policy job status, determine whether there is a running long-term full backup policy in the data to be backed up.
[0083] In this embodiment, long-term full backup strategies with a running status are filtered to update the status tracking table in real time, thereby adjusting the backup strategy in a timely manner and preventing newly generated archived logs during the full backup period from being overwritten by subsequent short-cycle backups.
[0084] S402. If it exists, update the adjustment status in the status tracking table to "long-term execution".
[0085] S403. If the backup strategy operation status of the long-term full backup strategy is completed or failed, then the adjustment status in the update status tracking table should be normal.
[0086] In this embodiment, the adjustment status in the status tracking table is determined by the backup strategy operation status of the long-term full backup strategy, so as to accurately and timely adjust the backup strategy and enable the archived backup during long-term backup to meet the long-term retention capability.
[0087] The database backup method provided in this application embodiment achieves dynamic management of the status tracking table and improves the flexibility of the backup strategy by monitoring the backup strategy operation status of the long-term full backup strategy in real time and updating the adjustment status in the status tracking table in a timely manner.
[0088] Figure 5 A flowchart illustrating a database backup method provided in this application embodiment. Figure 4 In the above Figure 2 Based on the illustrated embodiments, as Figure 5 As shown, the adjustment of the backup strategy based on the updated status tracking table in step S206 above is explained in detail, including:
[0089] Adjust the policy parameters in the backup policy information according to the updated status tracker table; the policy parameters include backup retention period parameters and tape pool parameters.
[0090] Furthermore, based on the updated status tracking table, adjust the policy parameters in the backup policy information, including:
[0091] S501. Obtain the adjustment status from the updated status tracking table.
[0092] In this embodiment, the current backup strategy to be executed can be determined by the adjustment status in the updated status tracking table, thus avoiding the automatic execution of short-term full backup strategies, which would cause newly generated archived logs during the full backup period to be overwritten by subsequent short-cycle backups.
[0093] S502. If the adjustment status is "Long-term execution", then obtain the backup retention period parameters and tape pool parameters of the long-term full backup strategy through the application programming interface of the centralized backup software.
[0094] In this embodiment, the retention period parameter value for the long-term full backup strategy is 5 to 20 years.
[0095] S503. Based on the backup retention period parameters and tape pool parameters of the long-term full backup strategy, update the backup retention period parameters and tape pool parameters of the short-term archive strategy in the updated status tracking table.
[0096] In this embodiment, based on the retention period parameters and tape pool configuration parameters of the long-term full backup strategy, the retention period parameters and tape pool configuration parameters of the short-term archiving strategy are updated synchronously to ensure that the retention period parameters and tape pool configuration parameters of the long-term full backup strategy and the short-term archiving strategy are consistent. At the same time, the short-term full backup strategy is commented out to temporarily disable the short-term full backup strategy and prevent conflict between the short-term full backup strategy and the long-term full backup strategy.
[0097] This application provides a database backup method that determines a long-term full backup strategy that is in long-term execution through an updated status tracking table, and obtains the backup retention period parameters and tape pool parameters of the long-term full backup strategy through the application programming interface of the centralized backup software. The backup retention period parameters and tape pool parameters of the short-term archiving strategy are updated synchronously to avoid the short-term archiving strategy from being updated in time, causing newly generated archived logs during the full backup period to expire prematurely.
[0098] Figure 6 This is a schematic diagram of the structure of a database backup device provided in an embodiment of this application, as shown below. Figure 6 As shown, the database backup device includes:
[0099] The acquisition module 601 is used to acquire backup strategy information for the database to be backed up.
[0100] The identification module 602 is used to identify whether the database to be backed up has a long-term backup requirement based on the backup strategy information.
[0101] The generation module 603 is used to generate a status tracking table based on the backup strategy information if the database to be backed up has a long-term backup requirement.
[0102] The monitoring module 604 is used to monitor the backup strategy operation status of the database to be backed up in real time.
[0103] The update module 605 is used to update the status tracking table according to the backup strategy job status to obtain the updated status tracking table.
[0104] Adjustment module 606 is used to adjust the backup strategy based on the updated status tracking table.
[0105] In one possible implementation, the acquisition module 601 can also be used for:
[0106] The backup strategy list of the database to be backed up is obtained through the application programming interface of the centralized backup software; the backup strategy list includes at least one backup strategy, as well as the backup type and backup frequency of the backup strategy.
[0107] In one possible implementation, the identification module 602 can also be used for:
[0108] Determine whether the database to be backed up has a long-term backup requirement based on at least one of the following: the number of backup strategies, backup type, and backup frequency in the backup strategy list.
[0109] In one possible implementation, the generation module 603 can also be used for:
[0110] Retrieve preset tracking fields; the preset tracking fields include database unique name, short-term full backup strategy, short-term archive strategy, long-term full backup strategy, and adjustment status;
[0111] Filter the backup strategy information based on the preset tracking fields;
[0112] A status tracking table is generated based on the filtering results and preset tracking fields.
[0113] In one possible implementation, the monitoring module 604 can also be used for:
[0114] The backup strategy job status of the database to be backed up can be monitored in real time through the application programming interface of the centralized backup software; the backup strategy job status includes running, completed, and failed.
[0115] In one possible implementation, update module 605 can also be used for:
[0116] Based on the backup strategy job status, determine whether there is a running long-term full backup strategy in the data to be backed up;
[0117] If it exists, update the adjustment status in the status tracking table to "long-term execution";
[0118] If the backup strategy job status of the long-term full backup strategy is completed or failed, then the adjustment status in the update status tracking table will be normal.
[0119] In one possible implementation, the adjustment module 606 can also be used for:
[0120] Adjust the policy parameters in the backup policy information according to the updated status tracker table; the policy parameters include backup retention period parameters and tape pool parameters.
[0121] In one possible implementation, the adjustment module 606 can also be used for:
[0122] Retrieve the adjustment status from the updated status tracking table;
[0123] If the adjustment status is set to long-term execution, the backup retention period parameters and tape pool parameters of the long-term full backup strategy are obtained through the application programming interface of the centralized backup software.
[0124] Based on the backup retention period parameters and tape pool parameters of the long-term full backup strategy, update the backup retention period parameters and tape pool parameters of the short-term archive strategy in the updated status tracker table.
[0125] It should be understood that the above-described device embodiments are merely illustrative, and the device of this application can also be implemented in other ways. For example, the division of units / modules in the above embodiments is only a logical functional division, and there may be other division methods in actual implementation. For example, multiple units, modules, or components may be combined, or integrated into another system, or some features may be ignored or not executed.
[0126] Furthermore, unless otherwise specified, the functional units / modules in the various embodiments of this application can be integrated into one unit / module, or each unit / module can exist physically separately, or two or more units / modules can be integrated together. The integrated units / modules described above can be implemented in hardware or as software program modules.
[0127] Figure 7 This is a schematic diagram of the structure of the electronic device provided in the embodiments of this application, such as... Figure 7 As shown, the electronic device includes at least one processor 701 and a memory 702. Optionally, the electronic device also includes a communication component 703. The processor 701, memory 702, and communication component 703 are connected via a bus 704.
[0128] In a specific implementation, at least one processor 701 executes computer execution instructions stored in memory 702, causing at least one processor 701 to perform the above-described method.
[0129] The specific implementation process of processor 701 can be found in the above method embodiments, and its implementation principle and technical effect are similar. It will not be repeated here.
[0130] In the above embodiments, it should be understood that the processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), etc. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in this invention can be directly implemented by a hardware processor, or implemented by a combination of hardware and software modules within the processor.
[0131] The memory may include random access memory (RAM) and may also include non-volatile memory (NVM), such as at least one disk storage device.
[0132] The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. Buses can be categorized as address buses, data buses, control buses, etc. For ease of illustration, the buses shown in the accompanying drawings are not limited to a single bus or a single type of bus.
[0133] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the above-described method.
[0134] This application also provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, implement the above-described method.
[0135] The aforementioned readable storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk. The readable storage medium can be any available medium accessible to a general-purpose or special-purpose computer.
[0136] An exemplary readable storage medium is coupled to a processor, enabling the processor to read information from and write information to the readable storage medium. Of course, the readable storage medium can also be a component of the processor. The processor and the readable storage medium can reside in an application-specific integrated circuit (ASIC). Alternatively, the processor and the readable storage medium can exist as discrete components in the device.
[0137] The division of units is merely a logical functional division; in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be indirect coupling or communication connection through some interfaces, devices, or units, and may be electrical, mechanical, or other forms.
[0138] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0139] In addition, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.
[0140] If a function is implemented as a software functional unit 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 this invention, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as a portable hard drive, read-only memory (ROM), random access memory (RAM), magnetic disk, or optical disk.
[0141] Those skilled in the art will understand that all or part of the steps of the above-described method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When executed, the program performs the steps of the above-described method embodiments; and the aforementioned storage medium includes various media capable of storing program code, such as ROM, RAM, magnetic disks, or optical disks.
[0142] Finally, it should be noted that other embodiments of the invention will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This invention is intended to cover any variations, uses, or adaptations of the invention that follow the general principles of the invention and include common knowledge or customary techniques in the art not disclosed herein, and is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of the invention is limited only by the appended claims.
Claims
1. A database backup method characterized by, The method comprises the following steps: acquiring backup policy information of a database to be backed up; identifying whether the database to be backed up has a long-period backup requirement according to the backup policy information; generating a state tracking table according to the backup policy information if the database to be backed up has the long-period backup requirement; monitoring a backup policy job state of the database to be backed up in real time; updating the state tracking table according to the backup policy job state to obtain an updated state tracking table; adjusting a backup policy according to the updated state tracking table.
2. The method of claim 1, wherein, The step of acquiring the backup policy information of the database to be backed up comprises the following steps: acquiring a backup policy list of the database to be backed up through an application programming interface of centralized backup software; wherein the backup policy list comprises at least one backup policy and backup types and backup frequencies of the backup policy.
3. The method of claim 2, wherein, The step of identifying whether the database to be backed up has the long-period backup requirement according to the backup policy information comprises the following steps: determining whether the database to be backed up has the long-period backup requirement according to at least one of a backup policy number, the backup types and the backup frequencies in the backup policy list.
4. The method according to any one of claims 1 to 3, characterized in that, The step of generating the state tracking table according to the backup policy information comprises the following steps: acquiring preset tracking fields; wherein the preset tracking fields comprise a database unique name, a short-term full backup policy, a short-term archiving policy, a long-term full backup policy and an adjustment state; screening in the backup policy information according to the preset tracking fields; generating a state tracking table according to a screening result and the preset tracking fields.
5. The method of claim 4, wherein, The step of monitoring the backup policy job state of the database to be backed up in real time comprises the following steps: monitoring the backup policy job state of the database to be backed up in real time through the application programming interface of the centralized backup software; wherein the backup policy job state comprises running, completion and failure.
6. The method of claim 5, wherein, The step of updating the state tracking table according to the backup policy job state to obtain the updated state tracking table comprises the following steps: determining whether there is a long-term full backup policy in running in the database to be backed up according to the backup policy job state; updating the adjustment state in the state tracking table to long-term execution if there is; updating the adjustment state in the state tracking table to normal if the backup policy job state of the long-term full backup policy is completion or failure.
7. The method of claim 6, wherein, The step of adjusting the backup policy according to the updated state tracking table comprises the following steps: adjusting policy parameters in the backup policy information according to the updated state tracking table; wherein the policy parameters comprise backup retention period parameters and tape pool parameters.
8. The method of claim 7, wherein, The step of adjusting the policy parameters in the backup policy information according to the updated state tracking table comprises the following steps: acquiring an adjustment state in the updated state tracking table; acquiring backup retention period parameters and tape pool parameters of the long-term full backup policy through the application programming interface of the centralized backup software if the adjustment state is long-term execution. According to the backup retention period parameter and the tape pool parameter of the long-term full backup strategy, the backup retention period parameter and the tape pool parameter of the short-term archiving strategy in the updated state tracking table are updated.
9. A database backup apparatus characterized by comprising: The method comprises the steps of: An acquisition module is configured to acquire backup strategy information of a database to be backed up. An identification module is configured to identify whether the database to be backed up has a long-period backup requirement according to the backup strategy information. A generation module is configured to generate a state tracking table according to the backup strategy information if the database to be backed up has the long-period backup requirement. A monitoring module is configured to monitor a backup strategy job state of the database to be backed up in real time. An update module is configured to update the state tracking table according to the backup strategy job state to obtain an updated state tracking table. An adjustment module is configured to adjust a backup strategy according to the updated state tracking table.
10. An electronic device, comprising: The method comprises the steps of: A processor and a memory connected to the processor in communication; The memory stores computer execution instructions. The processor executes the computer execution instructions stored in the memory to implement the method according to any one of claims 1 to 8.
11. A computer readable storage medium characterized by, The computer readable storage medium stores computer execution instructions, and the computer execution instructions are executed by the processor to implement the method according to any one of claims 1 to 8.
12. A computer program product, characterised in that, The computer program is executed by the processor to implement the method according to any one of claims 1 to 8.