Recycle bin cleaning method, system, device, processor and electronic device
By using a detection server to perform memory checks and automated cleanup of the Oracle database recycle bin, the problem of high manpower costs was solved, data cleanup efficiency was improved, and risks were reduced.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- INDUSTRIAL AND COMMERCIAL BANK OF CHINA
- Filing Date
- 2023-06-07
- Publication Date
- 2026-06-16
AI Technical Summary
Existing technologies for cleaning up data in Oracle database recycle bins involve significant manpower costs and pose risks of data leakage and server failure.
The detection server performs memory checks on the database recycle bins of M production servers to determine whether the total memory capacity exceeds a preset threshold, filters out candidate servers, and sends cleanup commands to the target servers to perform data cleanup operations.
It improves data cleaning efficiency, saves labor costs, and reduces the risk of data leaks and server failures.
Smart Images

Figure CN116775627B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of financial technology, and more specifically, to a method, system, apparatus, processor, and electronic device for cleaning up a recycling bin. Background Technology
[0002] As a relational data management system centered on a distributed database, Oracle databases are widely used in various production servers due to their ease of use and powerful functionality. One of Oracle's major innovations is its database recycle bin. As a data dictionary table, the Oracle database recycle bin can temporarily store data such as tables, indexes, and triggers deleted from the server's database, allowing users to restore them when needed.
[0003] However, since the data stored in the recycle bin still occupies the database's memory space, when the recycle bin occupies too much memory, it will cause the database to malfunction due to insufficient memory space, which will lead to server failure. In addition, due to the low level of network security measures for the recycle bin, if sensitive information or data is stored in the recycle bin, it is very easy for external attacks to maliciously access it, resulting in data leakage. Therefore, it is necessary to clean up the data in the recycle bin regularly.
[0004] In related technologies, the database recycle bin cleanup task is a very important database maintenance task. It usually requires maintenance personnel to perform regular checks. When the database is found to need data cleanup, it is handled manually. For large data centers, this will consume a lot of manpower and there is also the possibility of missing a database recycle bin from being cleaned.
[0005] There is currently no effective solution to the problem of high manpower costs in cleaning up database recycle bins in related technologies. Summary of the Invention
[0006] The main objective of this application is to provide a method, system, apparatus, processor, and electronic device for cleaning up a recycle bin, in order to solve the problem of high manpower costs in related technologies when cleaning up data in a database recycle bin.
[0007] To achieve the above objectives, according to one aspect of this application, a method for cleaning up a recycle bin is provided. The method includes: performing memory detection on the database recycle bins associated with M production servers to obtain the total memory capacity of the M database recycle bins, and determining whether the total memory capacity of each database recycle bin is greater than a preset memory threshold, where M is a positive integer; selecting servers from the M production servers whose total database recycle bin memory capacity is greater than the preset memory threshold, obtaining N candidate servers, where N is a positive integer and N is less than or equal to M; determining whether the memory capacity of the data to be cleaned in the database recycle bin of each candidate server is within a preset memory range, where the preset memory range is the range of the memory capacity of the data to be cleaned; selecting servers from the N candidate servers whose memory capacity of the data to be cleaned is within the preset memory range, obtaining Z target servers, and sending cleanup instructions to the Z target servers, where Z is a positive integer and Z is less than or equal to N; the target servers respond to the cleanup instructions and perform cleanup operations on the data to be cleaned.
[0008] Optionally, before performing memory detection on the database recycle bins associated with the M production servers, the method further includes: obtaining the first port information of the detection server and the second port information of the M production servers; identifying the first port information to obtain the first port associated with the detection server; and identifying the second port information to obtain the second port associated with the M production servers; opening the first firewall associated with the first port and the second firewall associated with the second port; and establishing a communication connection between the detection server and the M production servers through the first firewall and the second firewall.
[0009] Optionally, performing memory detection on the database recycle bins associated with the M production servers to obtain the total memory capacity of the M database recycle bins includes: sending memory query commands to the M production servers respectively, and receiving the total memory capacity of the database recycle bins returned by each production server. The memory query command is generated by the detection server and is used to query the total memory capacity occupied by the data in the recycle bins of each production server.
[0010] Optionally, before determining whether the memory capacity of the data to be cleaned in the database recycle bin of each candidate server is within a preset memory range, the method further includes: upon receiving a recycle bin cleanup request sent by the client, identifying the recycle bin cleanup request and obtaining the target cleanup date, wherein the target cleanup date refers to the retention time of the data to be cleaned in the database recycle bin of the production server; filtering the data to be cleaned from the database recycle bin of each production server according to the target cleanup date, and obtaining the memory capacity occupied by the data to be cleaned.
[0011] Optionally, after determining whether the total memory capacity of each database recycle bin is greater than a preset memory threshold, the method further includes: if the total memory capacity of the database recycle bins in the M production servers is greater than the preset memory threshold, sending a first prompt message to the client, wherein the first prompt message contains the start information of the cleanup operation.
[0012] Optionally, after determining whether the memory capacity of the data to be cleaned in the database recycle bin of each candidate server is within the preset memory range, the method further includes: if there is a case in N candidate servers where the memory capacity of the data to be cleaned is greater than the maximum value of the preset memory range, sending a second prompt message to the client, the second prompt message being used to prompt the user to select a data cleanup method.
[0013] Optionally, upon receiving a cleanup instruction, the target server generates a first cleanup script and a second cleanup script, wherein the first cleanup script is used to clean up the target type of data to be cleaned, and the second cleanup script is used to clean up the associated data of the target type of data to be cleaned.
[0014] To achieve the above objectives, according to another aspect of this application, a recycle bin cleanup system is provided. The system includes: a detection server, configured to perform memory detection on database recycle bins associated with M production servers, and to select N candidate servers from the M production servers whose total database recycle bin memory capacity is greater than a preset memory threshold; further configured to select Z target servers from the N candidate servers whose memory capacity of the data to be cleaned is within a preset memory range, and to send cleanup instructions to the Z target servers; M production servers, communicatively connected to the detection server, configured to receive memory query instructions sent by the detection server, and to send the total memory capacity of the database recycle bins of each production server and the memory capacity of the data to be cleaned to the detection server; further configured to, upon receiving cleanup instructions for the Z target servers, respond to the cleanup instructions and perform cleanup operations; and a client, communicatively connected to the detection server, configured to determine the data to be cleaned.
[0015] To achieve the above objectives, according to another aspect of this application, a recycle bin cleanup device is provided. The device includes: a detection unit, configured to perform memory detection on database recycle bins associated with M production servers, obtain the total memory capacity of the M database recycle bins, and determine whether the total memory capacity of each database recycle bin is greater than a preset memory threshold, where M is a positive integer; a first acquisition unit, configured to acquire servers from the M production servers whose total database recycle bin memory capacity is greater than the preset memory threshold, obtaining N candidate servers, where N is a positive integer and N is less than or equal to M; a judgment unit, configured to determine whether the memory capacity of the data to be cleaned in the database recycle bin of each candidate server is within a preset memory range, where the preset memory range is the range of the memory capacity of the data to be cleaned; and a second acquisition unit, configured to acquire servers from the N candidate servers whose memory capacity of the data to be cleaned is within the preset memory range, obtaining Z target servers, and sending cleanup instructions to the Z target servers, where Z is a positive integer and Z is less than or equal to N, and the target servers respond to the cleanup instructions by performing cleanup operations on the data to be cleaned.
[0016] According to another aspect of the present invention, a processor is also provided, which is used to run a program, wherein the program controls a device containing a non-volatile storage medium to perform a recycle bin cleanup method during runtime.
[0017] According to another aspect of the present invention, an electronic device is also provided, comprising one or more processors and a memory; the memory stores computer-readable instructions, and the processor is configured to execute the computer-readable instructions, wherein the computer-readable instructions, when executed, perform a method for cleaning up a recycle bin.
[0018] This application employs the following steps: memory detection is performed on the database recycle bins associated with M production servers to obtain the total memory capacity of the M database recycle bins, and it is determined whether the total memory capacity of each database recycle bin is greater than a preset memory threshold, where M is a positive integer; from the M production servers, servers whose total database recycle bin memory capacity is greater than the preset memory threshold are selected, resulting in N candidate servers, where N is a positive integer, less than or equal to M; it is determined whether the memory capacity of the data to be cleaned in the database recycle bin of each candidate server is within a preset memory range, where the preset memory range is the range of the memory capacity of the data to be cleaned; from the N candidate servers... The system selects servers whose memory capacity for the data to be cleaned is within a preset memory range, thus identifying Z target servers. Cleaning instructions are then sent to these Z target servers, where Z is a positive integer less than or equal to N. The target servers respond to the cleaning instructions and perform the cleaning operation on the data to be cleaned. This solves the problem of high manpower costs associated with cleaning database recycle bins in related technologies. By utilizing a detection server to detect the capacity of the production server's recycle bin, target servers capable of performing data cleaning are identified, and cleaning instructions are sent to these target servers. This improves data cleaning efficiency and saves significant manpower costs. Attached Figure Description
[0019] The accompanying drawings, which form part of this application, are used to provide a further understanding of this application. The illustrative embodiments and descriptions of this application are used to explain this application and do not constitute an undue limitation of this application. In the drawings:
[0020] Figure 1 This is a schematic diagram of a recycling station cleaning system provided according to an embodiment of this application;
[0021] Figure 2 This is a flowchart of a recycling bin cleaning method provided according to an embodiment of this application;
[0022] Figure 3 This is a schematic diagram of an optional recycling bin cleaning method provided according to an embodiment of this application;
[0023] Figure 4 This is a schematic diagram of a recycling station cleaning device provided according to an embodiment of this application;
[0024] Figure 5 This is a schematic diagram of an electronic device provided according to an embodiment of this application. Detailed Implementation
[0025] It should be noted that, unless otherwise specified, the embodiments and features described in this application can be combined with each other. This application will now be described in detail with reference to the accompanying drawings and embodiments.
[0026] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of protection of the present application.
[0027] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate for the embodiments of this application described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0028] It should be noted that all information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for display, data used for analysis, etc.) involved in this disclosure are information and data authorized by the user or fully authorized by all parties. For example, this system has an interface with relevant users or organizations. Before obtaining relevant information, it is necessary to send an acquisition request to the aforementioned user or organization through the interface, and obtain the relevant information after receiving consent from the aforementioned user or organization.
[0029] This application provides a recycle bin cleaning system, which can be used to execute the recycle bin cleaning method provided in this application. The recycle bin cleaning system provided in this application is described below.
[0030] Figure 1 This is a schematic diagram of a recycling bin cleaning system provided according to an embodiment of this application, such as... Figure 1 As shown, the system includes:
[0031] The detection server 101 is used to perform memory detection on the database recycle bins associated with M production servers 102, and to obtain N candidate servers from the M production servers 102 whose total memory capacity of the database recycle bins is greater than a preset memory threshold. It is also used to obtain Z target servers from the N candidate servers whose memory capacity of the data to be cleaned is within a preset memory range, and to send cleanup instructions to the Z target servers.
[0032] Specifically, since the database recycle bin associated with production server 102 temporarily stores data, lists, indexes, and other objects deleted by users, and the objects stored in the recycle bin still occupy memory space of the database associated with the server, when the data memory space occupied by the database recycle bin becomes too large, it may cause production server 102 to malfunction. Therefore, it is necessary to clean up the data in the database recycle bin of production server 102. Before performing the data cleanup operation, it is necessary to use detection server 101 to perform memory detection on production server 102. Detection server 101 refers to the server that performs capacity detection on production server 102. By periodically detecting the database recycle bin of production server 102, the memory capacity information of the database recycle bin of each production server 102 can be obtained.
[0033] It should be noted that by utilizing the detection server 101 to determine whether each production server 102 meets the data cleanup conditions, the detection server 101 performs memory checks on each production server 102. The data cleanup conditions include ensuring that the total memory capacity of the data stored in the database recycle bin is greater than a preset memory threshold, and furthermore, that the memory capacity of the data to be cleaned in the database recycle bin is within a preset memory range. When the data in the database recycle bin of a production server 102 meets the data cleanup conditions, a cleanup command is sent to the production server 102 that meets the data cleanup conditions, enabling the production server 102 to respond to the cleanup command and perform the data cleanup operation.
[0034] M production servers 102 are communicatively connected to the detection server 101. They are used to receive memory query commands sent by the detection server 101, and send the total memory capacity of the database recycle bin of each production server 102 and the memory capacity of the data to be cleaned to the detection server 101. They are also used to perform cleanup operations in response to cleanup commands received for Z target servers.
[0035] Specifically, production server 102 refers to the server that provides external services. When detection server 101 performs memory detection on production server 102, it sends a memory query command to production server 102. After receiving the memory query command, production server 102 responds to the command and sends the memory capacity of the data stored in the database recycle bin of production server 102 to detection server 101. After detection server 101 checks whether the memory capacity meets the data cleanup conditions, some servers in production server 102 will receive a cleanup command sent by detection server 101 again, generate a cleanup script according to the cleanup command, and use the cleanup script to perform cleanup operations on the data that needs to be cleaned.
[0036] It should be noted that a server in production server 102 that does not receive a cleanup command sent by detection server 101 is a server that does not meet the data cleanup conditions. For example, if the total memory capacity of the database recycle bin of a certain production server 102 is less than a preset memory threshold, it indicates that performing temporary data storage operations on the database recycle bin of the production server 102 will not affect the normal operation of the production server 102.
[0037] Client 103 communicates with detection server 101 to determine the data to be cleaned.
[0038] Specifically, client 103 refers to the mobile terminal used by the user, which may include mobile electronic devices, computers, etc. When the user needs to clean up data on multiple production servers 102, he / she will send a recycle bin cleanup request to the system, that is, send information about the data to be cleaned to the system. For example, if the user wants to clean up data that has been stored in the database recycle bin for one month, that is, if he / she wants to clean up data 30 days ago from the current date, the recycle bin cleanup request is compiled and sent to the detection server 101 which is connected to client 103. The detection server 101 identifies the recycle bin cleanup request and then determines the data to be cleaned.
[0039] The recycle bin cleanup system provided in this application embodiment uses a detection server 101 to perform memory detection on the database recycle bins associated with M production servers 102, and to obtain N candidate servers from the M production servers 102 whose total memory capacity of the database recycle bins is greater than a preset memory threshold. It also obtains Z target servers from the N candidate servers whose memory capacity of the data to be cleaned is within a preset memory range, and sends cleanup instructions to the Z target servers. The M production servers 102 are communicatively connected to the detection server 101, and are used to receive memory query instructions sent by the detection server 101 and send the memory capacity of each production server to the detection server 101. The server 102 has a total memory capacity for the database recycle bin and a memory capacity for the data to be cleaned. It is also used to respond to cleanup instructions and perform cleanup operations when receiving cleanup instructions for Z target servers. The client 103 is connected to the detection server 101 and is used to determine the data to be cleaned. This solves the problem of high manpower costs when cleaning the database recycle bin in related technologies. By using the detection server to detect the capacity of the production server's recycle bin, the target server that can perform data cleanup is determined, and a cleanup instruction is sent to the target server, thereby improving data cleanup efficiency and saving a lot of manpower costs.
[0040] Figure 2 This is a flowchart of a recycle bin cleaning method provided in the embodiments of this application, applied to the recycle bin cleaning system of the above embodiments, such as... Figure 2 As shown, the method includes the following steps:
[0041] Step S201: Perform memory detection on the database recycle bins associated with the M production servers to obtain the total memory capacity of the M database recycle bins, and determine whether the total memory capacity of each database recycle bin is greater than a preset memory threshold, where M is a positive integer.
[0042] Specifically, the database recycle bin associated with the production server temporarily stores data deleted by users when using the production server. When the database recycle bin stores too much data, resulting in excessive database memory space being occupied, in order to prevent server abnormalities due to insufficient database memory space, it is necessary to use a detection server to perform memory detection on the database recycle bin of the production server, and then determine whether the production server can perform data cleanup operations based on the detection results.
[0043] It should be noted that the total memory capacity of the database recycle bin refers to the total memory of the data stored in the database recycle bin of the production server. For example, if the total memory capacity of the database recycle bin of a certain production server detected by the detection server is 50G, while the preset memory threshold is 40G, it indicates that the total memory capacity of the database recycle bin is greater than the preset memory threshold. In this case, it is necessary to perform data cleanup operations on the database recycle bin of the production server in a timely manner to prevent server malfunctions due to insufficient database memory space.
[0044] Step S202: Select servers from M production servers whose total memory capacity of the database recycle bin is greater than a preset memory threshold, and obtain N candidate servers, where N is a positive integer and N is less than or equal to M.
[0045] Specifically, after obtaining the total memory capacity of the database recycle bin of each production server and comparing the relationship between each total memory capacity and a preset memory threshold, servers with a total memory capacity greater than the preset memory threshold are selected from all production servers that are connected to the detection server, resulting in multiple candidate servers.
[0046] Step S203: Determine whether the memory capacity of the data to be cleaned in the database recycle bin of each candidate server is within the preset memory range, where the preset memory range is the range of the memory capacity of the data to be cleaned.
[0047] Specifically, if a production server needs to perform data cleanup, to prevent users from accidentally deleting important data, some data older than the current date can be cleaned up. This data can then be recovered from the database recycle bin when users query for accidentally deleted data, effectively preventing data loss. After obtaining candidate servers with a total memory capacity greater than a preset memory threshold, it is necessary to determine the relationship between the memory capacity of the data to be cleaned on each candidate server and the preset memory range. If the memory capacity of the data to be cleaned is within the preset memory range, it indicates that the cleanup script generated by the production server can be used to clean up the data. If the memory capacity of the data to be cleaned does not meet the preset memory range, further judgment is required from operations personnel. The data to be cleaned refers to data stored in the recycle bin that is older than the current date.
[0048] Step S204: Obtain servers whose memory capacity for the data to be cleaned is within a preset memory range from N candidate servers to obtain Z target servers, and send cleanup instructions to Z target servers, where Z is a positive integer and Z is less than or equal to N. The target servers respond to the cleanup instructions and perform cleanup operations on the data to be cleaned.
[0049] Specifically, after comparing the memory capacity of the data to be cleaned on each candidate server with the preset memory range, multiple target servers with memory capacities within the preset memory range are selected from the candidate servers. For example, the minimum value of the preset memory range can be 10G and the maximum value can be 30G, which means that the memory capacity of the data to be cleaned needs to be greater than or equal to 10G and less than or equal to 30G. If there is a case where the memory capacity of the data to be cleaned is less than 10G or greater than 30G, a prompt message needs to be sent to the operations and maintenance personnel. After further judgment by the operations and maintenance personnel, the processing method for the data to be cleaned is determined.
[0050] Furthermore, after determining the target server based on the preset memory threshold and preset memory range, the detection server sends a cleanup command to the target server. Upon receiving the cleanup command, the target server responds by generating a cleanup script and uses the cleanup script to perform data cleanup operations. After the target server completes the data cleanup operations, it sends a cleanup completion message to the detection server. Upon receiving the cleanup completion message, the detection server forwards it to the client.
[0051] The recycle bin cleanup method provided in this application embodiment involves: performing memory detection on the database recycle bins associated with M production servers to obtain the total memory capacity of the M database recycle bins; determining whether the total memory capacity of each database recycle bin is greater than a preset memory threshold, where M is a positive integer; obtaining N candidate servers from the M production servers whose total database recycle bin memory capacity is greater than the preset memory threshold, where N is a positive integer and N is less than or equal to M; and determining whether the memory capacity of the data to be cleaned in the database recycle bin of each candidate server is within a preset memory range, where the preset memory range is the range of the memory capacity of the data to be cleaned. The system selects Z target servers from N candidate servers whose memory capacity for cleaning data falls within a preset memory range. It then sends cleaning instructions to these Z target servers, where Z is a positive integer less than or equal to N. The target servers respond to the cleaning instructions and perform cleaning operations on the data to be cleaned. This solves the problem of high manpower costs associated with cleaning database recycle bins in related technologies. By utilizing a detection server to detect the capacity of the production server's recycle bin, it identifies target servers capable of data cleaning and sends cleaning instructions to them, thereby improving data cleaning efficiency and saving significant manpower costs.
[0052] Before using the detection server to perform memory testing on the production servers, it is necessary to establish a communication connection between the detection server and each production server. Optionally, in the recycle bin cleanup method provided in this application embodiment, before performing memory testing on the database recycle bins associated with M production servers, the method further includes: obtaining the first port information of the detection server and the second port information of the M production servers; identifying the first port information to obtain the first port associated with the detection server; and identifying the second port information to obtain the second port associated with the M production servers; opening the first firewall associated with the first port and the second firewall associated with the second port; and establishing a communication connection between the detection server and the M production servers through the first firewall and the second firewall.
[0053] Specifically, the server port is used to transmit and receive information files. By identifying the first port information of the detection server and the second port information of the production server, the first port and the second port can be obtained. Different servers can be connected through the port to realize data transmission. The first port can be port21 or port22, and the second port can be portA or portB.
[0054] Furthermore, by opening the firewall associated with each port using the first and second ports, a communication connection can be established between the detection server and the production server.
[0055] This embodiment enables connections between different servers by enabling firewalls, thus ensuring network security during data transmission.
[0056] The detection server detects the memory of the production server by sending a memory query command. Optionally, in the recycle bin cleanup method provided in this application embodiment, the memory detection of the database recycle bins associated with M production servers to obtain the total memory capacity of the M database recycle bins includes: sending a memory query command to each of the M production servers and receiving the total memory capacity of the database recycle bins returned by each production server. The memory query command is generated by the detection server and is used to query the total memory capacity occupied by the data in the recycle bin of each production server.
[0057] Specifically, after the detection server establishes communication connections with multiple production servers, the detection server generates a memory query command and sends the command to each production server. When a production server receives the memory query command, it identifies the command, obtains the total memory capacity of the database recycle bin associated with the production server, and transmits the total memory capacity to the detection server.
[0058] Furthermore, after receiving the total memory capacity, the detection server stores the total memory capacity in the database associated with the detection server for subsequent memory detection operations.
[0059] The data to be cleaned is determined by the target cleanup date. Optionally, in the cleanup method of the recycle bin provided in this application embodiment, before determining whether the memory capacity of the data to be cleaned in the database recycle bin of each candidate server is within a preset memory range, the method further includes: when receiving a cleanup request from the client, identifying the cleanup request and obtaining the target cleanup date, wherein the target cleanup date refers to the retention time of the data to be cleaned in the database recycle bin of the production server; filtering the data to be cleaned from the database recycle bin of each production server according to the target cleanup date, and obtaining the memory capacity occupied by the data to be cleaned.
[0060] Before the detection server sends memory query commands to each production server, the memory query commands need to be compiled first. Specifically, it receives recycle bin cleanup requests sent by users through clients, identifies the request to obtain information about the data to be cleaned up, i.e., the target cleanup date. For example, when a user wants to clean up data from 15 days prior to May 19, 2023, a recycle bin cleanup request is generated based on the user's request and sent to the detection server through the client. After receiving the request, the detection server identifies the request and obtains the target cleanup date as May 4th. Therefore, the data to be cleaned up is the data that users moved to the database recycle bin after May 4th.
[0061] Furthermore, after determining the target cleanup date, a memory query command is generated based on that date. Once the production server receives and recognizes the command, it filters out the data to be cleaned based on the target cleanup date and obtains the memory capacity occupied by this data in the database recycle bin. This memory capacity, along with the total memory capacity, is then sent to the detection server. Upon receiving both memory capacities, the detection server stores them in the associated database.
[0062] This embodiment uses the target cleanup date to filter the data to be cleaned, which can prevent the accidental deletion of data and ensure data security.
[0063] Optionally, in the method for cleaning up the recycle bins provided in this application embodiment, after determining whether the total memory capacity of each database recycle bin is greater than a preset memory threshold, the method further includes: if the total memory capacity of the database recycle bins in M production servers is greater than the preset memory threshold, sending a first prompt message to the client, wherein the first prompt message contains start information for the cleanup operation.
[0064] Specifically, when the detection server determines the relationship between the total memory capacity of the database recycle bin sent by the production server and a preset memory threshold, if the total memory capacity of a production server's database recycle bin exceeds the preset memory threshold, it indicates that the database memory space occupied by the production server's database recycle bin is too large. To prevent excessive memory usage from affecting the normal operation of the server, the occupied memory needs to be released. Therefore, while comparing the memory capacity of the data to be cleaned in the production server's database recycle bin, a prompt message is simultaneously sent to the client, reminding the user to pay attention to the recycle bin cleanup operation and to perform timely maintenance if database operation abnormalities occur. This embodiment, by detecting the content capacity of the data to be cleaned while sending prompt messages to the user, allows the user to pay attention to the database memory data of the production server in a timely manner and perform database or server maintenance when necessary, thereby ensuring the normal operation of the server.
[0065] When the data to be cleaned does not meet the preset memory range, a prompt message needs to be issued. Optionally, in the cleanup method of the recycle bin provided in this application embodiment, after determining whether the memory capacity of the data to be cleaned in the database recycle bin of each candidate server is within the preset memory range, the method further includes: if there is a case in N candidate servers where the memory capacity of the data to be cleaned is greater than the maximum value of the preset memory range, a second prompt message is sent to the client. The second prompt message is used to prompt the user to select a data cleanup method.
[0066] Specifically, when the detection server determines the relationship between the memory capacity of the data to be cleaned in the database recycle bin sent by the candidate server and the preset memory range, if the memory capacity of the data to be cleaned in the database recycle bin is greater than the maximum value of the preset memory range, it indicates that if the cleanup script generated by the production server is used to perform the cleanup operation on the data to be cleaned, it may cause the script to run abnormally or the cleanup to fail. In this case, it is necessary to send a prompt message to the user's client to remind the user to check whether the data to be cleaned can be cleaned and to determine the specific cleanup method. The cleanup method can be manual cleanup or cleanup using a cleanup script. Therefore, by sending a prompt message to the user, the normal operation of the server can be guaranteed.
[0067] The cleanup script is determined based on the data type of the data to be cleaned. Optionally, in the cleanup method of the recycle bin provided in this application embodiment, when the target server receives a cleanup instruction, it generates a first cleanup script and a second cleanup script. The first cleanup script is used to clean up the data to be cleaned of the target type, and the second cleanup script is used to clean up the associated data of the data to be cleaned of the target type.
[0068] Specifically, after using the detection server to perform memory detection on all production servers with communication connections and identifying target servers that meet the cleanup conditions, the detection server sends a cleanup command to the target servers.
[0069] After receiving the cleanup command, the target server obtains the data type of the data to be cleaned in the recycle bin of the associated database for the target cleanup date, and determines the data of type TABLE in the cleanup data and the associated data of the associated data type of TABLE data. The associated data type can be INDEX, Index Partition, Table Partition, LOB, Lob Partition, etc.
[0070] Furthermore, after determining the target type and associated data type, a cleanup script is generated based on the target type and associated data type, and the cleanup script is used to perform data cleanup operations on the database recycle bin.
[0071] It should be noted that the association data type is determined by the TABLE cleanup principles in the database specification manual, which can ensure the normal operation of the current server. By cleaning up the data of the target data type and the association data type, it is possible to save memory space while ensuring the normal operation of the server.
[0072] This application also provides an optional method for cleaning up a recycle bin. Figure 3 This is a schematic diagram of an optional recycle bin cleaning method provided according to an embodiment of this application, such as... Figure 3As shown, the method includes:
[0073] When the database recycle bin stores too much data, resulting in excessive database memory usage, in order to prevent server malfunctions due to insufficient database memory, it is necessary to use a detection server to perform memory checks on the database recycle bin of the production server, and then determine whether the production server can perform data cleanup operations based on the detection results.
[0074] First, by detecting the first port information of the detection server and the second port information of the production server, the first and second ports are obtained. Then, the first and second ports are used to establish a communication connection between the detection server and the production server. Once the communication connection is successful, the detection server sends a memory query command to the production server and receives the total memory capacity of the database recycle bin and the memory capacity of the data to be cleaned from each production server.
[0075] Furthermore, the total memory capacity of the database recycle bin and the memory capacity of the data to be cleaned are compared with the preset memory threshold and preset memory range to obtain the target server.
[0076] It should be noted that if a detection server detects that the total memory capacity of the database recycle bin in the production server is greater than the preset memory threshold, it will send the first prompt message of the production server to the client; and if the memory capacity of the data to be cleaned in the candidate servers selected by the production server is greater than the maximum value of the preset memory range, it will send the second prompt message to the client.
[0077] The candidate servers whose memory capacity for the data to be cleaned is within a preset memory range are selected, and a cleanup command is sent to the target server. When the production server receives the cleanup command, a cleanup script is generated, and the cleanup script is used to perform the data cleanup operation.
[0078] By using a detection server to detect the capacity of the production server's recycle bin, the target server that can perform data cleaning is identified, and a cleaning command is sent to the target server. After receiving the cleaning command, the target server generates a cleaning script and uses the cleaning script to perform data cleaning operations, thereby improving data cleaning efficiency and saving a lot of manpower costs.
[0079] It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although a logical order is shown in the flowchart, in some cases the steps shown or described may be executed in a different order than that shown here.
[0080] This application also provides a recycle bin cleaning device. It should be noted that the recycle bin cleaning device of this application can be used to execute the recycle bin cleaning method provided in this application. The recycle bin cleaning device provided in this application will be described below.
[0081] Figure 4 This is a schematic diagram of a recycling station cleaning device provided according to an embodiment of this application, such as... Figure 4 As shown, the device includes: a detection unit 40, a first acquisition unit 41, a judgment unit 42, and a second acquisition unit 43.
[0082] The detection unit 40 is used to perform memory detection on the database recycle bins associated with M production servers, obtain the total memory capacity of the M database recycle bins, and determine whether the total memory capacity of each database recycle bin is greater than a preset memory threshold, where M is a positive integer;
[0083] The first acquisition unit 41 is used to acquire servers whose total memory capacity of the database recycle bin is greater than a preset memory threshold from M production servers, and obtain N candidate servers, where N is a positive integer and N is less than or equal to M;
[0084] The judgment unit 42 is used to determine whether the memory capacity of the data to be cleaned in the database recycle bin of each candidate server is within the preset memory range, wherein the preset memory range is the range of the memory capacity of the data to be cleaned.
[0085] The second acquisition unit 43 is used to acquire servers whose memory capacity of the data to be cleaned is within a preset memory range from N candidate servers, obtain Z target servers, and send cleanup instructions to Z target servers, where Z is a positive integer and Z is less than or equal to N. The target servers respond to the cleanup instructions and perform cleanup operations on the data to be cleaned.
[0086] Optionally, in the recycle bin cleaning device provided in this application embodiment, the device further includes: a third acquisition unit, used to acquire first port information of the detection server and second port information of the M production servers before performing memory detection on the database recycle bins associated with the M production servers, identify the first port information to obtain the first port associated with the detection server, and identify the second port information to obtain the second port associated with the M production servers; and an activation unit, used to activate the first firewall associated with the first port and the second firewall associated with the second port, and establish a communication connection between the detection server and the M production servers through the first firewall and the second firewall.
[0087] Optionally, in the recycle bin cleaning device provided in this application embodiment, the detection unit 40 includes: a sending module, used to send memory query instructions to M production servers respectively, and receive the total memory capacity of the database recycle bin returned by each production server, wherein the memory query instructions are generated by the detection server and are used to query the total memory capacity occupied by the data in the recycle bin of each production server.
[0088] Optionally, in the recycle bin cleaning device provided in this application embodiment, the device further includes: an identification unit, used to identify the recycle bin cleaning request and obtain the target cleaning date when receiving the recycle bin cleaning request sent by the client before determining whether the memory capacity of the data to be cleaned in the database recycle bin of each candidate server is within a preset memory range, wherein the target cleaning date refers to the retention time of the data to be cleaned in the database recycle bin of the production server; and a filtering unit, used to filter the data to be cleaned from the database recycle bin of each production server according to the target cleaning date and obtain the memory capacity occupied by the data to be cleaned.
[0089] Optionally, in the recycle bin cleaning device provided in the embodiments of this application, the device further includes: a first sending unit, configured to send a first prompt message to the client after determining whether the total memory capacity of each database recycle bin is greater than a preset memory threshold, in the case where the total memory capacity of the database recycle bins in M production servers is greater than the preset memory threshold, wherein the first prompt message contains start information for the cleaning operation.
[0090] Optionally, in the recycle bin cleaning device provided in this application embodiment, the device further includes: a second sending unit, used to send a second prompt message to the client after determining whether the memory capacity of the data to be cleaned in the database recycle bin of each candidate server is within a preset memory range, and if there is a data to be cleaned in N candidate servers whose memory capacity is greater than the maximum value of the preset memory range, the second prompt message is used to prompt the user to select a data cleaning method.
[0091] Optionally, in the recycle bin cleaning device provided in this application embodiment, the second acquisition unit 43 includes: a generation module, used to generate a first cleaning script and a second cleaning script when the target server receives a cleaning instruction, wherein the first cleaning script is used to clean up the target type of data to be cleaned, and the second cleaning script is used to clean up the associated data of the target type of data to be cleaned.
[0092] The recycle bin cleaning device provided in this application embodiment includes a detection unit 40 for detecting the memory of database recycle bins associated with M production servers, obtaining the total memory capacity of the M database recycle bins, and determining whether the total memory capacity of each database recycle bin is greater than a preset memory threshold, where M is a positive integer; a first acquisition unit 41 for acquiring servers from the M production servers whose total memory capacity of the database recycle bins is greater than the preset memory threshold, obtaining N candidate servers, where N is a positive integer and N is less than or equal to M; and a judgment unit 42 for determining whether the memory capacity of the data to be cleaned in the database recycle bin of each candidate server is within a preset memory range, where the preset memory range is the amount of data to be cleaned. The second acquisition unit 43 is used to acquire servers whose memory capacity of the data to be cleaned is within a preset memory range from N candidate servers, obtain Z target servers, and send cleanup instructions to Z target servers, where Z is a positive integer and Z is less than or equal to N. The target servers respond to the cleanup instructions and perform cleanup operations on the data to be cleaned. This solves the problem of high manpower costs in related technologies when cleaning data in the database recycle bin. By using a detection server to detect the capacity of the production server's recycle bin, the target servers that can perform data cleanup are determined, and cleanup instructions are sent to the target servers, thereby improving data cleanup efficiency and saving a lot of manpower costs.
[0093] The recycling bin's cleaning device includes a processor and a memory. The aforementioned detection unit 40, first acquisition unit 41, judgment unit 42, second acquisition unit 43, etc., are all stored in the memory as program units. The processor executes the aforementioned program units stored in the memory to achieve the corresponding functions.
[0094] The processor contains a kernel, which retrieves the corresponding program units from memory. One or more kernels can be configured, and adjusting kernel parameters can address the problem of high manpower costs associated with data cleanup of database recycle bins in related technologies.
[0095] The memory may include non-permanent memory in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM, and the memory includes at least one memory chip.
[0096] This invention provides a computer-readable storage medium having a program stored thereon that, when executed by a processor, implements a method for cleaning up a recycle bin.
[0097] This invention provides a processor for running a program, wherein the program executes a method for cleaning up the recycle bin during runtime.
[0098] Figure 5 This is a schematic diagram of an electronic device provided according to an embodiment of this application, such as... Figure 5 As shown, this embodiment of the invention provides an electronic device 50, which includes a processor, a memory, and a program stored in the memory and executable on the processor. The processor is used to execute computer-readable instructions, wherein the computer-readable instructions execute a method for cleaning up a recycle bin. The device described herein may be a server, PC, PAD, mobile phone, etc.
[0099] This application also provides a computer program product that, when executed on a data processing device, is suitable for performing a method for cleaning up a recycle bin.
[0100] 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.
[0101] 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.
[0102] 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.
[0103] 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.
[0104] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0105] Memory may include non-persistent memory 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.
[0106] 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.
[0107] 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 process, method, article, or apparatus. Unless otherwise specified, 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 that element.
[0108] 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.
[0109] The above are merely embodiments of this application and are 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 cleaning a recycling station, characterized in that, Applications in detection servers include: Perform memory detection on the database recycle bins associated with M production servers to obtain the total memory capacity of the M database recycle bins, and determine whether the total memory capacity of each database recycle bin is greater than a preset memory threshold, where M is a positive integer; From the M production servers, servers whose total memory capacity of the database recycle bin is greater than the preset memory threshold are selected to obtain N candidate servers, where N is a positive integer and N is less than or equal to M; Determine whether the memory capacity of the data to be cleaned in the database recycle bin of each candidate server is within a preset memory range, wherein the preset memory range is the range of the memory capacity of the data to be cleaned, and the data to be cleaned is selected from the database recycle bin according to the target cleanup date; From the N candidate servers, select the servers whose memory capacity for the data to be cleaned is within the preset memory range to obtain Z target servers, and send a cleanup command to the Z target servers, where Z is a positive integer and Z is less than or equal to N. The target servers respond to the cleanup command and perform a cleanup operation on the data to be cleaned.
2. The method according to claim 1, characterized in that, Before performing memory checks on the database recycle bins associated with the M production servers, the method further includes: Obtain the first port information of the detection server and the second port information of the M production servers; identify the first port information to obtain the first port associated with the detection server; and identify the second port information to obtain the second port associated with the M production servers. Open the first firewall associated with the first port and the second firewall associated with the second port, and establish a communication connection between the detection server and the M production servers through the first firewall and the second firewall.
3. The method according to claim 1, characterized in that, Memory testing was performed on the database recycle bins associated with M production servers, and the total memory capacity of the M database recycle bins was obtained as follows: The system sends memory query commands to each of the M production servers and receives the total memory capacity of the database recycle bin returned by each production server. The memory query commands are generated by the detection server and are used to query the total memory capacity occupied by the data in the recycle bin of each production server.
4. The method according to claim 1, characterized in that, Before determining whether the memory capacity of the data to be cleaned in the database recycle bin of each candidate server is within a preset memory range, the method further includes: Upon receiving a recycle bin cleanup request from a client, the recycle bin cleanup request is identified, and a target cleanup date is obtained, wherein the target cleanup date refers to the retention time of the data to be cleaned in the database recycle bin of the production server; The data to be cleaned is selected from the database recycle bin of each production server according to the target cleanup date, and the memory capacity occupied by the data to be cleaned is obtained.
5. The method according to claim 1, characterized in that, After determining whether the total memory capacity of each database recycle bin is greater than a preset memory threshold, the method further includes: If the total memory capacity of the database recycle bins in the M production servers exceeds the preset memory threshold, a first prompt message is sent to the client, wherein the first prompt message contains the start information of the cleanup operation.
6. The method according to claim 1, characterized in that, After determining whether the memory capacity of the data to be cleaned in the database recycle bin of each candidate server is within a preset memory range, the method further includes: If the memory capacity of the data to be cleaned in the N candidate servers is greater than the maximum value of the preset memory range, a second prompt message is sent to the client. The second prompt message is used to prompt the user to select a data cleanup method.
7. The method according to claim 1, characterized in that, Upon receiving the cleanup instruction, the target server generates a first cleanup script and a second cleanup script. The first cleanup script is used to clean up the data to be cleaned of the target type, and the second cleanup script is used to clean up the associated data of the data to be cleaned of the target type.
8. A recycling station cleaning system, characterized in that, include: The detection server is used to perform memory detection on the database recycle bins associated with M production servers, and to obtain N candidate servers from the M production servers whose total memory capacity of the database recycle bins is greater than a preset memory threshold. It is also used to obtain Z target servers from the N candidate servers whose memory capacity of the data to be cleaned is within a preset memory range, and to send cleanup instructions to the Z target servers. The M production servers are communicatively connected to the detection server and are used to receive memory query instructions sent by the detection server, send the total memory capacity of the database recycle bin of each production server and the memory capacity of the data to be cleaned to the detection server, and also to perform cleanup operations in response to cleanup instructions received for the Z target servers. The client communicates with the detection server to determine the data to be cleaned.
9. A cleaning device for a recycling station, characterized in that, include: The detection unit is used to perform memory detection on the database recycle bins associated with M production servers, obtain the total memory capacity of the M database recycle bins, and determine whether the total memory capacity of each database recycle bin is greater than a preset memory threshold, where M is a positive integer; The first acquisition unit is used to acquire servers whose total memory capacity of the database recycle bin is greater than the preset memory threshold from the M production servers, and obtain N candidate servers, where N is a positive integer and N is less than or equal to M; The judgment unit is used to determine whether the memory capacity of the data to be cleaned in the database recycle bin of each candidate server is within a preset memory range, wherein the preset memory range is the range of the memory capacity of the data to be cleaned, and the data to be cleaned is selected from the database recycle bin according to the target cleanup date; The second acquisition unit is used to acquire servers whose memory capacity for the data to be cleaned is within the preset memory range from the N candidate servers, obtain Z target servers, and send a cleanup instruction to the Z target servers, where Z is a positive integer and Z is less than or equal to N. The target servers respond to the cleanup instruction and perform a cleanup operation on the data to be cleaned.
10. A processor, characterized in that, The processor is used to run a program, wherein the program executes the recycle bin cleaning method according to any one of claims 1 to 7.
11. An electronic device, characterized in that, It includes one or more processors and a memory, the memory being used to store one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors cause the one or more processors to implement the recycle bin cleanup method according to any one of claims 1 to 7.