Method and system for constructing database sandbox environment based on CDM super copy

By using CDM super replica technology in the database, the backup data is exported regularly and the database sandbox environment is built with snapshots and archived logs, the problem of time-consuming database troubleshooting and data recovery in the existing technology is solved, and a fast and efficient database sandbox environment construction is achieved.

CN119720177AActive Publication Date: 2025-03-28GUANGZHOU JINYUAN INTELLIGENT TECHNOLOGY CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202411789171.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-06
Publication Date
2025-03-28
Estimated Expiration
2044-12-06

AI Technical Summary

Technical Problem

When troubleshooting and data recovery, existing database applications need to export full backup data from the main library and build a new environment. The process is time-consuming and increases the load of the main library, affecting business continuity.

Method used

Using the CDM super replica method, backup data is exported from the source database regularly and transmitted to the storage node, and a database sandbox environment is built with snapshots and archive logs to achieve rapid recovery to the data state at a specified time.

Benefits of technology

This greatly simplifies the troubleshooting and data recovery process, shortens the construction time of the database sandbox environment, improves efficiency, and reduces the impact on the production environment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119720177A_ABST
    Figure CN119720177A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of databases, in particular to a method and system for constructing a database sandbox environment based on a CDM super replica, and the method comprises the steps: regularly exporting backup data and an archiving log from a source database to a storage node through a backup strategy and a log acquisition strategy set by a user, storing the backup data into a data directory after the backup data is recovered, and snapshotting, and storing the last archiving log file name corresponding to the snapshot data and archiving log data site information into a snapshot record table, recording key information of the archiving log file and storing the key information into an archiving log record table, and when a database sandbox is constructed, constructing the database sandbox according to a database sandbox construction time point set by a user. According to the database sandbox environment construction method, the time point of the database sandbox environment is recorded, the snapshot closest to the time point is selected from the snapshot record table, the database sandbox environment is constructed by combining the snapshot with the archiving log, and efficient and accurate database sandbox environment construction is achieved through timing backup, snapshot management, archiving log acquisition and application and accurate time point recovery when a service system is idle.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of database technology, and in particular to a method and system for constructing a database sandbox environment based on a CDM super copy. Background Art

[0002] Current database applications usually adopt the master-slave mode, where the master database is responsible for read and write operations, and the slave database is used for disaster recovery and read operations.

[0003] Whether it is the master database or the slave database, data is updated dynamically in real time or quasi-real time. When an error occurs in the business system, the data is usually updated and the problematic data is overwritten, which brings challenges to business troubleshooting. If you need to simulate the data at the problem time point, you must re-export the full backup from the master database and rebuild the database environment. If the selected time point is inaccurate, you must back up and rebuild again. Repeating this process usually takes several hours to export the full data, which will increase the load on the master database and may cause new failures. In addition, it also takes several hours to transfer the exported copy data to the new environment and restore the data, which is time-consuming, labor-intensive and wastes resources. Summary of the invention

[0004] The purpose of the present invention is to propose a method and system for constructing a database sandbox environment based on CDM super copy, which can quickly construct a data environment at a specified time point in a short time, thereby greatly simplifying the process of troubleshooting and data recovery.

[0005] To achieve the purpose of the present invention, the following technical solutions are adopted:

[0006] The first aspect of the present invention provides a method for constructing a database sandbox environment based on a CDM super copy, comprising the following steps:

[0007] According to the backup policy configured by the user, the backup data is exported from the source database and transmitted to the storage node at the scheduled time;

[0008] After the backup data is restored, it is saved in the data directory of the storage node and a snapshot is taken of the data directory. At the same time, the last archive log file name and archive log data location information corresponding to the snapshot data are saved in the snapshot record table;

[0009] According to the log acquisition strategy configured by the user, archive log files are obtained from the source database at a scheduled time and saved in the archive log directory of the storage node. At the same time, key information of the archive log files is recorded and saved in the archive log record table;

[0010] When the user sets the time point for building the database sandbox in the operation front end, a snapshot record closest to the time point for building the database sandbox is selected from the snapshot record table in combination with the snapshot record table and the archive log record table;

[0011] Use the snapshot data corresponding to the selected snapshot record in combination with the archive log to build a database sandbox environment.

[0012] A further improvement is that when exporting backup data from the source database, the first export is the full backup data, and subsequent exports are incremental backup data.

