A method and system for archiving logs

By collecting and analyzing information such as database system level and space utilization, the number of backup channels or processes can be adjusted to solve the problem of difficulty in controlling the backup frequency of archived logs. This ensures that archived logs are backed up to the tape library in a timely manner, avoids database unresponsiveness and performance impact, and improves business efficiency.

CN113190520BActive Publication Date: 2026-04-24CHINA CONSTRUCTION BANK
View PDF 3 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
CHINA CONSTRUCTION BANK
Filing Date
2021-05-26
Publication Date
2026-04-24

AI Technical Summary

Technical Problem

The existing archive log backup frequency is difficult to control, which may lead to the risk of the database archive space being full and causing long periods of unresponsiveness. In addition, frequent backup operations affect the performance of database services and reduce execution efficiency.

Method used

By collecting the current database system level, archive space utilization, and the time of the most recent archive log backup, the database backup task is initiated according to preset conditions. During the backup process, the number of backup channels or processes is increased or decreased to ensure timely backup to the tape library when archive logs are generated at peak times.

Benefits of technology

This avoids the risk of prolonged unresponsiveness caused by a full database archive space, reduces the impact of frequent backup operations on business performance, and improves the execution efficiency of database services.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113190520B_ABST
    Figure CN113190520B_ABST
Patent Text Reader

Abstract

The application discloses an archiving log processing method and system, when a database backup task is started, the number of backup channels is increased or the number of archiving processes is reduced according to the importance of the database system, so that the speed of generating the archiving log is slowed down, the archiving log is timely backed up to the tape library during the time of the archiving log generation peak, the archiving space of the database is released, and the risk of long-time non-response of the database caused by the full archiving space of the database is avoided. In addition, during the time of the archiving log generation peak, the archiving log is timely backed up to the tape library, the archiving log backup operation does not need to be frequently performed, the performance of executing the database business can be avoided from being affected by the frequent backup operation, and thus the efficiency of executing the database business is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of database backup technology, and more specifically, to an archive log processing method and system. Background Technology

[0002] A database is a repository for application data; it is a large collection of organized, shareable, and centrally managed data stored permanently on a computer. To protect the database from various failures, it must be backed up regularly so that data can be recovered promptly in case of loss or corruption.

[0003] Database backups include archive log backups. Archive log backups involve periodically backing up archive logs stored on a limited-capacity storage array to a tape library, and then deleting the archive logs from the storage array. Archive log backups are performed periodically, such as every 4 hours. However, the archive log backup cycle is difficult to control. Infrequent backups may fill up the archive space, potentially causing the database to become unresponsive for extended periods. Conversely, excessively frequent backups may negatively impact the performance of normal database operations, leading to low efficiency.

[0004] Therefore, existing archived log backups may pose a risk of prolonged database unresponsiveness and reduce the efficiency of performing database operations. Summary of the Invention

[0005] In view of this, the present invention discloses an archive log processing method and system to avoid the risk of the database becoming unresponsive for a long time due to the full archive space of the database and the impact of frequent backup operations on the performance of database business operations, thereby improving the efficiency of data business operations.

[0006] To achieve the above objectives, the disclosed technical solution is as follows:

[0007] The first aspect of this invention discloses an archived log processing method, the method comprising:

[0008] Collect the current database system level, the current archive space utilization rate, and the time of the most recent archive log backup;

[0009] If the current database system level, the current archive space utilization rate, and the time of the most recent archive log backup meet the first preset condition, determine to initiate the database backup task at the current time;

[0010] During the execution of the database backup task, if the database system level at the current moment meets the second preset condition, then the operation of increasing the number of backup channels is performed, and the archive log backup operation is performed; or, during the execution of the database backup task, if the database system level at the current moment meets the third preset condition, then the operation of decreasing the number of archiver processes is performed, and the archive log backup operation is performed.

[0011] Preferably, the collection of the current database system level, the current archive space utilization rate, and the time of the most recent archive log backup includes:

