Database offline method and device, electronic equipment and computer readable storage medium
By automating the identification and verification of the operational status of database combinations, the inefficiency and inaccuracy of database offline checks in existing technologies are solved, achieving an efficient and secure database offline process.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- NETSUNION CLEARING CORP
- Filing Date
- 2022-02-14
- Publication Date
- 2026-04-14
AI Technical Summary
In existing technologies, manual inspection methods for database shutdown suffer from high labor costs, low inspection efficiency, and low inspection accuracy. In particular, when shutting down a large number of databases, omissions or false detections are prone to occur, leading to application service interruptions.
An automated method is used to identify database combinations of multiple target databases. The running status information of the database combinations is automatically verified according to preset verification rules. The databases are then taken offline only after all verification items meet the offline conditions. This includes external application connection status, data update status, and dependent service status.
It improves the accuracy and efficiency of database offline checks, ensures the security of offline operations, and avoids application service interruptions caused by false detections or omissions.
Smart Images

Figure CN116627929B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular to database offline methods, apparatus, electronic devices, and computer-readable storage media. Background Technology
[0002] When performing software and hardware upgrades, maintenance, and troubleshooting on online database systems, frequent operations such as stopping, starting, restarting, and reloading the database are required. Performing these operations online severely impacts the operation of applications that rely on the database. Therefore, it is necessary to take the database offline for maintenance and updates. Before taking the database offline, database administrators must conduct relevant checks on its operation. Only after confirming that the database meets the conditions for offline operation will the necessary procedures be carried out, thereby ensuring the safe and stable operation of application services that rely on the online database.
[0003] In existing technologies, when dealing with the simultaneous shutdown of a large number of databases, the approach is to manually check the operational status of each database one by one. The database is shut down only if all verification items for each database meet the shutdown criteria. This method has many drawbacks. For example, because there are many verification items involved in database shutdown, manual checks can easily miss one or more verification items, leading to the shutdown of databases that do not meet the shutdown criteria, causing interruptions to applications that depend on these databases. Furthermore, there are scenarios where multiple databases reside on interconnected servers. A single database may not meet the shutdown criteria, but if all databases are treated as a whole, they may meet the criteria. In such cases, the existing method of checking each database individually is prone to false positives, resulting in inaccurate results and requiring re-checks. This leads to high manual costs and low efficiency.
[0004] It should be noted that the statements herein provide only background information relevant to this application and do not necessarily constitute prior art. Summary of the Invention
[0005] This application provides a database offline method, apparatus, electronic device, and computer-readable storage medium to overcome the shortcomings of existing technologies that use manual inspection methods when offline databases, such as high labor costs, low inspection efficiency, and low inspection accuracy.
[0006] The embodiments of this application adopt the following technical solutions:
[0007] Firstly, a method for taking a database offline is provided, executed by the database server, including:
[0008] Identify database combinations containing multiple target databases from the set of databases to be taken offline;
[0009] Based on the operational status information of each target database, determine the verification information for the database combination;
[0010] The verification result of the information to be verified is obtained according to the verification rules;
[0011] If the verification results meet the offline conditions, control each target database to go offline.
[0012] Optionally, in the above method, identifying database combinations containing multiple target databases from the set of databases to be taken offline includes:
[0013] Database combinations are identified from the database set based on target application attributes, wherein the application attributes of each target database that makes up the database combination all contain the target application attributes.
[0014] Optionally, in the above method, the verification information for the database combination is determined based on the running status information of each target database, including:
[0015] Based on the running status information, at least one of the following pieces of information is determined as the verification information for the database combination: external application connection status, data update status, and service status dependent on the database combination.
[0016] Optionally, in the above method, the verification result of the information to be verified obtained according to the verification rules includes:
[0017] If the external application connection status indicates that there is no uplink and / or downlink traffic to the database combination, the verification result of the external application connection status is determined to be passed.
[0018] Optionally, in the above method, the verification result of the information to be verified obtained according to the verification rules includes:
[0019] If the content and / or size of each data table in the database combination representing the data update status remain unchanged within a preset historical period, the verification result of the data update status is determined to be passed.
[0020] Optionally, in the above method, the verification result of the information to be verified obtained according to the verification rules includes:
[0021] If the data update status indicates that the service dependent on the database combination is a subset of the target service set, the verification result of the service dependent on the database combination is determined to be passed;
[0022] The services included in the target service cluster are: traffic request service between target databases, high availability service, application isolation service, data table backup service, automatic recovery service, and monitoring and alarm service.
[0023] Optionally, the above methods also include:
[0024] The steps of determining the information to be verified for the database combination based on the running status information of each target database, and obtaining the verification result of the information to be verified according to the verification rules, will be executed repeatedly in a preset cycle.
[0025] The verification result obtained from the verification rules for the information to be verified also includes:
[0026] The final verification result is determined by combining the results of multiple verifications.
[0027] If the verification results meet the offline conditions, controlling the offline status of each target database includes:
[0028] If the final verification result is satisfactory, all target databases will be taken offline.
[0029] Secondly, embodiments of this application also provide a database offline device applied to a database server, wherein the device is used to implement any of the methods described above.
[0030] Thirdly, embodiments of this application also provide an electronic device, including: a processor; and a memory arranged to store computer-executable instructions, which, when executed, cause the processor to perform any of the methods described above.
[0031] Fourthly, embodiments of this application also provide a computer-readable storage medium that stores one or more programs, which, when executed by an electronic device including multiple applications, cause the electronic device to perform any of the methods described above.
[0032] The above-described technical solutions adopted in the embodiments of this application can achieve the following beneficial effects:
[0033] This application provides an automated method for verifying database offline status. In this method, multiple databases with common characteristics to be offline are treated as a whole. Based on pre-established and complete verification rules, each verification item required for the overall offline status of the database combination is checked. On the one hand, this ensures that the check covers all verification items of the database combination, guaranteeing a safe and risk-free offline operation. On the other hand, by abstracting multiple target databases into a single database combination for checking, the verification items that are interdependent between the multiple target databases are masked, allowing the database combination that meets the offline status conditions to be successfully offline, ensuring the accuracy of the check results and improving check efficiency. Attached Figure Description
[0034] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings:
[0035] Figure 1 This is a schematic flowchart of a database offline method according to an embodiment of this application;
[0036] Figure 2 This is a schematic flowchart of a database offline method according to another embodiment of this application;
[0037] Figure 3 This is a schematic flowchart of a database decommissioning device according to an embodiment of this application;
[0038] Figure 4 This is a schematic diagram of the structure of an electronic device according to an embodiment of this application. Detailed Implementation
[0039] To make the objectives, technical solutions, and advantages of this application clearer, the technical solutions of this application will be clearly and completely described below in conjunction with specific embodiments and corresponding drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0040] The technical solutions provided by the various embodiments of this application are described in detail below with reference to the accompanying drawings.
[0041] The concept behind this application is that databases are increasingly widely used, and many application services rely on them. Scenarios frequently arise involving machine failures, maintenance, and hardware / software replacements and upgrades. To ensure the safe shutdown of databases, various indicators of the database services need to be checked before formal shutdown. Current technology involves manually checking each verification item of each database using different methods. Because databases involve numerous verification items, manual checks are prone to missing one or more items. Furthermore, improper checking methods can prevent databases that actually meet the shutdown criteria from being shut down in a timely manner.
[0042] In view of this, this application provides a database offline method to overcome the shortcomings of the prior art. Figure 1 This is a flowchart illustrating a database offline method according to an embodiment of this application. The method can be executed by a database server. Figure 1 It can be seen that the database offline method of this application includes at least steps S110 to S140:
[0043] Step S110: Identify database combinations containing multiple target databases from the database set to be taken offline.
[0044] Data stored in different databases often have relationships such as association and dependency. When performing maintenance or upgrade operations on a database, it is necessary to perform corresponding operations on multiple databases that have mutual relationships or associations. In this case, it is necessary to take all the databases involved offline in order to perform maintenance or upgrades.
[0045] First, from the set of databases to be taken offline, multiple target databases with common characteristics are identified. These target databases form a database combination, which can be considered as a complete database set. In this application, the check on whether a database can be taken offline is performed on the database combination formed by multiple target databases.
[0046] Regarding the identification of target databases, it can be determined based on the operational task, but is not limited to that of the common properties of target databases. Databases that share these common properties are considered target databases.
[0047] Step S120: Determine the verification information of the database combination based on the running status information of each target database.
[0048] After identifying multiple target databases, the running status information of each target database is obtained, such as whether the database is running, the number of database connections, the memory usage of the database process, the size of each data table in the database, etc. Based on these information, the verification information to be verified for the database combination is determined. That is, the verification information to be verified is different depending on the running status of the target databases and whether the database combination composed of the target databases can be taken offline.
[0049] If two target databases, database A and database B, are identified, their operational status information is obtained separately. This information is then aggregated, and the aggregated result constitutes the verification information required when the database combination is taken offline. During the aggregation process, operational status information exchanged between databases A and B, such as mutual access and traffic between them, can be ignored.
[0050] Step S130: Obtain the verification result of the information to be verified according to the verification rules.
[0051] According to the preset verification rules, each verification item in the information to be verified of the obtained database combination is verified. If a verification item meets the verification rules, the verification result of the verification item is determined to be passed.
[0052] For example, one of the validation items in a database combination is the update status within a preset historical period. The validation rule is that if there is an update, the validation result is "fail"; if there is no update, the validation result is "pass".
[0053] It should be noted that the number of verification items included in the verification rules may be greater than the number of verification items in the database combination's information to be verified. In this case, during verification, the verification result of verification items not included in the database combination's information to be verified can be assumed to be passed.
[0054] Step S140: If the verification results meet the offline conditions, control each target database to go offline.
[0055] As mentioned above, if the verification results of each verification item in the database combination's verification information are all passed, then the verification results meet the offline conditions, and further, each target database is taken offline.
[0056] from Figure 1 As can be seen from the method shown, this application provides an automated database offline verification method. In this application, multiple databases with common characteristics to be offline are regarded as a whole, and each verification item that needs to be verified when the database combination is taken offline is checked according to a pre-formed complete verification rule. On the one hand, the check covers all verification items of the database combination, ensuring that the offline operation is safe and risk-free. On the other hand, by abstracting multiple target databases into a database combination for checking, the verification items that are interdependent between multiple target databases are shielded, so that the database combination that meets the offline conditions can be successfully taken offline, ensuring the accuracy of the check results and improving the check efficiency.
[0057] In some embodiments of this application, in the above method, identifying a database combination containing multiple target databases from the database set to be taken offline includes: identifying the database combination from the database set according to the target application attributes, wherein the application attributes of each target database constituting the database combination all include the target application attributes.
[0058] In other words, a common property of multiple target databases can be one of their application attributes. For example, if the task is to upgrade a database from version 2.0 to version 3.0, then the target application attribute can be set to version 2.0. When identifying database combinations, the version can be found from the application attributes of each database. If a database's version is 2.0, then that database is listed as a target database. The resulting multiple target databases form a database combination. The application attributes of each database can be obtained when the database server reads the information of each database.
[0059] In some embodiments of this application, in the above method, determining the information to be verified for the database combination based on the running status information of each target database includes: determining at least one of the following information as the information to be verified for the database combination based on the running status information: external application connection status, data update status, and service status dependent on the database combination.
[0060] The operational status information of each target database is integrated to determine which one or more items to be verified are included in the information to be verified for the database combination. The items to be verified include at least one of the following: external application connection status, data update status, and service status dependent on the database combination. The operational status information of each database can be obtained when the database server reads the information of each database.
[0061] If there are two target databases, namely database A and database B, and both database A and database B are in a non-running state, then when verifying whether the entire database combination meets the offline conditions, the external application connection status does not need to be verified. In this case, the information to be verified for the database combination is the data update status and the service status that depends on the database combination.
[0062] Furthermore, when the database combination contains multiple verification items, each verification item can be verified simultaneously or one by one. This application does not impose any restrictions. When verifying each verification item simultaneously, multiple threads can be used, and the threads do not affect each other.
[0063] In some embodiments of this application, in the above method, obtaining the verification result of the information to be verified according to the verification rules includes: determining that the verification result of the external application connection status is passed when the external application connection status indicates that there is no uplink and / or downlink traffic in the database combination.
[0064] External application connectivity can characterize whether there is uplink and / or downlink traffic to the database combination. Specifically, the external application and the database combination are connected. If a running external application is accessing the database combination, there will be data interaction between the external application and the database combination, that is, there is uplink and / or downlink traffic between them. Therefore, by monitoring the traffic of the database combination, it can be determined whether the database combination is connected to an external application.
[0065] Specifically, if there is upstream and / or downstream traffic to the database combination, it indicates that an external application is accessing or relying on the database combination to run. If the database combination is taken offline directly, the external application will become unavailable. In this case, the verification result for the external application connection status will fail.
[0066] If there is no uplink and / or downlink traffic in the database group, it means that the database group is not connected to the external application, and the verification result of the external application connection status can be determined to be passed.
[0067] In some embodiments of this application, in the above method, obtaining the verification result of the information to be verified according to the verification rules includes: if the content and / or size of each data table representing the database combination of the data update situation has not changed within a preset historical time, determining that the verification result of the data update situation is passed.
[0068] Data update status indicates that the content and / or size of each data table in the database combination has not changed within a preset historical period. Specifically, a large amount of data is stored in the database combination, specifically in each data table of each target database in the database combination. If data in the database combination has been updated recently, it means that the database combination is still being read and written by application business, and therefore cannot be directly taken offline.
[0069] The validity of a database combination can be determined by examining whether the content and / or size of each table within a preset historical timeframe (which can be from 10 minutes to 24 hours) changes. Specifically, if the content and / or size of each table in the database combination changes, it indicates that the database combination is still being read and written by the application, and the data update verification result is considered passed; otherwise, the data update verification result is considered failed.
[0070] In some embodiments of this application, in the above method, obtaining the verification result of the information to be verified according to the verification rules includes: when it is determined that the service of the dependent database combination is a subset of the target service set, the verification result of the service of the dependent database combination is determined to be passed; wherein, the services in the target service set include: traffic request service between target databases, high availability service, application isolation service, data table backup service, automatic recovery service and monitoring and alarm service.
[0071] When a database portfolio is taken offline, external services that depend on it will experience anomalies. However, the operation of internal services between the target databases that make up the portfolio will not be affected. Therefore, if a running service is detected to be an internal service between the target databases, the entire database portfolio can be taken offline. These internal services are the target service set, which includes, but is not limited to: traffic request services between target databases, high availability services, application isolation services, data table backup services, automatic recovery services, and monitoring and alarm services, etc.
[0072] That is, if the detected running service is one or more of the above services, the verification result of the service situation dependent on the database combination is determined to be passed; if one of the detected running services does not belong to the above target service set, the verification result of the service situation dependent on the database combination is determined to be failed.
[0073] In some embodiments of this application, in order to improve detection accuracy, the above method further includes: repeatedly executing the steps of determining the information to be verified of the database combination based on the running status information of each target database, and obtaining the verification result of the information to be verified according to the verification rules, in a preset cycle; jointly determining the final verification result based on the multiple verification results; and controlling each target database to go offline if the final verification result is passed.
[0074] To improve detection accuracy, in some embodiments of this application, certain steps may be executed repeatedly several times, and the results of the multiple tests may be combined to determine the final verification result. Based on the final verification result, it may be determined whether the database combination can be taken offline.
[0075] Taking a target database as a single database, denoted as database A, and the obtained operating status information as the uplink and / or downlink traffic of each target database as an example, at the beginning of the first preset period, the first operating status information of database A is obtained. Based on the first status information, the information to be verified for the database combination is determined, including the external application connection status. If the first status information shows that database A has no uplink and / or downlink traffic, then the first verification result is determined to be a failure according to the verification rules. Since the uplink and / or downlink traffic is constantly changing, if the first verification result is directly used as the final verification result, false detection may occur.
[0076] To improve detection accuracy, the above steps can be repeated according to a preset cycle. Specifically, at the end of the first preset cycle, which is the beginning of the second preset cycle, the second running status information of database A is obtained. Based on the second status information, the information to be verified for the database combination is determined, including the external application connection status. If the second status information shows that database A has uplink and / or downlink traffic, then the second verification result is determined to be passed according to the verification rules.
[0077] At the end of the second preset period, which is the beginning of the third preset period, the third running status information of database A is obtained. Based on the third status information, the information to be verified for the database combination is determined, including the external application connection status. If the third status information shows that database A has uplink and / or downlink traffic, the third verification result is determined to be passed according to the verification rules.
[0078] Finally, the first, second, and third verification results are combined to determine the final verification result. In this embodiment, the majority rule can be used to determine the result, meaning the final result is "pass". If a test fails in one round, it may be because the external application temporarily interrupted access to the database combination and then quickly resumed access. If the database combination is taken offline directly based on the first round of test results, it would cause an interruption of the external application services that depend on the database combination.
[0079] This application does not limit the method of determining the final result by combining multiple verification results. For example, the majority rule method given in this embodiment can also be used. If the verification results are consistent within the most recent preset number of times, then the verification result is taken as the final verification result.
[0080] Figure 2 This is a flowchart illustrating a database offline method according to another embodiment of this application. As can be seen from the figure, this embodiment includes the following steps:
[0081] Obtain the application attributes of each database in the database collection, identify target database A and target database B from the databases whose application attributes include the target application attributes, and target database A and target database B form database combination C.
[0082] Obtain the running status of target database A and target database B respectively, including but not limited to: running status, number of database access connections, and uplink and / or downlink traffic volume.
[0083] Based on the operational status information of target database A and target database B, the information to be verified for the database combination includes: external application connection status, data update status, and service status of dependent data combination.
[0084] Check whether the uplink and / or downlink traffic of database A and database B is zero. If both are zero, the external application connection verification result is passed. If one of them is not zero, the external application connection verification result is failed, and database combination C cannot be taken offline.
[0085] Determine whether the content and / or size of each data table in database A and database B have changed within a preset historical time period. If neither has changed, the data update verification result is determined to be passed; if one of them has changed, the data update verification result is determined to be failed, and database combination C cannot be taken offline.
[0086] Determine whether the service currently running in database combination C belongs to the target service set. If it does, the verification result of the service status dependent on the database combination is passed; otherwise, database combination C cannot be taken offline.
[0087] Based on the above judgment results, if the verification results for external application connection status, data update status, and dependent data combination services pass, the database will be taken offline.
[0088] Figure 3 This is a schematic diagram of a database offline device according to an embodiment of this application. The database offline device 300 can be applied to a database server. Figure 3 It can be seen that the database offline device 300 includes:
[0089] The identification unit 310 is used to identify a database combination containing multiple target databases from the database set to be taken offline.
[0090] Data stored in different databases often have relationships such as association and dependency. When performing maintenance or upgrade operations on a database, it is necessary to perform corresponding operations on multiple databases that have mutual relationships or associations. In this case, it is necessary to take all the databases involved offline in order to perform maintenance or upgrades.
[0091] First, from the set of databases to be taken offline, multiple target databases with common characteristics are identified. These target databases form a database combination, which can be considered as a complete database set. In this application, the check on whether a database can be taken offline is performed on the database combination formed by multiple target databases.
[0092] Regarding the identification of target databases, it can be determined based on the operational task, but is not limited to that of the common properties of target databases. Databases that share these common properties are considered target databases.
[0093] The verification information determination unit 320 is used to determine the verification information of the database combination based on the running status information of each target database.
[0094] After identifying multiple target databases, the running status information of each target database is obtained, such as whether the database is running, the number of database connections, the memory usage of the database process, the size of each data table in the database, etc. Based on these information, the verification information to be verified for the database combination is determined. That is, the verification information to be verified is different depending on the running status of the target databases and whether the database combination composed of the target databases can be taken offline.
[0095] If two target databases, database A and database B, are identified, their operational status information is obtained separately. This information is then aggregated, and the aggregated result constitutes the verification information required when the database combination is taken offline. During the aggregation process, operational status information exchanged between databases A and B, such as mutual access and traffic between them, can be ignored.
[0096] The verification unit 330 is used to obtain the verification result of the information to be verified according to the verification rules.
[0097] According to the preset verification rules, each verification item in the information to be verified of the obtained database combination is verified. If a verification item meets the verification rules, the verification result of the verification item is determined to be passed.
[0098] For example, one of the validation items in a database combination is the update status within a preset historical period. The validation rule is that if there is an update, the validation result is "fail"; if there is no update, the validation result is "pass".
[0099] It should be noted that the number of verification items included in the verification rules may be greater than the number of verification items in the database combination's information to be verified. In this case, during verification, the verification result of verification items not included in the database combination's information to be verified can be assumed to be passed.
[0100] The control unit 340 is used to control each target database to go offline when the verification results meet the offline conditions.
[0101] As mentioned above, if the verification results of each verification item in the database combination's verification information are all passed, then the verification results meet the offline conditions, and further, each target database is taken offline.
[0102] from Figure 3 As shown in the diagram, this application provides an automated database offline verification device. In this application, multiple databases with common characteristics to be offline are treated as a whole, and each verification item required for the overall offline verification of the database combination is checked according to pre-formed complete verification rules. On the one hand, this ensures that the check covers all verification items of the database combination, guaranteeing a safe and risk-free offline operation. On the other hand, by abstracting multiple target databases into a database combination for checking, the verification items that are interdependent between multiple target databases are masked, allowing the database combination that meets the offline conditions to be successfully offline, ensuring the accuracy of the check results and improving check efficiency.
[0103] In some embodiments of this application, in the above-described apparatus, the identification unit 310 is used to identify a database combination from a database set based on target application attributes, wherein the application attributes of each target database constituting the database combination all include target application attributes.
[0104] In some embodiments of this application, in the above-described apparatus, the verification information determination unit 320 is used to determine at least one of the following information as verification information of the database combination based on the operating status information: external application connection status, data update status, and service status dependent on the database combination.
[0105] In some embodiments of this application, in the above-described apparatus, the verification unit 330 is used to determine that the verification result of the external application connection status is passed when there is no uplink and / or downlink traffic in the external application connection status characterization database combination.
[0106] In some embodiments of this application, in the above-described apparatus, the verification unit 330 is used to determine that the verification result of the data update status is passed if the content and / or size of each data table representing the database combination has not changed within a preset historical time period.
[0107] In some embodiments of this application, in the above-described apparatus, the verification unit 330 is used to determine that the verification result of the service status of the dependent database combination is passed when the service status of the dependent database combination indicates that the service of the dependent database combination is a subset of the target service set; wherein, the services in the target service set include: traffic request service between target databases, high availability service, application isolation service, data table backup service, automatic recovery service, and monitoring and alarm service.
[0108] In some embodiments of this application, the above-mentioned device further includes: a loop control unit, used to control the steps of determining the information to be verified of the database combination based on the running status information of each target database, and obtaining the verification result of the information to be verified according to the verification rules to be verified multiple times in a preset period; a verification unit 330, used to jointly determine the final verification result based on the multiple verification results; and a control unit 340, used to control each target database to go offline when the final verification result is passed.
[0109] It is understood that the above-mentioned database offline device can implement each step of the database offline method provided in the foregoing embodiments. The relevant explanations of the database offline method are applicable to the database offline device, and will not be repeated here.
[0110] Figure 4 This is a schematic diagram of the structure of an electronic device according to an embodiment of this application. Please refer to it. Figure 4At the hardware level, the electronic device includes a processor, and optionally also includes an internal bus, a network interface, and memory. The memory may include main memory, such as high-speed random-access memory (RAM), or non-volatile memory, such as at least one disk drive. Of course, the electronic device may also include other hardware required for other business operations.
[0111] The processor, network interface, and memory can be interconnected via an internal bus, which can be an ISA (Industry Standard Architecture) bus, a PCI (Peripheral Component Interconnect) bus, or an EISA (Extended Industry Standard Architecture) bus, etc. This bus can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 4 The symbol is represented by a single double-headed arrow, but this does not mean that there is only one bus or one type of bus.
[0112] Memory is used to store programs. Specifically, programs may include program code, which includes computer operation instructions. Memory may include main memory and non-volatile memory, and provides instructions and data to the processor.
[0113] The processor reads the corresponding computer program from non-volatile memory into main memory and then runs it, forming a database offline device at the logical level. The processor executes the program stored in memory and specifically performs the following operations:
[0114] Identify database combinations containing multiple target databases from the set of databases to be taken offline;
[0115] Based on the operational status information of each target database, determine the verification information for the database combination;
[0116] The verification result of the information to be verified is obtained according to the verification rules;
[0117] If the verification results meet the offline conditions, then each target database will be taken offline.
[0118] The above is as stated in this application. Figure 3The method executed by the database offline device disclosed in the illustrated embodiment can be applied to a processor or implemented by a processor. The processor may be an integrated circuit chip with signal processing capabilities. During implementation, each step of the above method can be completed by integrated logic circuits in the processor's hardware or by instructions in software form. The processor can be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc.; it can also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in the embodiments of this application can be directly embodied in the execution of a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor. The software module can reside in a mature storage medium in the field, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, or registers. This storage medium is located in memory, and the processor reads information from the memory and, in conjunction with its hardware, completes the steps of the above method.
[0119] The electronic device can also perform Figure 3 The method for executing the database offline device, and the implementation of the database offline device in... Figure 3 The functions of the embodiments shown are not described in detail here.
[0120] This application also proposes a computer-readable storage medium that stores one or more programs, the programs including instructions that, when executed by an electronic device including multiple applications, enable the electronic device to perform... Figure 3 The method executed by the database offline device in the illustrated embodiment is specifically used to perform the following:
[0121] Identify database combinations containing multiple target databases from the set of databases to be taken offline;
[0122] Based on the operational status information of each target database, determine the verification information for the database combination;
[0123] The verification result of the information to be verified is obtained according to the verification rules;
[0124] If the verification results meet the offline conditions, then each target database will be taken offline.
[0125] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0126] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0127] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0128] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0129] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0130] Memory may include non-persistent storage in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.
[0131] Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can store information using any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.
[0132] It should also be noted that 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.
[0133] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0134] The above description is merely an embodiment of this application and is not intended to limit the scope of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of the claims of this application.
Claims
1. A method for taking a database offline, executed by a database server, wherein, The method includes: Identify database combinations containing multiple target databases from the set of databases to be taken offline; Based on the operational status information of each target database, determine the verification information of the database combination; The verification result of the information to be verified is obtained according to the verification rules; If the verification results meet the offline conditions, control each target database to go offline; The multiple target databases in the database combination share common properties determined based on the operational tasks; The process of identifying database combinations containing multiple target databases from the set of databases to be taken offline includes: A database combination is identified from the database set based on the target application attributes, wherein the application attributes of each target database that makes up the database combination all include the target application attributes; The operating status information of the target databases is different, and the verification information required to check whether the database combination composed of the target databases can be taken offline is also different. The method further includes: The steps of determining the information to be verified of the database combination based on the running status information of each target database, and obtaining the verification result of the information to be verified according to the verification rules, are executed repeatedly in a preset cycle. The verification result obtained from the verification rules for the information to be verified also includes: The final verification result is determined by combining the results of multiple verifications. The step of controlling the offline status of each target database when the verification result meets the offline conditions includes: If the final verification result is satisfactory, all target databases will be taken offline.
2. The method according to claim 1, wherein, The step of determining the verification information for the database combination based on the operational status information of each target database includes: Based on the operational status information, at least one of the following pieces of information is determined as the verification information for the database combination: external application connection status, data update status, and service status dependent on the database combination.
3. The method according to claim 2, wherein, The verification result obtained from the verification rules for the information to be verified includes: If the external application connection status indicates that there is no uplink and / or downlink traffic to the database combination, the verification result of the external application connection status is determined to be passed.
4. The method according to claim 2, wherein, The verification result obtained from the verification rules for the information to be verified includes: If the content and / or size of each data table in the database combination, which represents the data update status, has not changed within a preset historical period, the verification result of the data update status is determined to be passed.
5. The method according to claim 2, wherein, The verification result obtained from the verification rules for the information to be verified includes: If the service status of the dependent database combination indicates that the service of the dependent database combination is a subset of the target service set, then the verification result of the service status of the dependent database combination is determined to be passed. The services in the target service set include: traffic request service between target databases, high availability service, application isolation service, data table backup service, automatic recovery service, and monitoring and alarm service.
6. A database shutdown device, applied to a database server, wherein, The device includes: The identification unit is used to identify a database combination containing multiple target databases from the set of databases to be taken offline; The verification information determination unit is used to determine the verification information of the database combination based on the running status information of each target database. The verification unit is used to obtain the verification result of the information to be verified according to the verification rules. The control unit is used to take each target database offline when the verification results meet the offline conditions; The multiple target databases in the database combination share common properties determined based on the operational tasks; The identification unit is specifically used for: A database combination is identified from the database set based on the target application attributes, wherein the application attributes of each target database that makes up the database combination all include the target application attributes; The operating status information of the target databases is different, and the verification information required to check whether the database combination composed of the target databases can be taken offline is also different. The device further includes: The loop control unit is used to repeatedly execute the steps of determining the information to be verified of the database combination based on the running status information of each target database, and obtaining the verification result of the information to be verified according to the verification rules, in a preset cycle. The verification unit is specifically used for: The final verification result is determined by combining the results of multiple verifications. The control unit is specifically used for: If the final verification result is satisfactory, all target databases will be taken offline.
7. An electronic device, comprising: processor; as well as A memory configured to store computer-executable instructions, which, when executed, cause the processor to perform the method according to any one of claims 1 to 5.
8. A computer-readable storage medium storing one or more programs, which, when executed by an electronic device including a plurality of applications, cause the electronic device to perform the method of any one of claims 1 to 5.
Citation Information
Patent Citations
Method and device for monitoring state of database
CN105426544A