[0013] A further improvement is that for full backup data, after recovery processing, it is directly saved to the data directory of the storage node and a snapshot of the data directory is taken; for incremental backup data, after recovery processing, it is merged into the data directory of the storage node and a snapshot of the data directory is taken.

[0014] A further improvement is that the key information of the archive log file includes the serial number, file name, file size, start time and end time of the corresponding data of the archive log file.

[0015] A further improvement is that the snapshot record table also records the snapshot ID, snapshot time, and snapshot data directory path.

[0016] A further improvement is that exporting backup data and obtaining archive log files are performed during the idle time of the source database business system.

[0017] A further improvement is that the specific method of using the snapshot data corresponding to the selected snapshot record in combination with the archive log to construct a database sandbox environment includes:

[0018] Clone snapshot data: Create a sandbox data directory on the storage node and clone the selected snapshot data into the sandbox data directory;

[0019] Mount directory: mount the sandbox data directory of the storage node to the configuration data directory of the sandbox target host through NFS mounting, and mount the archive log directory of the storage node to the configuration archive log directory of the sandbox target host through NFS mounting;

[0020] Generate a configuration file: Generate a database instance configuration file. The configuration file specifies that the data directory of the sandbox database instance points to the configuration data directory of the sandbox target host, and writes the configuration file to the data directory of the sandbox database instance.

[0021] Start the database instance: Start the database instance on the sandbox target host;

[0022] Apply archive logs: Query and apply all archive logs from the snapshot end time to the user-set database sandbox construction time point from the archive log record table.

[0023] A further improvement is that the specific method of querying and applying all archived logs from the snapshot end time to the user-set database sandbox construction time point from the archived log record table includes:

[0024] Query archive logs: query all archive logs from the end time of the snapshot data to the time point for building the database sandbox set by the user from the archive log record table;

[0025] Determine the starting position: Use the archive log data location information in the snapshot record table and specify the starting position of the first archive log through the --start-position parameter;

[0026] Determine the end time: Use the --stop-datetime parameter to specify the end time of the application of the last archived log;

[0027] Apply logs: Use database tools to apply these archived logs and refresh the records in the archived logs to the sandbox database instance.

[0028] A further improvement is that the database instance is started and run on the sandbox target host through SSH.

[0029] A second aspect of the present invention provides a system for constructing a database sandbox environment based on a CDM super copy, comprising:

[0030] A backup data export unit, used to export backup data from the source database regularly and transmit it to the storage node according to the backup policy configured by the user;

[0031] The backup data processing and storage unit is used to restore the backup data and save it in the data directory of the storage node and take a snapshot of the data directory, and at the same time save the last archive log file name and archive log data location information corresponding to the snapshot data into the snapshot record table;

[0032] The archive log acquisition and storage unit is used to obtain archive log files from the source database regularly according to the log acquisition policy configured by the user and save them to the archive log directory of the storage node, and record the key information of the archive log files and save them in the archive log record table;

[0033] The database sandbox environment construction unit is used to select a snapshot record closest to the time point for building the database sandbox from the snapshot record table in combination with the snapshot record table and the archive log record table when the user sets the time point for building the database sandbox on the operation front end, and use the snapshot data corresponding to the selected snapshot record in combination with the archive log to build the database sandbox environment.

[0034] The beneficial effects of the present invention are:

[0035] The data backup of the present invention is obtained during the idle time of the business system, avoiding the performance impact on the production environment. The backup data snapshot is compressed and stored in the storage node, taking up little space and not occupying production environment resources. The process of obtaining archive logs is lightweight and fast, usually completed within a few minutes, without the need to connect to the production database, reducing the impact on the production environment.

[0036] The backup data snapshot has been saved in the storage node in advance, and users do not need to spend several hours to export it. When using the database sandbox, it only needs to be mounted to the sandbox target host through the NFS network. This operation is completed within seconds. The archive log file is usually about 1GB in size. The operation of applying an archive log is completed within seconds to minutes, which greatly shortens the construction time. From mounting the backup data to applying the archive log, the entire database instance construction process is completed within minutes, which significantly improves efficiency.

[0037] In addition, the sandbox database constructed by the present invention is independent and does not affect the use of the production library. Users can freely perform various operations in the sandbox environment without any impact on the production environment. When sandbox data needs to be built, users only need to perform simple interface operations to complete the construction of the database instance within minutes. When sandbox data needs to be built, only simple interface operations are required to complete the construction of the database instance within minutes. When it is not needed, it can be quickly cleaned up by stopping the database instance and canceling the NFS network mount. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] Figure 1 A flowchart of a method for constructing a database sandbox environment based on a CDM super copy according to the present invention;