[0012] Within a first preset time period, based on the system level information collection script, the database system level at the current moment is collected, and the database system level includes a first system level, a second system level, and a third system level;

[0013] Within the second preset time period, the current archive space usage rate is collected based on the archive space usage collection script.

[0014] Within the third preset time period, a script based on the archived backup status collects the time of the most recent archived log backup.

[0015] Preferably, determining to initiate a database backup task if the current database system level, the current archive space utilization rate, and the time of the most recent archive log backup meet a first preset condition includes:

[0016] When the current archive space utilization rate is greater than or equal to the preset utilization rate, and the difference between the current time and the time of the most recent archive log backup is less than or equal to the first preset time, it is determined to initiate the database backup task.

[0017] or,

[0018] When the current archive space utilization rate is greater than or equal to the preset utilization rate, and the difference between the current time and the time of the most recent archive log backup is greater than the first preset time, it is determined to initiate a database backup task.

[0019] or,

[0020] When the current archive space utilization rate is less than the preset utilization rate and greater than the second preset time, it is determined to initiate a database backup task.

[0021] Preferably, during the execution of the database backup task, if the current database system level meets the second preset condition, then an operation to increase the number of backup channels is performed, and an archive log backup operation is performed, including:

[0022] During the execution of the database backup task, the difference between the current time and the time of the most recent archived log backup is calculated;

[0023] If the ratio of the current archive space utilization rate to the difference is greater than or equal to a first preset value, and the current database system level is the first system level, the number of backup channels is increased according to the preset number of channels, and the archive log backup operation is performed.

[0024] Preferably, during the execution of the database backup task, if the current database system level meets the third preset condition, then an operation to reduce the number of archiver processes is performed, and an archive log backup operation is performed, including:

[0025] During the execution of the database backup task, the difference between the current time and the time of the most recent archived log backup is calculated;

[0026] If the ratio of the current archive space utilization rate to the difference is greater than or equal to a first preset value, and the current database system level is the third system level, the number of archiver processes is reduced according to the preset number of processes.

[0027] Preferably, after the step of increasing the number of backup channels and performing archived log backup operations if the database system level at the current moment meets the second preset condition, the method further includes:

[0028] Based on the first preset restore number, the number of backed-up channels is restored.

[0029] Preferably, after reducing the number of archiver processes and performing archive log backup operations if the database system level at the current moment meets the third preset condition, the method further includes:

[0030] The number of archiver processes is restored based on the second preset restore number.

[0031] A second aspect of the present invention discloses an archived log processing system, the system comprising:

[0032] The data collection unit is used to collect the current database system level, the current archive space utilization rate, and the time of the most recent archive log backup.

[0033] The determining unit is configured to determine to initiate a database backup task at the current time if the current database system level, the current archive space utilization rate, and the time of the most recent archive log backup meet a first preset condition.

[0034] The execution unit is configured to, during the execution of the database backup task, if the current database system level meets the second preset condition, perform an operation to increase the number of backup channels and perform an archive log backup operation; or, during the execution of the database backup task, if the current database system level meets the third preset condition, perform an operation to decrease the number of archiver processes and perform an archive log backup operation.

[0035] Preferably, the acquisition unit includes:

[0036] The first acquisition module is used to acquire the database system level at the current moment based on the system level information acquisition script within a first preset time period. The database system level includes a first system level, a second system level, and a third system level.

[0037] The second acquisition module is used to acquire the current archive space usage rate based on the archive space usage acquisition script within the second preset time period.

[0038] The third acquisition module is used to acquire the time of the most recent archived log backup based on the archived backup status acquisition script within the third preset time period.

[0039] Preferably, the determining unit includes:

[0040] The first determining module is used to determine to initiate a database backup task when the current archive space utilization rate is greater than or equal to a preset utilization rate, and the difference between the current time and the time of the most recent archive log backup is less than or equal to a first preset time.

