Cold medium recall method, device and equipment for database backup recovery tool and storage medium
By acquiring the target recovery time window and status pre-inspection, constructing recovery mapping relationships and warehouse view plans, the problem of lack of time point filtering in cold media recovery in existing technologies is solved, and point-in-time recovery of database backup tools is realized.
Patent Information
- Application Number
- CN202611519989.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-29
- Publication Date
- 2026-11-03
AI Technical Summary
Existing cold archive recovery solutions lack the processing logic to filter archive packages based on the target recovery time, which prevents database backup and recovery tools from achieving point-in-time recovery from cold media.
By responding to users' database data recovery requests, obtaining the recoverable time window corresponding to the target recovery time, performing a status pre-check of the archive packages to be recalled, and initiating cold media recall when the availability status is normal and ready for recall, constructing recovery mapping relationships and warehouse view plans, and realizing the recall of the original object content.
Without altering the existing database backup and recovery logic, accurately locate the archive package required for point-in-time recovery, ensuring that the database backup and recovery tool completes the point-in-time recovery task.
Smart Images

Figure CN123030429A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of database backup and recovery technology, and in particular to a cold media recall method, apparatus, device and storage medium for database backup and recovery tools. Background Technology
[0002] Relational databases can archive backup data to cold media for low-cost storage. When a point-in-time recovery is required, the backup objects in the cold media must be retrieved to online storage before being processed by the database backup and recovery tools. Most existing cold archive recovery solutions, upon receiving a recovery request, directly retrieve and recall the corresponding archive objects one by one according to the backup identifier to be restored, only retrieving the original backup objects from the cold media to online storage, thus making the backup objects accessible.
[0003] The recovery process of database backup and recovery tools relies on complete repository semantics, including backup information files, archive information files, backup tag levels, backup lists, write-ahead log archive paths, object checksums, and object timestamp order. If the object naming, metadata order, write-ahead log paths, and backup list dependencies presented upwards are disordered, even if the underlying backup object data can be retrieved normally from cold media, the recovery process will fail to start, write-ahead log fragments will not be found, or incorrect backup chains will be matched. Existing processing methods lack the logic to filter archive packages based on the target recovery time, and do not rebuild a repository semantic view adapted to the database backup and recovery tool after object retrieval. As a result, unmodified database backup and recovery tools cannot complete point-in-time recovery in cold archiving scenarios. Summary of the Invention
[0004] The main purpose of this application is to provide a cold media recall method, apparatus, device and storage medium for database backup and recovery tools, aiming to solve the technical problem that existing cold archive recovery only recalls archived objects to an accessible state and lacks the ability to filter archived packages by target recovery time, which makes it impossible for native database backup and recovery tools to achieve cold archive point-in-time recovery.
[0005] To achieve the above objectives, this application proposes a cold media recall method for database backup and recovery tools, the cold media recall method for database backup and recovery tools comprising: Respond to the user's database data recovery request; wherein, the database data recovery request includes: target recovery time; Determine the recoverable time window corresponding to the target recovery time, and obtain the archive package to be recalled corresponding to the recoverable time window; Perform a status pre-check on the archive package to be recalled to determine its availability status; When the availability status is normal pending recall status, a cold media recall is initiated to the pending archive package, the original object content of the pending archive package is obtained, a recovery mapping relationship is constructed between the original object content, the pending archive package and the database backup and recovery tool, and a warehouse view plan for the pending archive package is constructed based on the recovery mapping relationship. In response to the data recovery request from the database backup and recovery tool, the original object content of the archive package to be recalled is extracted based on the repository view plan of the archive package to be recalled, and the original object content is returned to the database backup and recovery tool so that the database backup and recovery tool can complete the data retrieval of the archive package to be recalled.
[0006] In one feasible embodiment, the database recovery request further includes: a backup namespace, a database system identifier, and a target timeline; Determining the recoverable time window corresponding to the target recovery time includes: The time window index is queried according to the target recovery time, and the time window identifier containing the target recovery time is located in the time window index according to the target recovery time, the backup namespace, the database system identifier, and the target timeline; The recoverable time window is determined based on the time window identifier.
[0007] In one feasible embodiment, the step of performing a status pre-check on the archive package to be recalled to determine the availability status of the archive package to be recalled includes: The archive package to be recalled is sequentially checked for existence, storage level mark, historical recall record, business recall strategy, and archive package header integrity to determine the set of verification results for the archive package to be recalled; wherein, the set of verification results includes: existence, storage level mark, recall status, strategy blocking status, and verification status; The availability status of the archive package to be recalled is determined based on its existence, storage level flag, recall status, policy blocking status, and verification status.
[0008] In a feasible embodiment, determining the availability status of the archive package to be recalled based on its existence, storage level flag, recall status, policy blocking status, and verification status includes: If any parameter in the set of verification results of the archive package to be recalled is abnormal, the availability status of the archive package to be recalled is determined to be abnormal. If there are no abnormalities in the existence of the archive package to be recalled, the recall status, the policy blocking status, and the verification status, and the storage level is marked as online, the availability status of the archive package to be recalled is determined to be a normal online available status. If there are no abnormalities in the existence of the archive package to be recalled, the recall status, the policy blocking status, and the verification status, and the storage level is marked as offline or deep archiving, the availability status of the archive package to be recalled is determined to be a normal pending recall status.
[0009] In one feasible embodiment, after performing a status pre-check on the archive package to be recalled and determining its availability status, the method further includes: When the availability status is abnormal, the cause of the abnormality is determined based on the set of verification results of the archive package to be recalled, and the cause of the abnormality is written to the log.
[0010] In a feasible embodiment, constructing the recovery mapping relationship between the original object content, the archive package to be recalled, and the database backup and recovery tool includes: Obtain the archive package identifier of the archive package to be recalled, and determine the object key associated with the archive package to be recalled and the database backup and recovery tool; The object key is bound to the original object content and the archive package identifier respectively to construct the recovery mapping relationship.
[0011] In one feasible embodiment, initiating a cold media recall of the archive to be recalled and obtaining the original object content of the archive to be recalled includes: Initiate a first read operation on the archive package to be recalled, and when the first read operation is successful, obtain the original object content of the archive package to be recalled; If the first read operation fails, a retry token and a retry deadline are generated for the archive package to be recalled. Within the retry deadline, a second read operation is repeatedly initiated on the archive package to be recalled based on the retry token; If any of the second read operations is successful, then determine whether the archive package to be recalled meets the preset recall time limit requirement; If the preset recall time limit is not met, the record reading will fail. If the preset recall time limit requirement is met, the original object content of the archive package to be recalled is obtained based on the second read operation; If all second read operations fail, record the failure of the through read and the reason for the failure of each second read operation.
[0012] In addition, to achieve the above objectives, this application also proposes a cold media recall device for database backup and recovery tools, the cold media recall device for database backup and recovery tools comprising: a time data determination module, a status verification module, a warehouse view plan construction module, and a cold media recall module; The time data determination module is used to respond to a user's database data recovery request; wherein, the database data recovery request includes: a target recovery time; determining the recoverable time window corresponding to the target recovery time, and obtaining the archive package to be recalled corresponding to the recoverable time window; The status verification module is used to perform a status pre-check on the archive package to be recalled and determine the availability status of the archive package to be recalled. The warehouse view plan construction module is used to initiate a cold media recall to the archive package to be recalled when the availability status is normal and awaiting recall, obtain the original object content of the archive package to be recalled, construct a recovery mapping relationship between the original object content, the archive package to be recalled, and the database backup and recovery tool, and construct a warehouse view plan for the archive package to be recalled based on the recovery mapping relationship. The cold media recall module is used to respond to the data recovery request of the database backup and recovery tool, extract the original object content of the archive package to be recalled based on the repository view plan of the archive package to be recalled, and return the original object content to the database backup and recovery tool so that the database backup and recovery tool can complete the data recall of the archive package to be recalled.
[0013] Furthermore, to achieve the above objectives, this application also proposes a cold media recall device for database backup and recovery tools, the device comprising: a memory, a processor, and a computer program stored on the memory and executable on the processor, the computer program being configured to implement the steps of the cold media recall method for database backup and recovery tools as described above.
[0014] In addition, to achieve the above objectives, this application also proposes a storage medium, which is a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, it implements the steps of the cold media recall method for database backup and recovery tools as described above.
[0015] In addition, to achieve the above objectives, this application also provides a computer program product, which includes a computer program that, when executed by a processor, implements the steps of the cold media recall method for database backup and recovery tools as described above.
[0016] One or more technical solutions proposed in this application have at least the following technical effects: This application proposes a cold media recall method, apparatus, device, and storage medium for database backup and recovery tools. The method responds to a user's database data recovery request, obtains the target recovery time contained in the request, and then uses the recoverable time window corresponding to the target recovery time to obtain the archive package to be recalled. This addresses the deficiency in existing technologies where the selection of archive packages to be recalled lacks consideration of the target recovery time. The method precisely locates the required archive package to be recalled based on the target recovery time. Furthermore, a status pre-check is performed on the archive package to be recalled. If the availability status is normal and ready for recall, a cold media recall is initiated for the archive package to be recalled to ensure its availability.
[0017] Then, by obtaining the original object content of the archive package to be recalled, a recovery mapping relationship is constructed between the original object content, the archive package to be recalled, and the database backup and recovery tool. Based on the recovery mapping relationship, a repository view plan for the archive package to be recalled is constructed. The original object content, the archive package to be recalled, and the database backup and recovery tool are semantically bound through the repository view plan. When finally responding to the data recovery request of the database backup and recovery tool, the original object content of the archive package to be recalled can be extracted based on the repository view plan of the archive package to be recalled, and the original object content can be returned to the database backup and recovery tool. This enables the database backup and recovery tool to complete the archiving of the archive package to be recalled with point-in-time recovery without changing the existing database backup and recovery logic. Attached Figure Description
[0018] 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.
[0019] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0020] Figure 1 This is a flowchart illustrating an embodiment of the cold media recall method for database backup and recovery tools provided in this application. Figure 2 This is a schematic diagram of the module structure of a cold media recall device for database backup and recovery tools according to an embodiment of this application; Figure 3 This is a schematic diagram of the hardware operating environment involved in the cold media recall method for database backup and recovery tools in this application embodiment.
[0021] The purpose, features, and advantages of this application will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation
[0022] It should be understood that the specific embodiments described herein are merely illustrative of the technical solutions of this application and are not intended to limit this application.
[0023] To better understand the technical solution of this application, a detailed description will be provided below in conjunction with the accompanying drawings and specific implementation methods.
[0024] In this embodiment, for ease of description, the following description will focus on the associated control device that identifies the database backup tool.
[0025] It should be noted that the executing entity in this embodiment can be a computing service device with data processing, network communication, and program execution functions, such as a tablet computer, personal computer, or mobile phone, or an electronic device capable of performing the above functions, or an associated control device for a database backup tool. The following description uses an associated control device for a database backup tool as an example to illustrate this embodiment and the subsequent embodiments.
[0026] Because existing database backup and recovery tools lack processing logic for filtering archive packages based on the target recovery time, and do not rebuild a repository semantic view adapted to the database backup and recovery tool after object recall, unmodified database backup and recovery tools cannot complete point-in-time recovery in cold archiving scenarios.
[0027] This application provides a solution that, in response to a user's database data recovery request, obtains a target recovery time from the request, and then retrieves the corresponding recoverable time window and the archive package to be recalled. This addresses the deficiency in existing technologies that lack filtering based on the target recovery time when selecting archive packages to be recalled, by precisely locating the required archive package for recovery at the target recovery time. Furthermore, a status pre-check is performed on the archive package to be recalled. If the availability status is normal and ready for recall, a cold media recall is initiated for the archive package to be recalled to ensure its availability.
[0028] Then, by obtaining the original object content of the archive package to be recalled, a recovery mapping relationship is constructed between the original object content, the archive package to be recalled, and the database backup and recovery tool. Based on the recovery mapping relationship, a repository view plan for the archive package to be recalled is constructed. The original object content, the archive package to be recalled, and the database backup and recovery tool are semantically bound through the repository view plan. When finally responding to the data recovery request of the database backup and recovery tool, the original object content of the archive package to be recalled can be extracted based on the repository view plan of the archive package to be recalled, and the original object content can be returned to the database backup and recovery tool. This enables the database backup and recovery tool to complete the archiving of the archive package to be recalled with point-in-time recovery without changing the existing database backup and recovery logic.
[0029] Specifically, this application provides a cold media recall method for database backup and recovery tools, referring to... Figure 1 , Figure 1 This is a flowchart illustrating the first embodiment of the cold media recall method for database backup and recovery tools in this application.
[0030] In this embodiment, the cold media recall method for database backup and recovery tools includes steps S10 to S50: Step S10: Respond to the user's database data recovery request; wherein, the database data recovery request includes: target recovery time; Specifically, in response to a user's database data recovery request, the database data recovery request is parsed to determine the target recovery time for the archive packages that need to be recalled as declared in the database data recovery request.
[0031] It should be noted that the target recovery time is the target time point specified by the user when requesting database recovery, used to locate the business time snapshot to which the database needs to be rolled back.
[0032] Step S20: Determine the recoverable time window corresponding to the target recovery time, and obtain the archive package to be recalled corresponding to the recoverable time window; Specifically, based on the target recovery time, the recoverable time window corresponding to the target recovery time is determined. Through the located recoverable time window, all archive packages to be recalled corresponding to the recoverable time window are further located, and status pre-inspection and cold media archiving are performed on all archive packages to be recalled one by one.
[0033] In one feasible embodiment, the database recovery request further includes: backup namespace, database system identifier, and target timeline; step S20 may also include steps A11-A12: Step A11: Query the time window index according to the target recovery time, and locate the time window identifier containing the target recovery time in the time window index according to the target recovery time, the backup namespace, the database system identifier and the target timeline; Step A12: Determine the recoverable time window based on the time window identifier.
[0034] Specifically, a database recovery request typically includes a backup namespace, a database system identifier, and a target timeline. The backup namespace is used to isolate different business backup resources, distinguishing multiple independent database backup datasets. The database system identifier uniquely identifies the source database instance to be recovered, determining the target database for this recovery task. The target database is the database that the database backup and recovery tool needs to write the retrieved data to after completing the archive package retrieval. The target timeline is a historical branch identifier representing the evolution of the database backup, used to filter the backup data chain to which the target recovery time belongs.
[0035] The time window index is invoked, and the target recovery time, backup namespace, database system identifier, and target timeline are used as search conditions. The time window index is matched to obtain the time window identifier of the recoverable time window that covers the target recovery time, and then the recoverable time window is locked according to the time window identifier.
[0036] For example, suppose the received database recovery request from a user includes: target recovery time 2025-11-02 08:35:20, backup namespace prod-db-ns01, database system identifier db-inst-007, and target timeline timeline-full-03. The system reads a pre-built time window index, which uses the backup namespace, database system identifier, and target timeline as partition dimensions. Each index entry is bound to a time range and its corresponding time window identifier. The system uses the above four parameters as search conditions, traverses the time window index, compares the time range of each index entry, locates the time range [2025-11-01 22:00:00, 2025-11-02 10:00:00] that completely covers the target recovery time 2025-11-02 08:35:20, retrieves the time window identifier tw-id-129 corresponding to this entry, and completes the location of the recoverable time window based on this time window identifier. Then, cold media archiving is performed based on all the archive packages to be recalled within the recoverable time window.
[0037] By implementing the above embodiments, using the time window index as the retrieval carrier and the recoverable time window corresponding to the target recovery time as the processing boundary for recall and view construction, all archived resources required for recovery can be located at once, avoiding the scattered and temporary cold media recall mode that follows the database backup and recovery tool's object-by-object read request.
[0038] Step S30: Perform a status pre-check on the archive package to be recalled to determine the availability status of the archive package to be recalled; Specifically, when performing a status pre-check on any archive package to be recalled, a status pre-check on the archive package to be recalled is required to determine the availability status of the archive package to be recalled.
[0039] In a feasible embodiment, step S30 may include steps B11-B12: Step B11: Sequentially perform existence verification, storage level mark verification, historical recall record verification, business recall strategy verification, and archive header integrity verification on the archive package to be recalled, and determine the set of verification results for the archive package to be recalled; wherein, the set of verification results includes: existence, storage level mark, recall status, policy blocking status, and verification status; Step B12: Determine the availability status of the archive package to be recalled based on its existence, storage level flag, recall status, policy blocking status, and verification status.
[0040] Specifically, when determining the availability status of the archive package to be recalled, multiple checks are performed sequentially on the archive package to be recalled, including existence, storage level marking, historical recall records, business recall strategy, and archive package header integrity. This results in a set of check results, including existence, storage level marking, recall status, policy blocking status, and check status, which are then used to comprehensively determine the availability of the archive package to be recalled.
[0041] In a feasible embodiment, step B12 may include steps C11-C13: Step C11: If any parameter in the set of verification results of the archive package to be recalled is abnormal, the availability status of the archive package to be recalled is determined to be abnormal. Specifically, when performing availability status analysis on archive packages to be recalled, they are mainly divided into abnormal status and available status. Available status is further divided into normal online available status and normal pending recall status. Under normal online available status, the archive package is determined to have been recalled. Under abnormal status, the archive package is determined to be unable to be recalled. Only the archive packages corresponding to the normal pending recall status under available status are the archive packages that need to be recalled by cold media.
[0042] In this step, the availability status of the archive to be recalled must first be determined based on the verification result set of the archive to be recalled. If any one of the results in the verification result set of the archive to be recalled—existence, storage level flag, recall status, policy blocking status, and verification status—is abnormal, it is determined to be an abnormal status.
[0043] When the availability status is abnormal, the specific sub-status of the abnormality and the logic for determining the cause of the abnormality are as follows: 1. When the existence of the archive package to be recalled is missing, the availability status of the archive package to be recalled is determined to be the missing status in the abnormal status; the missing status indicates that the archive package file itself does not exist, such as the data packet is lost, and the abnormal reason is file packet loss.
[0044] 2. When the existence of the archive package to be recalled is complete and the recall status is recall failure, the availability status of the archive package to be recalled is determined to be the recall failure status in the abnormal status. The recall failure status indicates that the archive package entity is stored normally, but an execution failure occurred when performing a cold media recall action in the past, such as media read timeout or abnormal termination of the recall task. The reason for the abnormality is that there was an anomaly in the historical recall.
[0045] 3. When the existence of the archive package to be recalled is complete, the recall status is "recall without failure," and the policy blocking status is "recall not allowed," the availability status of the archive package to be recalled is determined to be a policy blocking status within the abnormal status. The policy blocking status indicates that the archive package is physically stored intact, but is restricted by operational policies such as business permissions and archive lifecycle management, and is not allowed to perform this cold media recall operation. The reason for this abnormality is the constraint of the upper-level system policy.
[0046] 4. When the existence of the recalled archive package is complete, the recall status is "recall without failure," the policy blocking status is "recall allowed," and the verification status is "verification failed," the availability status of the archive package to be recalled is determined to be the "verification failed" state in the abnormal status. The "verification failed" state indicates that the archive package entity is accessible, but the archive package header metadata and file integrity verification do not meet the requirements, such as header corruption, inconsistencies in verification and comparison, etc. The reason for the abnormality is incomplete files.
[0047] Step C12: When there are no abnormalities in the existence of the archive package to be recalled, the recall status, the policy blocking status, and the verification status, and the storage level is marked as online, the availability status of the archive package to be recalled is determined to be a normal online available status. Specifically, if there are no abnormalities in the existence of the archive package to be recalled, the recall status, the policy blocking status, and the verification status, and the storage level is marked as online, it indicates that the archive package to be recalled is in online storage and can be read directly. Therefore, it is determined to be in a normal online available state. Since it is already in online storage, there is no need to perform cold media recall.
[0048] Step C13: If there are no abnormalities in the existence of the archive package to be recalled, the recall status, the policy blocking status, and the verification status, and the storage level is marked as offline or deep archiving, then the availability status of the archive package to be recalled is determined to be a normal pending recall status.
[0049] Specifically, if there are no abnormalities in the existence of the archive package to be recalled, the recall status, the policy blocking status, and the verification status, and the storage level is marked as offline or deep archiving, the storage level being marked as offline or deep archiving indicates that the data of the archive package to be recalled is stored in cold media and cannot be read directly. Therefore, it is determined that the data in the archive package to be recalled stored in cold media needs to be parsed and read. At this time, the archive package to be recalled needs to be recalled in cold media. This status is judged as a normal recall status.
[0050] By implementing the above feasible implementation methods, availability status checks can be performed on archive packages to identify various unavailability situations such as missing files, failed recalls, policy blocking, and verification anomalies in advance. At the same time, it can distinguish between normal online available archive packages and normal archive packages awaiting recall, intercept anomalies in advance, avoid invalid cold media recalls, and ensure that the subsequent warehouse view plan generation and recovery process can be executed reliably.
[0051] In one feasible implementation, step S01 may be included after step S30: Step S01: When the availability status is abnormal, determine the cause of the abnormality based on the set of verification results of the archive package to be recalled, and write the cause of the abnormality into the log.
[0052] Specifically, when it is determined through step C11 that there is an anomaly in the set of verification results of the archive package to be recalled, the corresponding anomaly cause is determined according to the processing logic of the specific anomaly state subdivision and anomaly cause determination when the availability state is an anomaly state in step C11. The anomaly cause corresponding to the archive package to be recalled with an anomaly is written into the system's operation log or anomaly record log, so as to indicate to the system operation and maintenance personnel the anomaly cause of the archive package to be recalled that should not be recalled by cold media.
[0053] Step S40: When the availability status is normal pending recall status, initiate cold media recall to the pending archive package, obtain the original object content of the pending archive package, construct the recovery mapping relationship between the original object content, the pending archive package and the database backup and recovery tool, and construct the repository view plan of the pending archive package according to the recovery mapping relationship. Specifically, when the archive package to be recalled is determined to be in a normal recall state after the availability status check, it means that the archive package is complete and compliant but is on cold media and cannot be directly read. At this time, a cold media recall operation is performed on the archive package to be recalled, pulling the data of the archive package to be recalled into an accessible state and obtaining the original object content inside. Further, a recovery mapping relationship is established between the original object content, the archive package to be recalled, and the database backup and recovery tool. This mapping record records the corresponding association between the object key identified by the backup and recovery tool and the data location inside the archive package. Then, a warehouse view plan is generated based on this recovery mapping relationship, providing a location mapping basis for the subsequent construction of temporary warehouse views and the reading of objects by the backup and recovery tool.
[0054] To handle transient read exceptions that occur during archive package recall, this application proposes an archive package read processing method with retry control.
[0055] In a feasible embodiment, step S40, "initiating a cold media recall of the archive package to be recalled and obtaining the original object content of the archive package to be recalled," may include steps D11-D12: D11, initiate a first read operation on the archive package to be recalled, and when the first read operation is successful, obtain the original object content of the archive package to be recalled; Specifically, a first read operation is initiated on the archive package to be recalled, which is currently in the recall state; when the first read operation is successfully executed, the archive package is transferred to a temporary online state, and the original object content of the archive package to be recalled can be read and obtained.
[0056] It should be noted that, in this application, the original object content is the actual backup data and its associated metadata stored inside the archive package and required by the database backup and recovery tool. The original object content mainly includes the actual business data of the object, object size, checksum, object timestamp, metadata generation, backup information file, archive information file, backup tag level data, backup list entries, write-ahead log archive path, write-ahead log segment data, and metadata related to the backup dependency chain.
[0057] D12, when the first read operation fails, generate a retry token and a retry deadline for the archive package to be recalled; within the retry deadline, initiate a second read operation on the archive package to be recalled based on the retry token; if any second read operation succeeds, determine whether the archive package to be recalled meets the preset recall time limit requirement; if it does not meet the preset recall time limit requirement, record the through-read failure; if it meets the preset recall time limit requirement, obtain the original object content of the archive package to be recalled based on the second read operation; if all second read operations fail, record the through-read failure and record the failure reason for each second read operation.
[0058] Specifically, when the first read operation fails, the archive package enters a continuous read waiting state. The system generates a unique retry token and retry deadline for the archive package. The metadata generation corresponding to the retry token remains unchanged within the retry period. Within the retry deadline, the system repeatedly initiates second read operations carrying the retry token. If a second read operation succeeds within the retry deadline, it further verifies whether the preset recall time limit requirement is met. If the preset recall time limit requirement is not met, the continuous read failure is directly recorded. If the time limit requirement is met, the original object content of the archive package is read, and the archive package is transferred to a temporary online state to continue verifying the online period. If all second read operations fail, or the retry deadline is exceeded, the system enters a failure state, and the continuous read failure and the failure reason corresponding to each second read are recorded.
[0059] It should be noted that in this embodiment, the archive package will not be marked as recovery ready throughout the entire process; it will only switch to recovery ready and allow reading after successful reading, the archive package entering temporary online status, and passing the online period verification; a ready state will not be forged in the event of failure. After the recovery task ends or expires, the archive package returns to an offline, unreadable state after a cleanup process. Furthermore, only archive packages that are successfully read can have their original object content successfully obtained.
[0060] By implementing this embodiment, a retry mechanism is set up for momentary read anomalies that occur during archive package retrieval. By generating retry tokens and binding them to the archive package metadata generation, and setting retry deadlines to control the retry cycle, retrying reads for temporary failures can improve the success rate of cold media retrieval reads, while avoiding infinite retries. At the same time, the recovery ready state is not forged during the waiting phase, and the reason for failure is recorded when retry times out or multiple reads fail, which facilitates fault location, ensures the overall recovery process is controllable, and prevents the entire database recovery task from being abnormally terminated due to momentary jitter of cold media.
[0061] After reading the original object content, a warehouse view plan needs to be built based on the original object content.
[0062] In a feasible embodiment, step S40, "constructing the recovery mapping relationship between the original object content, the archive package to be recalled, and the database backup and recovery tool," may include steps E11-E12: Step E11: Obtain the archive package identifier of the archive package to be recalled, and determine the object key associated with the archive package to be recalled and the database backup and recovery tool; Step E12: Bind the object key to the original object content and the archive package identifier respectively to construct the recovery mapping relationship.
[0063] Specifically, the process involves obtaining the archive package identifier corresponding to the archive package to be recalled, and simultaneously determining the object key that the database backup and recovery tool can recognize, corresponding to the objects within that archive package. This object key is then used as the input key when constructing the recovery mapping relationship. Preferably, to avoid object key duplication conflicts and ensure the uniqueness of the object mapping, the backup namespace, timeline, and basic backup label can be bound to the object key, allowing all three to be used as input keys simultaneously. The process then associates the archive package to be recalled with the original object content within it, establishing a recovery mapping relationship between the original object content, the archive package to be recalled, and the database backup and recovery tool. This mapping record records the correspondence between the object key and the archive package and the original object. This recovery mapping relationship establishes a link between the object key used by the backup and recovery tool and the underlying archive package resources, providing basic mapping data for the subsequent generation of the repository view plan, enabling the database backup and recovery tool's object read requests to locate the actual data in the underlying archive package.
[0064] Then, based on this recovery mapping relationship, the input key, internal status field, and output mapping field of the repository view plan are populated to complete the construction of the repository view plan. Preferably, the internal status field of the repository view plan may include: time window identifier, metadata generation, read completion status, and retry token; the output mapping field may include: archive package identifier, archive package offset, archive package length, checksum, and object timestamp.
[0065] Preferably, in order for the database recovery tool to call the constructed warehouse view plan, it is necessary to load the generated warehouse view plan through the warehouse view builder. The above warehouse view plan is loaded in the warehouse view builder to obtain a temporary online warehouse view between the input key, the internal status field of the warehouse view plan, and the output mapping field.
[0066] Step S50: In response to the data recovery request of the database backup and recovery tool, extract the original object content of the archive package to be recalled based on the repository view plan of the archive package to be recalled, and return the original object content to the database backup and recovery tool so that the database backup and recovery tool can complete the data recall of the archive package to be recalled.
[0067] Specifically, when a user initiates a database data recovery request, the database backup and recovery tool receives a data recovery request instruction. Based on this request, it obtains the input key of the archive package to be recalled in the temporary online repository view. Using the input key carried in the request, it retrieves the repository view plan, locates the corresponding repository view plan and its recovery mapping relationship, and reads the original object content from the corresponding archive package to be recalled based on the corresponding archive package identifier, archive package offset, and archive package length. It then performs integrity verification based on the checksum carried in the repository view plan, encapsulates the original object content data according to the expected response header, and returns the processed original object content to the database backup and recovery tool to support the subsequent database recovery process.
[0068] Preferably, when the database backup and recovery tool completes recovery, fails to recover, or a temporary online repository view is accessed, the system generates a recovery audit log. The log fully records the key audit fields of the recovery task, including the recovery audit identifier, backup namespace, target recovery time, time window identifier, archive package identifier of the archive package to be recalled, repository metadata generation, repository view lifecycle, number of executions of the second read operation during the through read, recovery completion status, and other information. The system performs differentiated processing based on the recovery completion status branch in the audit log: if the recovery is successful and the audit retention period has expired, the temporary object namespace is released, the local materialized copy is deleted, and only the repository view plan summary is retained; if the recovery fails, the repository view plan, through read waiting status, and recall log under the corresponding failure window are retained for post-fault review; if a re-recall scenario is required, the temporary online archive package status is written back to re-include it in the cold media lifecycle management strategy; the log synchronously records the cleanup actions and cleanup completion time, completing the closed-loop retention of the entire recovery task.
[0069] It should be noted that the above examples are only for understanding this application and do not constitute a limitation on the cold media recall method for database backup and recovery tools in this application. Any simple modifications based on this technical concept are within the protection scope of this application.
[0070] This application also provides a cold media recall device for database backup and recovery tools. Please refer to [link / reference]. Figure 2 The cold media recall device for database backup and recovery tools includes: a time data determination module 10, a status verification module 20, a warehouse view plan construction module 30, and a cold media recall module 40. The time data determination module 10 is used to respond to a user's database data recovery request; wherein, the database data recovery request includes: a target recovery time; determining the recoverable time window corresponding to the target recovery time, and obtaining the archive package to be recalled corresponding to the recoverable time window; The status verification module 20 is used to perform a status pre-check on the archive package to be recalled and determine the availability status of the archive package to be recalled. The warehouse view plan construction module 30 is used to initiate a cold media recall to the archive package to be recalled when the availability status is normal pending recall status, obtain the original object content of the archive package to be recalled, construct the recovery mapping relationship between the original object content, the archive package to be recalled and the database backup and recovery tool, and construct the warehouse view plan of the archive package to be recalled based on the recovery mapping relationship. The cold media recall module 40 is used to respond to the data recovery request of the database backup and recovery tool, extract the original object content of the archive package to be recalled based on the repository view plan of the archive package to be recalled, and return the original object content to the database backup and recovery tool so that the database backup and recovery tool can complete the data recall of the archive package to be recalled.
[0071] The cold media recall device for database backup and recovery tools provided in this application adopts the cold media recall method for database backup and recovery tools in the above embodiments. It can solve the technical problem that existing cold archive recovery methods only recall archived objects to an accessible state, lacking the ability to filter archived packages by target recovery time, thus preventing native database backup and recovery tools from achieving cold archive point-in-time recovery. Compared with the prior art, the beneficial effects of the cold media recall device for database backup and recovery tools provided in this application are the same as those of the cold media recall method for database backup and recovery tools provided in the above embodiments. Furthermore, other technical features in the cold media recall device for database backup and recovery tools are the same as those disclosed in the methods of the above embodiments, and will not be repeated here.
[0072] This application provides a cold media recall device for database backup and recovery tools. The cold media recall device for database backup and recovery tools includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the cold media recall method for database backup and recovery tools in the above embodiment 1.
[0073] The following is for reference. Figure 3This document illustrates a schematic diagram of a cold media recall device suitable for implementing a database backup and recovery tool according to embodiments of this application. The cold media recall device for a database backup and recovery tool in embodiments of this application may include, but is not limited to, mobile terminals such as mobile phones, laptops, digital radio receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Description), PMPs (Portable Media Players), in-vehicle terminals (e.g., in-vehicle navigation terminals), and fixed terminals such as digital TVs and desktop computers. Figure 3 The cold media recall device for database backup and recovery tools shown is merely an example and should not impose any limitations on the functionality and scope of use of the embodiments of this application.
[0074] like Figure 3 As shown, a cold media retrieval device for database backup and recovery tools may include a processing unit 1001 (e.g., a central processing unit, a graphics processing unit, etc.) that can perform various appropriate actions and processes according to a program stored in read-only memory (ROM) 1002 or a program loaded from storage device 1003 into random access memory (RAM) 1004. RAM 1004 also stores various programs and data required for the operation of the cold media retrieval device for database backup and recovery tools. The processing unit 1001, ROM 1002, and RAM 1004 are interconnected via bus 1005. Input / output (I / O) interface 1006 is also connected to the bus. Typically, the following systems can be connected to I / O interface 1006: input devices 1007 including, for example, touchscreens, touchpads, keyboards, mice, image sensors, microphones, accelerometers, gyroscopes, etc.; output devices 1008 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; storage devices 1003 including, for example, magnetic tapes, hard disks, etc.; and communication devices 1009. Communication device 1009 allows the cold media recall device for database backup and recovery tools to communicate wirelessly or wiredly with other devices to exchange data. Although the figure shows a cold media recall device for database backup and recovery tools with various systems, it should be understood that it is not required to implement or possess all the systems shown. More or fewer systems can be implemented alternatively.
[0075] Specifically, according to the embodiments disclosed in this application, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments disclosed in this application include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device, or installed from storage device 1003, or installed from ROM 1002. When the computer program is executed by processing device 1001, it performs the functions defined in the methods of the embodiments disclosed in this application.
[0076] The cold media recall device for database backup and recovery tools provided in this application adopts the cold media recall method for database backup and recovery tools in the above embodiments. It can solve the technical problem that existing cold archive recovery only recalls archived objects to an accessible state, lacks the ability to filter archived packages according to the target recovery time, and thus prevents native database backup and recovery tools from achieving cold archive point-in-time recovery. Compared with the prior art, the beneficial effects of the cold media recall device for database backup and recovery tools provided in this application are the same as those of the cold media recall method for database backup and recovery tools provided in the above embodiments. Moreover, other technical features of the cold media recall device for database backup and recovery tools are the same as those disclosed in the previous embodiment method, and will not be repeated here.
[0077] It should be understood that the various parts disclosed in this application can be implemented using hardware, software, firmware, or a combination thereof. In the description of the above embodiments, specific features, structures, materials, or characteristics can be combined in any suitable manner in one or more embodiments or examples.
[0078] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
[0079] This application provides a computer-readable storage medium having computer-readable program instructions (i.e., a computer program) stored thereon, the computer-readable program instructions being used to execute the cold media recall method for database backup and recovery tools in the above embodiments.
[0080] The computer-readable storage medium provided in this application may be, for example, a USB flash drive, but is not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to: electrical connections having one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, system, or device. The program code contained on the computer-readable storage medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination thereof.
[0081] The aforementioned computer-readable storage medium may be included in a cold media recall device for database backup and recovery tools; or it may exist independently and not be assembled into a cold media recall device for database backup and recovery tools.
[0082] The aforementioned computer-readable storage medium carries one or more programs, which, when executed by a cold media recall device for a database backup and recovery tool, cause the cold media recall device for the database backup and recovery tool to execute a cold media recall method for the database backup and recovery tool.
[0083] Computer program code for performing the operations of this application can be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, and C++, and conventional procedural programming languages such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a Local Area Network (LAN) or a Wide Area Network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0084] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0085] The modules described in the embodiments of this application can be implemented in software or hardware. The names of the modules do not necessarily limit the functionality of the unit itself.
[0086] The readable storage medium provided in this application is a computer-readable storage medium that stores computer-readable program instructions (i.e., a computer program) for executing the aforementioned cold media recall method for database backup and recovery tools. This solves the technical problem that existing cold archive recovery methods only recall archived objects to an accessible state, lacking the ability to filter archive packages by target recovery time, thus preventing native database backup and recovery tools from achieving point-in-time recovery from cold archives. Compared to the prior art, the beneficial effects of the computer-readable storage medium provided in this application are the same as those of the cold media recall method for database backup and recovery tools provided in the above embodiments, and will not be elaborated upon here.
[0087] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the cold media recall method for database backup and recovery tools as described above.
[0088] The computer program product provided in this application can solve the technical problem that existing cold archive recovery only recalls archived objects to an accessible state, lacks the ability to filter archived packages by target recovery time, and thus prevents native database backup and recovery tools from achieving cold archive point-in-time recovery. Compared with the prior art, the beneficial effects of the computer program product provided in this application are the same as those of the cold media recall method for database backup and recovery tools provided in the above embodiments, and will not be repeated here.
[0089] The above description is only a part of the embodiments of this application and does not limit the patent scope of this application. All equivalent structural transformations made under the technical concept of this application and using the contents of the specification and drawings of this application, or direct / indirect applications in other related technical fields, are included in the patent protection scope of this application.
Claims
1. A method for recalling cold media for database backup and recovery tools, characterized in that, The cold media recall method for database backup and recovery tools includes: Respond to the user's database data recovery request; wherein, the database data recovery request includes: target recovery time; Determine the recoverable time window corresponding to the target recovery time, and obtain the archive package to be recalled corresponding to the recoverable time window; Perform a status pre-check on the archive package to be recalled to determine its availability status; When the availability status is normal pending recall status, a cold media recall is initiated to the pending archive package, the original object content of the pending archive package is obtained, a recovery mapping relationship is constructed between the original object content, the pending archive package and the database backup and recovery tool, and a warehouse view plan for the pending archive package is constructed based on the recovery mapping relationship. In response to the data recovery request from the database backup and recovery tool, the original object content of the archive package to be recalled is extracted based on the repository view plan of the archive package to be recalled, and the original object content is returned to the database backup and recovery tool so that the database backup and recovery tool can complete the data retrieval of the archive package to be recalled.
2. The cold media recall method for database backup and recovery tools as described in claim 1, characterized in that, The database recovery request also includes: backup namespace, database system identifier, and target timeline; Determining the recoverable time window corresponding to the target recovery time includes: The time window index is queried according to the target recovery time, and the time window identifier containing the target recovery time is located in the time window index according to the target recovery time, the backup namespace, the database system identifier, and the target timeline; The recoverable time window is determined based on the time window identifier.
3. The cold media recall method for database backup and recovery tools as described in claim 1, characterized in that, The step of performing a status pre-check on the archive package to be recalled to determine its availability status includes: The archive package to be recalled is sequentially checked for existence, storage level mark, historical recall record, business recall strategy, and archive package header integrity to determine the set of verification results for the archive package to be recalled; wherein, the set of verification results includes: existence, storage level mark, recall status, strategy blocking status, and verification status; The availability status of the archive package to be recalled is determined based on its existence, storage level flag, recall status, policy blocking status, and verification status.
4. The cold media recall method for database backup and recovery tools as described in claim 3, characterized in that, The step of determining the availability status of the archive package to be recalled based on its existence, storage level flag, recall status, policy blocking status, and verification status includes: If any parameter in the set of verification results of the archive package to be recalled is abnormal, the availability status of the archive package to be recalled is determined to be abnormal. If there are no abnormalities in the existence of the archive package to be recalled, the recall status, the policy blocking status, and the verification status, and the storage level is marked as online, the availability status of the archive package to be recalled is determined to be a normal online available status. If there are no abnormalities in the existence of the archive package to be recalled, the recall status, the policy blocking status, and the verification status, and the storage level is marked as offline or deep archiving, the availability status of the archive package to be recalled is determined to be a normal pending recall status.
5. The cold media recall method for database backup and recovery tools as described in claim 4, characterized in that, After performing a status pre-check on the archive package to be recalled and determining its availability status, the process further includes: When the availability status is abnormal, the cause of the abnormality is determined based on the set of verification results of the archive package to be recalled, and the cause of the abnormality is written to the log.
6. The cold media recall method for database backup and recovery tools as described in claim 1, characterized in that, The construction of the recovery mapping relationship between the original object content, the archive package to be recalled, and the database backup and recovery tool includes: Obtain the archive package identifier of the archive package to be recalled, and determine the object key associated with the archive package to be recalled and the database backup and recovery tool; The object key is bound to the original object content and the archive package identifier respectively to construct the recovery mapping relationship.
7. The cold media recall method for database backup and recovery tools as described in claim 1, characterized in that, The step of initiating a cold media recall of the archive package to be recalled and obtaining the original object content of the archive package to be recalled includes: Initiate a first read operation on the archive package to be recalled, and when the first read operation is successful, obtain the original object content of the archive package to be recalled; If the first read operation fails, a retry token and a retry deadline are generated for the archive package to be recalled. Within the retry deadline, a second read operation is repeatedly initiated on the archive package to be recalled based on the retry token; If any of the second read operations is successful, then determine whether the archive package to be recalled meets the preset recall time limit requirement; If the preset recall time limit is not met, the record reading will fail. If the preset recall time limit requirement is met, the original object content of the archive package to be recalled is obtained based on the second read operation; If all second read operations fail, record the failure of the through read and the reason for the failure of each second read operation.
8. A cold media recall device for database backup and recovery tools, characterized in that, The device includes: a time data determination module, a status verification module, a warehouse view plan construction module, and a cold medium recall module; The time data determination module is used to respond to a user's database data recovery request; wherein, the database data recovery request includes: a target recovery time; determining the recoverable time window corresponding to the target recovery time, and obtaining the archive package to be recalled corresponding to the recoverable time window; The status verification module is used to perform a status pre-check on the archive package to be recalled and determine the availability status of the archive package to be recalled. The warehouse view plan construction module is used to initiate a cold media recall to the archive package to be recalled when the availability status is normal and awaiting recall, obtain the original object content of the archive package to be recalled, construct a recovery mapping relationship between the original object content, the archive package to be recalled, and the database backup and recovery tool, and construct a warehouse view plan for the archive package to be recalled based on the recovery mapping relationship. The cold media recall module is used to respond to the data recovery request of the database backup and recovery tool, extract the original object content of the archive package to be recalled based on the repository view plan of the archive package to be recalled, and return the original object content to the database backup and recovery tool so that the database backup and recovery tool can complete the data recall of the archive package to be recalled.
9. A cold media recall device for database backup and recovery tools, characterized in that, The device includes: a memory, a processor, and a computer program stored on the memory and executable on the processor, the computer program being configured to implement the steps of the cold media recall method for a database backup and recovery tool as described in any one of claims 1 to 7.
10. A storage medium, characterized in that, The storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, it implements the steps of the cold media recall method for database backup and recovery tools as described in any one of claims 1 to 7.