[0039] Figure 2 A flow chart of a method for constructing a database sandbox environment using snapshot data corresponding to a selected snapshot record in combination with an archive log in the present invention;

[0040] Figure 3 This is a schematic diagram of constructing the sandbox environment in the present invention. DETAILED DESCRIPTION

[0041] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.

[0042] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, wholes, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or combinations thereof.

[0043] It should also be understood that the term “and / or” used in the specification and appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.

[0044] In the description of the present disclosure, it should be understood that the terms "upper", "lower", "front", "back", "left" and "right" etc. indicating directions or positional relationships are based on the directions or positional relationships shown in the drawings, which are only for the convenience of describing the present invention and simplifying the description, and do not indicate or imply that the indicated positions or elements must have a specific direction, be constructed and operate in a specific direction, and therefore cannot be understood as limitations of the present disclosure. In addition, in the description of the present application specification and the attached claims, the terms "first", "second", "third" etc. are only used to distinguish the description, and cannot be understood as indicating or implying relative importance.

[0045] References to "one embodiment" or "some embodiments" etc. described in the specification of this application mean that one or more embodiments of the present application include specific features, structures or characteristics described in conjunction with the embodiment. Therefore, the statements "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways.

[0046] Please refer to the attached Figure 1 -Attached Figure 3 According to a first aspect of an embodiment of the present invention, a method for constructing a database sandbox environment based on a CDM (Copy Data Management) super copy is provided, comprising the following steps:

[0047] Step S1: according to the backup strategy configured by the user, backup data is exported from the source database (which can be a primary database or a secondary database) at a predetermined time and transmitted to the storage node.

[0048] Specifically, when exporting backup data from a source database, the first export is full backup data, and subsequent exports are incremental backup data.

[0049] It should be understood that users can configure backup strategies on the operation front end. This backup strategy is used to set the time, frequency, backup type (full backup or incremental backup), etc. for exporting backup data from the source database. Generally, the time for exporting backup data is usually the idle time of the source database business system, and the backup data is transmitted to the storage node via the network.

[0050] Step S2: After the backup data is restored, it is saved in the data directory of the storage node and a snapshot of the data directory is saved. Each snapshot is a full copy of the data that can be used by the database. At the same time, the last archive log file name and archive log data location information corresponding to the snapshot data are saved in the snapshot record table.

[0051] Specifically, for full backup data, it is directly saved in the data directory of the storage node after the restore process and a snapshot of the data directory is taken; for incremental backup data, it is merged into the data directory of the storage node after the restore process and a snapshot of the data directory is taken. A snapshot is a data snapshot at a point in time and can be used at any time to restore or build a sandbox environment.

[0052] It is understandable that backup data usually undergoes special processing such as compression before network transmission and cannot be directly recognized and used by the database. To be recognized and used by the database, the backup data needs to be reprocessed, such as decompression, and this process is called restore.

[0053] Step S3: According to the log acquisition strategy configured by the user, archive log files are obtained from the source database (which can be the main database or the slave database) at a predetermined time and saved in the archive log directory of the storage node. At the same time, key information of the archive log files is recorded and saved in the archive log record table.

[0054] Specifically, the key information of the archive log file includes the serial number, file name, file size, start time and end time of the corresponding data, etc. Through these key information, the archive log can be more efficiently managed and utilized to build a database sandbox environment.

[0055] It should be understood that the archive log is a log file in the database management system, which is used to record all changes to the database to ensure data consistency and recoverability. Users can configure the backup strategy on the front end of the operation. This backup strategy is used to set the time and frequency of obtaining archive log files from the source database. Generally, the time to obtain archive log files is usually when the source database business system is idle. The operation of obtaining archive log files will not affect the database, and each acquisition will continue the archive file sequence number and location information of the previous time, and will not be obtained repeatedly.

[0056] Step S4: When the user sets the time point for building the database sandbox in the operation front end, a snapshot record closest to the time point for building the database sandbox is selected from the snapshot record table in combination with the snapshot record table and the archive log record table.

[0057] It should be understood that the snapshot record table stores the last archive log file name and archive log data location information corresponding to the snapshot data. The end time of the snapshot data can be found from the archive log record table according to the archive log file name. Therefore, according to the database sandbox construction time point set by the user, a snapshot record closest to the database sandbox construction time point can be found in combination with the snapshot record table and the archive log record table. That is, when the user wants to build a database sandbox environment at a specific time point, the system will search for the snapshot record closest to the time point in the snapshot record table according to the time point set by the user, so as to ensure that the selected snapshot can be as close as possible to the user's expected time point.