[0041] or,

[0042] The second determining module is used to determine to initiate a database backup task when the current archive space utilization rate is greater than or equal to the preset utilization rate, and the difference between the current time and the time of the most recent archive log backup is greater than the first preset time.

[0043] or,

[0044] The third determining module is used to determine to initiate a database backup task when the current archive space utilization rate is less than the preset utilization rate and greater than the second preset time.

[0045] The above technical solution involves collecting the current database system level, archive space utilization, and the time of the most recent archive log backup. Based on these factors, it determines whether to initiate a database backup task. If these conditions are met, the database backup task is initiated. During the backup process, if the database system level meets a second preset condition, the number of backup channels is increased, and the archive log backup operation is performed. Alternatively, if the database system level meets a third preset condition, the number of archiver processes is reduced, and the archive log backup operation is performed. This solution, by adjusting the number of backup channels or reducing the number of archiver processes based on the importance of the database system level when initiating a backup task, slows down the archive log generation rate. This ensures that archive logs are backed up to the tape library promptly during peak archive log generation times, freeing up database archive space and preventing the risk of prolonged database unresponsiveness due to full archive space. In addition, during peak periods of archive log generation, timely backup of archive logs to the tape library eliminates the need for frequent archive log backup operations, thus avoiding the impact of frequent backup operations on the performance of database operations and improving the efficiency of data operations. Attached Figure Description

[0046] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.

[0047] Figure 1 This is a flowchart illustrating an archive log processing method disclosed in an embodiment of the present invention;

[0048] Figure 2 This is a schematic diagram of the process for collecting the current database system level, the current archive space utilization rate, and the time of the most recent archive log backup as disclosed in an embodiment of the present invention;

[0049] Figure 3 This is a flowchart illustrating the process disclosed in this embodiment of the invention of performing an operation to increase the number of backup channels and perform an archive log backup operation if the database system level at the current moment meets the second preset condition.

[0050] Figure 4This is a schematic diagram of the process disclosed in an embodiment of the present invention, which involves reducing the number of archiver processes and performing archive log backup operations if the current database system level meets the third preset condition.

[0051] Figure 5 This is a schematic diagram of the structure of an archive log processing system disclosed in an embodiment of the present invention. Detailed Implementation

[0052] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0053] In this application, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0054] As can be seen from the background technology, existing archived log backups may cause the database to become unresponsive for a long time and make the execution of database business inefficient.

[0055] To address this issue, this invention discloses an archive log processing method and system. When initiating a database backup task, the number of backup channels is increased or the number of archive processes is decreased based on the importance of the database system. This slows down the generation of archive logs, ensuring that archive logs are backed up to the tape library promptly during peak archive log generation periods. This frees up database archive space and avoids the risk of prolonged database unresponsiveness due to full archive space. Furthermore, timely backup of archive logs to the tape library during peak generation periods eliminates the need for frequent backup operations, preventing them from impacting database performance and improving data service efficiency. The specific implementation is described in detail in the following embodiments.

[0056] like Figure 1 The diagram shown is a flowchart illustrating an archive log processing method disclosed in an embodiment of the present invention. The archive log processing method mainly includes the following steps:

[0057] Step S101: Collect the current database system level, the current archive space utilization rate, and the time of the most recent archive log backup.

[0058] In step S101, the system level information collection script script_systemlevel.sh is used to collect the database system level at the current moment; the archive space usage information collection script_lastarchtime.sh is used to collect the archive space usage rate at the current moment; and the archive backup information collection script_runarch.sh is used to collect the time of the most recent archive log backup.

[0059] The database system level is retrieved from the configuration database based on the hostname, and the retrieved database system level information is stored in a local file. The database system level is divided into three levels: Level 1 (A), Level 2 (B), and Level 3 (C), denoted as L. Level 1 represents important, Level 2 represents average, and Level 3 represents unimportant.

[0060] Retrieve the current archive space utilization rate from the database, denoted as P.

[0061] Retrieve the time point of the most recent archived log backup completion from the backup log, denoted as T0. Store the information of the most recent archived log backup completion time in a local file.

[0062] Backup logs are backups of inactive redo logs. By using archived logs, all redo history can be preserved. When the database is in ARCHIVELOG mode and undergoing log replacement, the background process ARCn saves the contents of the redo logs to the archived logs. In the event of a database media failure, the database can be fully recovered using data file backups, archived logs, and redo logs.

[0063] Within the first preset time period, the database system level is collected at the current moment based on the system level information collection script; within the second preset time period, the archive space usage rate is collected at the current moment based on the archive space usage collection script; within the third preset time period, the time of the most recent archive log backup is collected based on the archive backup status collection script.

[0064] The first preset time period can be once a day or twice a day. The specific determination of the first preset time period shall be set by the technical personnel according to the actual situation, and the present invention does not impose a specific limitation. In this solution, the first preset time period is preferably once a day.

[0065] The second preset time period can be executed once every 5 minutes or twice every 5 minutes. The specific determination of the second preset time period shall be set by the technicians according to the actual situation. This invention does not make specific limitations. In this solution, the second preset time period is preferably executed once every 5 minutes.

[0066] The third preset time period can be executed once per minute or once every two minutes. The specific determination of the third preset time period shall be set by the technicians according to the actual situation. This invention does not make specific limitations. In this solution, the preferred third preset time period is to execute once per minute.

[0067] Step S102: Determine whether the current database system level, the current archive space utilization rate, and the time of the most recent archive log backup meet the first preset condition. If yes, proceed to step S103; otherwise, proceed to step S105.

[0068] In step S102, the process of determining whether the current database system level, the current archive space utilization rate, and the time of the most recent archive log backup meet the first preset condition is implemented in the script_runarch.sh script.

[0069] If any of the following conditions are met, the first preset condition is determined to be met, and the archive backup task needs to be initiated:

[0070] If the current archive space utilization rate is greater than or equal to the preset utilization rate, and the difference between the current time and the time of the most recent archive log backup is less than or equal to the first preset time, then the first preset condition is met. That is, if P ≥ 30% and (T1-T0) ≤ 2 hours, the first preset condition is met, and the database backup task needs to be initiated.

[0071] The preset usage rate can be 30% or 35%. The specific preset usage rate is determined by the technicians according to the actual situation. This invention does not make a specific limitation. The preset usage rate in this solution is preferably 30%.

[0072] The first preset time can be 2 hours or 3 hours. The specific first preset time is determined by the technicians according to the actual situation. This invention does not make a specific limitation. The preferred first preset time in this solution is 2 hours.

[0073] or,

[0074] If the current archive space utilization rate is greater than or equal to the preset utilization rate, and the difference between the current time and the time of the most recent archive log backup is greater than the first preset time, then the first preset condition is met, and a database backup task needs to be initiated. That is, if P≥30% and (T1-T0)>2 hours, then the first preset condition is met, and a database backup task needs to be initiated.

[0075] or,

[0076] If the current archive space utilization rate is less than the preset utilization rate and greater than the second preset time, the first preset condition is met, and a database backup task needs to be initiated. That is, if P < 30% and (T1-T0) > 0.25 hours, the first preset condition is met, and a database backup task needs to be initiated.

[0077] The second preset time can be 0.25 hours or 0.3 hours. The specific second preset time is determined by the technicians according to the actual situation. This invention does not make specific limitations. The second preset time in this solution is preferably 0.25 hours.

[0078] Step S103: Determine the current time to initiate the database backup task.

[0079] Step S104: During the database backup task, if the current database system level meets the second preset condition, then perform the operation of increasing the number of backup channels and perform the archive log backup operation; or, during the database backup task, if the current database system level meets the third preset condition, then perform the operation of decreasing the number of archiver processes and perform the archive log backup operation.