[0058] Step S5: Use the snapshot data corresponding to the selected snapshot record in combination with the archive log to build a database sandbox environment.

[0059] It can be understood that by restoring the snapshot data and supplementing and updating it according to the change information in the archive log, a database sandbox environment corresponding to the time point for building the database sandbox set by the user is achieved, ensuring that the constructed sandbox environment is completely consistent with the production environment status at the specified time point.

[0060] Preferably, the snapshot record table also records the snapshot ID, snapshot time, and snapshot data directory path.

[0061] Specifically, in this embodiment, the export of backup data and the acquisition of archived log files are performed during the idle time of the source database business system, which can minimize the impact on the normal operation of the business, avoid system performance degradation or freezes due to data export and acquisition of archived logs during business peak periods, and ensure business continuity and stability.

[0062] The present invention realizes efficient and accurate database sandbox environment construction through scheduled backup, snapshot management, archive log acquisition and application, and accurate point-in-time recovery when the business system is idle.

[0063] In this embodiment, the specific method of using the snapshot data corresponding to the selected snapshot record in combination with the archive log to construct the database sandbox environment in step S5 includes:

[0064] Step S51: Clone snapshot data: Create a sandbox data directory on the storage node, clone the selected snapshot data into the sandbox data directory, and prepare basic data for building a sandbox environment.

[0065] Step S52: Mount directory: mount the sandbox data directory of the storage node to the configuration data directory of the sandbox target host through NFS (Network File System) mounting. The purpose of this is to allow the sandbox target host to directly access the data on the storage node without copying the data, thereby simplifying the data transmission process; mount the archive log directory of the storage node to the configuration archive log directory of the sandbox target host through NFS mounting. The purpose of this is to allow the sandbox target host to directly access the archive logs on the storage node, so that the archive logs can be applied when building the sandbox environment.

[0066] It is understandable that data sharing and accessibility are achieved by mounting the directory on NFS so that it can be subsequently operated and used on the sandbox target host.

[0067] Step S53: Generate a configuration file: Generate a database instance configuration file for specifying the data directory path of the sandbox database instance. The data directory of the sandbox database instance specified in the configuration file points to the configuration data directory of the sandbox target host, and write the configuration file to the data directory of the sandbox database instance.

[0068] It is understandable that the configuration file includes various configuration parameters of the database instance, such as the data directory path, the log directory path, the listening port, etc., to ensure that the database instance can correctly identify and use the sandbox data.

[0069] Step S54: Start the database instance: start the database instance on the sandbox target host and enter an operational state.

[0070] It should be understood that during the startup process, the system reads the parameters in the configuration file, initializes the database instance, and starts the database service.

[0071] Step S55: Apply archive logs: query and apply all archive logs from the snapshot end time to the database sandbox construction time point set by the user from the archive log record table.

[0072] The present invention creates a sandbox data directory on a storage node, clones the selected snapshot data into the sandbox data directory, mounts the sandbox data directory of the storage node to the configuration data directory of the sandbox target host by means of NFS mounting, and mounts the archive log directory of the storage node to the configuration archive log directory of the sandbox target host by means of NFS mounting. This can realize rapid initialization of the sandbox environment, reduce the time for data transmission and recovery, and improve construction efficiency. By combining snapshot records and archive logs, it can accurately restore to any time point specified by the user, ensuring that the data state of the sandbox environment is completely consistent with the target time point.

[0073] Further, in this embodiment, the specific method of querying and applying all archive logs from the archive log record table from the snapshot end time to the database sandbox construction time point set by the user in step S55 includes:

[0074] Step S551: query archive logs: query all archive logs from the snapshot data end time to the database sandbox construction time point set by the user from the archive log record table, to ensure the integrity and pertinence of the data.

[0075] It is understandable that by querying the archive logs, it is ensured that only archive logs within the specified time range are selected to avoid unnecessary log processing.

[0076] Step S552: Determine the starting position: Use the archive log data location information in the snapshot record table and specify the starting position of the first archive log through the --start-position parameter.

[0077] It is understandable that the operation of determining the starting position utilizes the archive log data location information in the snapshot record table and specifies the exact starting position of the first archive log through specific parameters, ensuring that the archive log is applied from the correct data location to avoid data inconsistency issues.