[0080] In step S104, if the current database system level meets the second preset condition, the process of increasing the number of backup channels and performing archived log backup is as follows:

[0081] First, during the database backup task, the difference between the current time and the time of the most recent archive log backup is calculated. Then, if the ratio of the current archive space utilization rate to the difference is greater than or equal to the first preset value, and the current database system level is the first system level, the number of backup channels is increased according to the preset number of channels, and the archive log backup operation is executed.

[0082] If the current database system level is Level 1, i.e., L=A, then the number of backup channels will be increased to 8.

[0083] The default number of backup channels is 4.

[0084] If the current database system level meets the third preset condition, the process of reducing the number of archiver processes and performing archive log backup is as follows:

[0085] First, during the database backup task, the difference between the current time and the time of the most recent archive log backup is calculated. Then, if the ratio of the current archive space utilization rate to the difference is greater than or equal to the first preset value, and the current database system level is the third system level, the number of archiver processes is reduced according to the preset number of processes.

[0086] If the current database system level is Level 3 (L=C), then the number of archiver processes is reduced according to the preset number of processes (2). That is, the database parameter log_archive_max_processes is set to 2 online.

[0087] The default number of archiver processes is 4.

[0088] If the database system level at the current moment meets the third preset condition, then reduce the number of archiver processes, perform archive log backup operations, and restore the number of backup channels based on the first preset restore number.

[0089] The number of backup channels was restored to 4.

[0090] If the database system level at the current moment meets the third preset condition, then the number of archiver processes is reduced, and after performing archive log backup operations, the number of archiver processes is restored based on the second preset restore number.

[0091] The number of restore archiver processes is set to 4, that is, the database parameter log_archive_max_processes is set to 2.

[0092] Optionally, if P ≥ 30% and (T1-T0) > 2 hours, no configuration changes are made; that is, the number of backup channels and the number of archiver processes are the default values.

[0093] Optionally, if 0.3 > P / (T1-T0) ≥ 0.15, no configuration changes are made; that is, the number of backup channels and the number of archiver processes are the default values.

[0094] Step S105: Do not execute the database backup task.

[0095] In this embodiment of the invention, when initiating a database backup task, the number of backup channels is increased or the number of archive processes is decreased based on the importance of the database system. This slows down the generation of archive logs, ensuring that archive logs are backed up to the tape library in a timely manner during peak archive log generation periods. This frees up archive space in the database and avoids the risk of prolonged database unresponsiveness due to full archive space. Furthermore, timely backup of archive logs to the tape library during peak archive log generation periods eliminates the need for frequent backup operations, preventing them from impacting the performance of database operations and thus improving the efficiency of data service execution.

[0096] like Figure 2 As shown, step S101 above involves collecting the current database system level, the current archive space utilization rate, and the time of the most recent archive log backup. It mainly includes the following steps:

[0097] Step S201: Within the first preset time period, based on the system level information collection script, collect the database system level at the current moment. The database system level includes the first system level, the second system level, and the third system level.

[0098] Step S202: Within the second preset time period, collect the current archive space usage rate based on the archive space usage collection script.

[0099] Step S203: Within the third preset time period, collect the time of the most recent archived log backup based on the archived backup status collection script.

[0100] The execution principle of steps S201-S203 is the same as that of step S101 above, and can be referred to accordingly. It will not be repeated here.

[0101] In this embodiment of the invention, within a first preset time period, the database system level at the current moment is collected based on the system level information collection script; within a second preset time period, the archive space usage rate at the current moment is collected based on the archive space usage collection script; and within a third preset time period, the time of the most recent archive log backup is collected based on the archive backup status collection script. This achieves the purpose of obtaining the database system level at the current moment, the archive space usage rate at the current moment, and the time of the most recent archive log backup.

[0102] like Figure 3 As shown, step S104 above involves the process of increasing the number of backup channels and performing archive log backup if the current database system level meets the second preset condition during the database backup task. This mainly includes the following steps:

[0103] Step S301: During the database backup task, calculate the difference between the current time and the time of the most recent archived log backup.

[0104] Step S302: If the ratio of the current archive space utilization rate to the difference is greater than or equal to the first preset value, and the current database system level is the first system level, increase the number of backup channels according to the preset number of channels, and perform archive log backup operation.

[0105] The execution principle of steps S301-S302 is the same as that of step S104 above, and can be referred to. It will not be repeated here.

[0106] In this embodiment of the invention, during the database backup task, the number of backup channels is increased according to the importance level of the database system, thereby slowing down the generation speed of archive logs. This ensures that during peak periods of archive log generation, archive logs are backed up to the tape library in a timely manner, freeing up archive space and avoiding the risk of the database becoming unresponsive for a long time due to full archive space.

[0107] like Figure 4 As shown, step S104 above involves reducing the number of archiver processes and performing archive log backup if the current database system level meets the third preset condition. This mainly includes the following steps:

[0108] Step S401: During the database backup task, calculate the difference between the current time and the time of the most recent archived log backup.

[0109] Step S402: If the ratio of the current archive space utilization rate to the difference is greater than or equal to the first preset value, and the current database system level is the third system level, reduce the number of archiver processes according to the preset number of processes.

[0110] The execution principle of steps S401-S402 is the same as that of step S104 above, and can be referred to. It will not be repeated here.

[0111] In this embodiment of the invention, during the database backup task, the number of archive processes is reduced according to the importance of the database system, thereby slowing down the generation of archive logs. This ensures that during peak periods of archive log generation, archive logs are backed up to the tape library in a timely manner, freeing up archive space in the database and avoiding the risk of the database becoming unresponsive for a long time due to full archive space.

[0112] Based on the above embodiments Figure 1The present invention discloses an archived log processing method, and also discloses an archived log processing system, such as... Figure 5 As shown, the archived log processing system mainly includes a collection unit 501, a determination unit 502, and an execution unit 503.

[0113] The data collection unit 501 is used to collect the current database system level, the current archive space utilization rate, and the time of the most recent archive log backup.

[0114] The determination unit 502 is used to determine the time to initiate the database backup task if the current database system level, the current archive space utilization rate, and the time of the most recent archive log backup meet the first preset conditions.

[0115] The execution unit 503 is used to, during the process of running a database backup task, perform an operation to increase the number of backup channels and perform an archive log backup operation if the current database system level meets the second preset condition; or, during the process of running a database backup task, perform an operation to decrease the number of archiver processes and perform an archive log backup operation if the current database system level meets the third preset condition.

[0116] Furthermore, the acquisition unit 501 includes a first acquisition module, a second acquisition module, and a third acquisition module.

[0117] The first acquisition module is used to acquire the database system level at the current moment based on the system level information acquisition script within a first preset time period. The database system level includes a first system level, a second system level, and a third system level.

[0118] The second acquisition module is used to acquire the current archive space usage rate based on the archive space usage acquisition script within the second preset time period.

[0119] The third acquisition module is used to acquire the time of the most recent archived log backup based on the archived backup status acquisition script within the third preset time period.

[0120] Furthermore, the determining unit 502 includes a first determining module.

[0121] The first determining module is used to determine to initiate a database backup task when the current archive space utilization rate is greater than or equal to the preset utilization rate and the difference between the current time and the time of the most recent archive log backup is less than or equal to the first preset time.

[0122] Alternatively, the determining unit 502 may include a second determining module.

[0123] The second determining module is used to determine to initiate a database backup task when the current archive space utilization rate is greater than or equal to the preset utilization rate, and the difference between the current time and the time of the most recent archive log backup is greater than the first preset time.

[0124] Alternatively, the determining unit 502 may include a third determining module.

[0125] The third determination module is used to determine when the current archive space utilization rate is less than the preset utilization rate and greater than the second preset time, and to determine when to initiate the database backup task.