[0078] Step S553: ​​Determine the end time: specify the end time of application of the last archive log through the --stop-datetime parameter.

[0079] It can be understood that by determining the end time, it is ensured that the archive log is applied to the time point specified by the user and does not exceed the time point.

[0080] Step S554: Apply logs: Use database tools to apply these archive logs and refresh the records in the archive logs to the sandbox database instance.

[0081] It can be understood that applying logs ensures that all necessary archived logs are correctly applied to the sandbox database instance and restored to the user-specified point in time.

[0082] Specifically, you can refresh the records in the archive log to the sandbox database instance by applying the archive log. Apply: Apply log operation. The archive log records the logical operation records of the business, which can be understood as SQL operations. The database system provides application log tools, such as mysqlbinlog of msyql and rman of oracle. The application log tool inputs the archive log parameters, executes the logical data of the archive log, and then refreshes the data to the database instance to update the database records.

[0083] Through the above steps, all archived logs can be accurately applied from the end time of the snapshot data to the time point set by the user to build the database sandbox, ensuring that the data status of the sandbox environment is completely consistent with the time point required by the user.

[0084] Preferably, in step S54, starting and running the database instance on the sandbox target host is done through SSH (Secure Shell).

[0085] In general, the data backup of the present invention is obtained during the idle time of the business system, avoiding the performance impact on the production environment. The backup data snapshot is compressed and stored in the storage node, which takes up little space and does not occupy production environment resources. The process of obtaining archived logs is lightweight and fast, usually completed within a few minutes, without connecting to the production database, reducing the impact on the production environment.

[0086] The backup data snapshot has been saved in the storage node in advance, and users do not need to spend several hours to export it. When using the database sandbox, it only needs to be mounted to the sandbox target host through the NFS network. This operation is completed within seconds. The archive log file is usually about 1GB in size. The operation of applying an archive log is completed within seconds to minutes, which greatly shortens the construction time. From mounting the backup data to applying the archive log, the entire database instance construction process is completed within minutes, which significantly improves efficiency.

[0087] In addition, the sandbox database constructed by the present invention is independent and does not affect the use of the production library. Users can freely perform various operations in the sandbox environment without any impact on the production environment. When sandbox data needs to be built, users only need to perform simple interface operations to complete the construction of the database instance within minutes. When sandbox data needs to be built, only simple interface operations are required to complete the construction of the database instance within minutes. When it is not needed, it can be quickly cleaned up by stopping the database instance and canceling the NFS network mount.

[0088] A second aspect of an embodiment of the present invention provides a system for constructing a database sandbox environment based on a CDM super copy, which is used to execute a method for constructing a database sandbox environment based on a CDM super copy in the first embodiment of the present invention. Specifically, the system includes:

[0089] The backup data export unit is used to export backup data from the source database regularly and transmit it to the storage node according to the backup policy configured by the user.

[0090] The backup data processing and storage unit is used to restore the backup data and save it to the data directory of the storage node and take a snapshot of the data directory. At the same time, the last archive log file name and archive log data location information corresponding to the snapshot data are saved in the snapshot record table.

[0091] The archive log acquisition and storage unit is used to obtain archive log files from the source database at regular intervals and save them to the archive log directory of the storage node according to the log acquisition strategy configured by the user, and record the key information of the archive log files and save them in the archive log record table.

[0092] The database sandbox environment construction unit is used to select a snapshot record closest to the time point for building the database sandbox from the snapshot record table in combination with the snapshot record table and the archive log record table when the user sets the time point for building the database sandbox on the operation front end, and use the snapshot data corresponding to the selected snapshot record in combination with the archive log to build the database sandbox environment.

[0093] Since a system for building a database sandbox environment based on CDM super copy provided by an embodiment of the present invention corresponds to a method for building a database sandbox environment based on CDM super copy provided by the first aspect of the present invention, the implementation method of the aforementioned method for building a database sandbox environment based on CDM super copy is also applicable to a system for building a database sandbox environment based on CDM super copy provided by this embodiment, and will not be described in detail in this embodiment.

[0094] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0095] The embodiments described above are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, a person skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.

Claims

1. A method for constructing a database sandbox environment based on CDM super copy, characterized in that: The following steps are involved: According to the backup policy configured by the user, the backup data is exported from the source database and transmitted to the storage node at the scheduled time; After the backup data is restored, it is saved in the data directory of the storage node and a snapshot is taken of the data directory. At the same time, the last archive log file name and archive log data location information corresponding to the snapshot data are saved in the snapshot record table; According to the log acquisition strategy configured by the user, archive log files are obtained from the source database at a scheduled time and saved in the archive log directory of the storage node. At the same time, key information of the archive log files is recorded and saved in the archive log record table; When the user sets the time point for building the database sandbox in the operation front end, a snapshot record closest to the time point for building the database sandbox is selected from the snapshot record table in combination with the snapshot record table and the archive log record table; Use the snapshot data corresponding to the selected snapshot record in combination with the archive log to build a database sandbox environment.

2. A method for constructing a database sandbox environment based on CDM super copy according to claim 1, characterized in that: When exporting backup data from the source database, the first export is the full backup data, and subsequent exports are incremental backup data.

3. A method for constructing a database sandbox environment based on CDM super copy according to claim 2, characterized in that: For full backup data, it is directly saved to the data directory of the storage node after recovery and a snapshot of the data directory is taken; for incremental backup data, it is merged into the data directory of the storage node after recovery and a snapshot of the data directory is taken.

4. The method for constructing a database sandbox environment based on CDM super copy according to claim 1, characterized in that: The key information of the archive log file includes the serial number, file name, file size, start time and end time of the corresponding data of the archive log file.

5. The method for constructing a database sandbox environment based on CDM super copy according to claim 1, characterized in that: The snapshot record table also records the snapshot ID, snapshot time, and snapshot data directory path.

6. The method for constructing a database sandbox environment based on CDM super copy according to claim 1, characterized in that: Exporting backup data and obtaining archive log files are performed during the idle time of the source database business system.

7. The method for constructing a database sandbox environment based on CDM super copy according to claim 1, characterized in that: The specific method of using the snapshot data corresponding to the selected snapshot record in combination with the archive log to build a database sandbox environment includes: Clone snapshot data: Create a sandbox data directory on the storage node and clone the selected snapshot data into the sandbox data directory; Mount directory: mount the sandbox data directory of the storage node to the configuration data directory of the sandbox target host through NFS mounting, and mount the archive log directory of the storage node to the configuration archive log directory of the sandbox target host through NFS mounting; Generate a configuration file: Generate a database instance configuration file. The configuration file specifies that the data directory of the sandbox database instance points to the configuration data directory of the sandbox target host, and writes the configuration file to the data directory of the sandbox database instance. Start the database instance: Start the database instance on the sandbox target host; Apply archive logs: Query and apply all archive logs from the snapshot end time to the user-set database sandbox construction time point from the archive log record table.

8. The method for constructing a database sandbox environment based on CDM super copy according to claim 7, characterized in that: The specific method of querying and applying all archived logs from the snapshot end time to the user-set database sandbox construction time point from the archived log record table includes: Query archive logs: query all archive logs from the end time of the snapshot data to the time point for building the database sandbox set by the user from the archive log record table; Determine the starting position: Use the archive log data location information in the snapshot record table and specify the starting position of the first archive log through the --start-position parameter; Determine the end time: Use the --stop-datetime parameter to specify the end time of the application of the last archived log; Apply logs: Use database tools to apply these archived logs and refresh the records in the archived logs to the sandbox database instance.

9. The method for constructing a database sandbox environment based on CDM super copy according to claim 7, characterized in that: The database instance is started and run on the sandbox target host through SSH.

10. A system for building a database sandbox environment based on CDM super copy, characterized in that: include: A backup data export unit, used to export backup data from the source database regularly and transmit it to the storage node according to the backup policy configured by the user; The backup data processing and storage unit is used to restore the backup data and save it in the data directory of the storage node and take a snapshot of the data directory, and at the same time save the last archive log file name and archive log data location information corresponding to the snapshot data into the snapshot record table; The archive log acquisition and storage unit is used to obtain archive log files from the source database regularly according to the log acquisition policy configured by the user and save them to the archive log directory of the storage node, and record the key information of the archive log files and save them in the archive log record table; The database sandbox environment construction unit is used to select a snapshot record closest to the time point for building the database sandbox from the snapshot record table in combination with the snapshot record table and the archive log record table when the user sets the time point for building the database sandbox on the operation front end, and use the snapshot data corresponding to the selected snapshot record in combination with the archive log to build the database sandbox environment.

Citation Information

Patent Citations

  • Oracle timely mounting and restoring system based on timing backup

    CN109325075A

  • Method and equipment for recovering data based on backup system

    CN113360322A

  • Modification of data in a time-series data lake

    US20210271686A1