[0126] Furthermore, the execution unit 503 includes a first calculation module and a first execution module.

[0127] The first calculation module is used to calculate the difference between the current time and the time of the most recent archived log backup during the execution of a database backup task.

[0128] The first execution module is used to increase the number of backup channels and perform archive log backup operations if the ratio of the current archive space utilization rate to the difference is greater than or equal to the first preset value and the current database system level is the first system level.

[0129] Alternatively, the execution unit 503 may include a second calculation module and a second execution module.

[0130] The second calculation module is used to calculate the difference between the current time and the time of the most recent archived log backup during the database backup task.

[0131] The second execution module is used to reduce the number of archiver processes based on the preset number of processes if the ratio of the current archive space utilization rate to the difference is greater than or equal to the first preset value and the current database system level is the third system level.

[0132] Furthermore, it also includes a first restoration unit.

[0133] The first restoration unit is used to restore the number of backed-up channels based on a first preset restoration number.

[0134] Furthermore, it also includes a second reduction unit.

[0135] The second restoration unit is used to restore the number of archiver processes based on the second preset restoration number.

[0136] In this embodiment of the invention, when initiating a database backup task, the number of backup channels is increased or the number of archive processes is decreased based on the importance of the database system. This slows down the generation of archive logs, ensuring that archive logs are backed up to the tape library in a timely manner during peak archive log generation periods. This frees up archive space in the database and avoids the risk of prolonged database unresponsiveness due to full archive space. Furthermore, timely backup of archive logs to the tape library during peak archive log generation periods eliminates the need for frequent backup operations, preventing them from impacting the performance of database operations and thus improving the efficiency of data service execution.

[0137] For the foregoing method embodiments, in order to simplify the description, they are all described as a series of actions. However, those skilled in the art should understand that the present invention is not limited to the described order of actions, because according to the present invention, some steps can be performed in other orders or simultaneously. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions and modules involved are not necessarily essential to the present invention.

[0138] It should be noted that the various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For system-type embodiments, since they are basically similar to method embodiments, the description is relatively simple; relevant parts can be referred to the descriptions in the method embodiments.

[0139] The steps in the methods of various embodiments of the present invention can be adjusted, combined, or deleted according to actual needs.

[0140] Finally, it should be noted that in this paper, relational terms such as first and second are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations.

[0141] The above description of the disclosed embodiments enables those skilled in the art to make or use the invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the invention. Therefore, the invention is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

[0142] The above description is only a preferred embodiment of the present invention. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.

Claims

1. A method for processing archived logs, characterized in that, The method includes: The system collects the current database system level, the current archive space utilization rate, and the time of the most recent archive log backup; wherein, the archive space is the storage space in the database used to store archive logs. If the current database system level, the current archive space utilization rate, and the time of the most recent archive log backup meet the first preset conditions, it is determined that a database backup task will be initiated at the current time; wherein, the database system level is used to determine the number of backup channels or the number of archive processes; the database backup includes archive log backup; During the execution of the database backup task, if the database system level at the current moment meets the second preset condition, then the operation of increasing the number of backup channels is executed, and the archive log backup operation is executed; or, during the execution of the database backup task, if the database system level at the current moment meets the third preset condition, then the operation of decreasing the number of archiver processes is executed, and the archive log backup operation is executed. The data collection includes the current database system level, the current archive space utilization rate, and the time of the most recent archive log backup. Within a first preset time period, based on the system level information collection script, the database system level at the current moment is collected, and the database system level includes a first system level, a second system level, and a third system level; Within the second preset time period, the current archive space usage rate is collected based on the archive space usage collection script. Within the third preset time period, a script based on the archived backup status collects the time of the most recent archived log backup.

2. The method according to claim 1, characterized in that, If the current database system level, the current archive space utilization rate, and the time of the most recent archive log backup meet the first preset conditions, the step of initiating a database backup task includes: When the current archive space utilization rate is greater than or equal to the preset utilization rate, and the difference between the current time and the time of the most recent archive log backup is less than or equal to the first preset time, it is determined to initiate the database backup task. or, When the current archive space utilization rate is greater than or equal to the preset utilization rate, and the difference between the current time and the time of the most recent archive log backup is greater than the first preset time, it is determined to initiate a database backup task. or, When the current archive space utilization rate is less than the preset utilization rate and greater than the second preset time, it is determined to initiate a database backup task.

3. The method according to claim 1, characterized in that, During the execution of the database backup task, if the current database system level meets the second preset condition, then an operation to increase the number of backup channels is performed, and an archive log backup operation is performed, including: During the execution of the database backup task, the difference between the current time and the time of the most recent archived log backup is calculated; If the ratio of the current archive space utilization rate to the difference is greater than or equal to a first preset value, and the current database system level is the first system level, the number of backup channels is increased according to the preset number of channels, and the archive log backup operation is performed.

4. The method according to claim 1, characterized in that, During the execution of the database backup task, if the current database system level meets the third preset condition, then an operation to reduce the number of archiver processes is performed, and an archive log backup operation is performed, including: During the execution of the database backup task, the difference between the current time and the time of the most recent archived log backup is calculated; If the ratio of the current archive space utilization rate to the difference is greater than or equal to a first preset value, and the current database system level is the third system level, the number of archiver processes is reduced according to the preset number of processes.

5. The method according to claim 1, characterized in that, After stating that if the database system level at the current moment meets the second preset condition, the number of backup channels will be increased and the archived log backup operation will be performed, the method further includes: Based on the first preset restore number, the number of backed-up channels is restored.

6. The method according to claim 1, characterized in that, After the statement "If the database system level at the current moment meets the third preset condition, then reduce the number of archiver processes and perform archive log backup operation", the method further includes: The number of archiver processes is restored based on the second preset restore number.

7. An archived log processing system, characterized in that, The system includes: The data collection unit is used to collect the current database system level, the current archive space utilization rate, and the time of the most recent archive log backup; wherein, the archive space is the storage space in the database used to store archive logs; The determining unit is configured to determine whether to initiate a database backup task at the current time if the current database system level, the current archive space utilization rate, and the time of the most recent archive log backup meet a first preset condition; wherein, the database system level is used to determine the number of backup channels or the number of archive processes; the database backup includes archive log backup; The execution unit is configured to, during the execution of the database backup task, if the database system level at the current moment meets the second preset condition, perform an operation to increase the number of backup channels and perform an archive log backup operation; or, during the execution of the database backup task, if the database system level at the current moment meets the third preset condition, perform an operation to decrease the number of archiver processes and perform an archive log backup operation. The acquisition unit includes: The first acquisition module is used to acquire the database system level at the current moment based on the system level information acquisition script within a first preset time period. The database system level includes a first system level, a second system level, and a third system level. The second acquisition module is used to acquire the current archive space usage rate based on the archive space usage acquisition script within the second preset time period. The third acquisition module is used to acquire the time of the most recent archived log backup based on the archived backup status acquisition script within the third preset time period.

8. The system according to claim 7, characterized in that, The determining unit includes: The first determining module is used to determine to initiate a database backup task when the current archive space utilization rate is greater than or equal to a preset utilization rate, and the difference between the current time and the time of the most recent archive log backup is less than or equal to a first preset time. or, The second determining module is used to determine to initiate a database backup task when the current archive space utilization rate is greater than or equal to the preset utilization rate, and the difference between the current time and the time of the most recent archive log backup is greater than the first preset time. or, The third determining module is used to determine to initiate a database backup task when the current archive space utilization rate is less than the preset utilization rate and greater than the second preset time.

Citation Information

Patent Citations

  • Data table backup method and device based on Oracle database

    CN103870600A

  • Device and method for database backup

    CN105320576A

  • Method and device for increasing database archiving efficiency

    CN106250465A