A database optimization method, device, equipment and storage medium
By analyzing the types of execution command competitions for target services in the ORACLE database and formulating targeted performance tuning strategies, the problem of the inability to optimize database performance for different business characteristics in the existing technology is solved, and more efficient resource utilization and performance improvement is achieved.
Patent Information
- Application Number
- CN202411482595.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-23
- Publication Date
- 2025-05-23
- Estimated Expiration
- 2044-10-23
AI Technical Summary
It is difficult for the existing technology to formulate diversified database tuning strategies for different business characteristics, resulting in the inability to achieve optimal performance improvement.
By obtaining multiple execution commands in the ORACLE database, determine the command competition type of the target business, and formulate targeted performance tuning strategies based on the competition type and related competition data, including adjusting the configuration of free lists, rollback segments, log buffers and multi-instance schedulers.
It achieves more accurate resource utilization and efficiency improvement, can diagnose database bottlenecks, avoid the increase of invalid resources, scientifically allocate resources, reduce hardware or software configuration costs, and ensure continuous optimization of performance.
Smart Images

Figure CN119003492B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of database technology, and in particular to a database optimization method, device, equipment and storage medium. Background Art
[0002] In the operation of the ORACLE database, in order to improve user experience, optimize performance and reduce resource consumption, it is usually pursued to achieve higher performance effects with lower resource configuration. For performance tuning, common practices include adjusting database configuration, optimizing hardware configuration and improving applications. However, existing tuning methods are often based on general rules and do not take into account different business characteristics and requirements, resulting in failure to achieve optimal performance improvement.
[0003] Therefore, how to formulate diversified database tuning strategies according to different business characteristics to improve the overall performance of the ORACLE database is a technical problem that technical personnel in this field urgently need to solve. Summary of the invention
[0004] Based on the above problems, the present application provides a database optimization method, device, equipment and storage medium, which can formulate diversified database tuning strategies according to different business characteristics to improve the overall performance of the ORACLE database.
[0005] The embodiments of the present application disclose the following technical solutions:
[0006] A method for optimizing a database, the method comprising:
[0007] Acquire multiple execution commands in an Oracle database ORACLE database; the multiple execution commands are from the same target business;
[0008] Determining a command contention type of the target service based on the multiple execution commands;
[0009] Determining a performance tuning method for the ORACLE database according to a command competition type of the target business and competition data corresponding to the command competition type; the competition data includes an indicator for determining the command competition type;
[0010] The performance of the ORACLE database is optimized based on the performance tuning method.
[0011] In a possible implementation, the command contention types include free list contention, rollback segment contention, log buffer contention, and scheduling process contention.
[0012] In a possible implementation manner, determining the command contention type of the target service based on the multiple execution commands includes:
[0013] If the number of times any free list in the ORACLE database is requested is greater than the request threshold or the processing time of any free list is greater than the time threshold, it is determined that the command competition type of the target service includes the free list competition;
[0014] If the execution command includes a rollback command, and the ratio of the waiting execution time of the rollback command in the rollback segment buffer to the execution time is greater than the first ratio threshold, it is determined that the command competition type of the target business includes the rollback segment competition; the waiting execution time includes the waiting execution time of all rollback commands in the rollback segment buffer; the execution time includes the time from the rollback segment buffer receiving the first rollback command to the execution of the last rollback command; the rollback segment buffer executes the rollback command through multiple rollback segments;
[0015] If the execution command includes a redo command, and the difference between the size of the redo log corresponding to the redo command and the size of the available log buffer space storage space of the log buffer in the ORACLE database is greater than the difference threshold, it is determined that the command competition type of the target business includes the log buffer competition; the available log buffer space represents the amount of space remaining in the log buffer that can be used to store new log information;
[0016] If the ratio of the number of execution commands being executed to the number of all the execution commands is greater than a second proportion threshold, it is determined that the command competition type of the target business includes the scheduling process competition; the execution command is connected to different data volume instances through a multi-instance scheduler to execute the execution command.
[0017] In a possible implementation, determining the performance tuning method of the ORACLE database according to the command contention type of the target service and the contention data corresponding to the command contention type includes:
[0018] If the command competition type of the target business is the free list competition, the performance tuning method of the ORACLE database is determined as follows: determining the number of newly added lists based on competition data corresponding to the free list competition, and adding a new free list to the ORACLE database based on the number of newly added lists; the competition data corresponding to the free list competition includes the number of requests and the request threshold, or the processing time and the time threshold;
[0019] If the command competition type of the target business is the rollback segment competition, the performance tuning method of the ORACLE database is determined as follows: determining the number of newly added rollback segments based on competition data corresponding to the rollback segment competition, and adding new rollback segments to the rollback segment buffer based on the number of newly added rollback segments; the competition data corresponding to the rollback segment competition includes the ratio of the waiting execution time to the execution time and the first proportion threshold;
[0020] If the command competition type of the target business is the log buffer competition, the performance tuning method of the ORACLE database is determined as follows: determining the amount of newly added storage space based on competition data corresponding to the log buffer competition, and increasing the size of the log buffer based on the newly added storage space; the competition data corresponding to the log buffer competition includes the difference between the size of the redo log and the size of the available log buffer space storage space and the difference threshold;
[0021] If the command competition type of the target business is the scheduling process competition, the performance tuning method of the ORACLE database is determined as follows: the number of newly added multi-instance schedulers is determined based on the competition data corresponding to the scheduling process competition, and a new multi-instance scheduler is added to the ORACLE database based on the number of newly added multi-instance schedulers; the competition data corresponding to the scheduling process competition includes the ratio of the number of execution commands being executed to the number of all the execution commands and the second proportion threshold.
[0022] In a possible implementation, the method further includes:
[0023] Query the hit rate of all the execution commands in the global area SGA of the ORACLE database; the SGA includes a library cache area and a dictionary cache area; the hit rate includes a library cache area hit rate and a dictionary cache area hit rate; the library cache area hit rate includes a ratio of the number of first hit commands to the number of all the execution commands; the dictionary cache area hit rate includes a ratio of the number of second hit commands to the number of all the execution commands; the first hit command includes the execution command whose database execution item exists in the library cache area; the second hit command includes the execution command whose database execution item exists in the dictionary cache area; the database execution item includes a compiled version, a parsing result and / or an execution plan of the execution command.
[0024] If the hit rate of the library cache area is less than the hit rate threshold, determining an expansion amount of the library cache area based on the hit rate of the library cache area, and expanding the library cache area based on the expansion amount of the library cache area;
[0025] If the hit rate of the dictionary cache area is less than the hit rate threshold, an expansion amount of the dictionary cache area is determined based on the hit rate of the dictionary cache area, and the dictionary cache area is expanded based on the expansion amount of the dictionary cache area.
[0026] In a possible implementation, the rollback segment includes a public rollback segment and a private rollback segment.
[0027] A database optimization device, the device comprising:
[0028] An acquisition unit, used for acquiring a plurality of execution commands in an Oracle database ORACLE database; the plurality of execution commands are from the same target business;
[0029] A first determining unit, configured to determine a command contention type of the target service based on the multiple execution commands;
[0030] A second determining unit is used to determine the performance tuning method of the ORACLE database according to the command competition type of the target business and the competition data corresponding to the command competition type; the competition data includes an indicator for determining the command competition type;
[0031] A performance optimization unit is used to optimize the performance of the ORACLE database based on the performance tuning method.
[0032] In a possible implementation, the command contention types include free list contention, rollback segment contention, log buffer contention, and scheduling process contention.
[0033] A database optimization device comprises: a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the above-mentioned database optimization method is implemented.
[0034] A computer-readable storage medium having instructions stored therein, which, when executed on a terminal device, causes the terminal device to execute the above-mentioned database optimization method
[0035] Compared with the prior art, this application has the following beneficial effects:
[0036] The present application provides a database optimization method, device, equipment and storage medium. Specifically, when executing the database optimization method provided in the embodiment of the present application, multiple execution commands closely related to the target business can be first identified from the ORACLE database. By analyzing these execution commands, the command competition type can be accurately identified, that is, the command set that affects each other and competes for resources during operation. Then, based on the determined command competition type and its corresponding competition data, we can formulate a targeted performance tuning strategy, and the competition data includes indicators for accurately determining the competition relationship between commands. These competition data provide in-depth insights into the command competition pattern, which helps us understand which operations or transactions conflict more frequently when, thereby causing performance bottlenecks. Finally, based on the obtained performance tuning method, the ORACLE database is optimized in a targeted manner.
[0037] Compared with the tuning method based on general rules, this application can better cope with the differences in different business characteristics and requirements, and achieve more accurate resource utilization and efficiency improvement. At the same time, by identifying the "command competition type" between execution commands, the optimization method can diagnose the bottleneck of the ORACLE database and avoid invalid resource addition. Compared with blindly increasing resource allocation in order to achieve performance improvement, this application can allocate resources more scientifically, effectively reduce unnecessary hardware or software configuration, save costs while ensuring performance.
[0038] In addition, by continuously acquiring and analyzing execution commands, the method can monitor and respond to changes in business models, adjust optimization strategies, and ensure that database performance is continuously optimized to adapt to the dynamic business environment. In contrast, traditional static tuning methods may not be able to quickly respond to the challenges brought about by changes in business requirements. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] In order to more clearly illustrate the technical solutions in this embodiment or the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0040] Figure 1 A method flow chart of a database optimization method provided in an embodiment of the present application;
[0041] Figure 2 A schematic diagram of the structure of a database optimization device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0042] To facilitate understanding of the technical solutions provided by the embodiments of the present application, the background technology involved in the embodiments of the present application will be described below.
[0043] ORACLE database is a relational database management ORACLE database developed by Oracle Corporation. It is an enterprise-level database ORACLE database, which is widely used to store and manage data of various large organizations. ORACLE database is well-known for its stability, security and performance, and is used by many industries, including finance, Internet, government, manufacturing, etc.
[0044] In the operation of the ORACLE database, in order to ensure a smooth and efficient user experience, while achieving efficient resource utilization and reasonable cost control, optimizing database performance has become one of the key tasks. The pursuit of higher performance under lower resource configuration is the core goal of database management, which requires not only fine tuning of the ORACLE database, but also comprehensive consideration of the hardware environment, software configuration and application logic.
[0045] For performance tuning, the methods generally adopted include adjusting database configuration, optimizing hardware configuration and improving application programs. By adjusting database parameters such as memory allocation, cache size, network connection strategy, etc., data access speed and query efficiency can be effectively improved. For hardware configuration, upgrading to faster storage and more powerful processors, or optimizing network architecture can significantly improve data processing speed and ORACLE database response time. In addition, through code optimization, algorithm optimization and data structure adjustment, allowing applications to interact with the database more efficiently is also a major way to improve overall performance.
[0046] However, current methodologies are often limited to a set of general rules that apply to most scenarios, ignoring specific differences in business characteristics, data scale, access patterns, etc., resulting in the inability to achieve the ideal optimal performance improvement when facing complex and changing business needs. This "one-size-fits-all" tuning strategy lacks sufficient flexibility and pertinence, and may cause problems such as ORACLE database performance bottlenecks in actual applications.
[0047] In order to solve this problem, an optimization method, device, equipment and storage medium for a database are provided in an embodiment of the present application. First, multiple execution commands for the same target business are extracted from the ORACLE database, and then these commands are analyzed to identify the command competition type. Then, the corresponding performance tuning strategy is determined in combination with the command competition type and related competition data of the target business, and the competition data contains key indicators for identifying the command competition type. Finally, based on this performance tuning strategy, the ORACLE database is optimized. Compared with the tuning method of general rules, the present application responds to different business characteristics more accurately, realizes the optimal utilization of resources and improves efficiency. By identifying the "command competition type" between execution commands, the bottleneck of the ORACLE database can be effectively diagnosed, and invalid resource increases can be avoided, thereby achieving scientific resource allocation, reducing unnecessary hardware or software configuration, saving costs and ensuring performance. At the same time, by continuously acquiring and analyzing execution commands, the method can flexibly adjust the optimization strategy, adapt to changes in business models, ensure the continuous optimization of database performance, and overcome the shortcomings of traditional static tuning methods in quickly responding to changes in demand.
[0048] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0049] See also Figure 1 , which is a flow chart of a method for optimizing a database provided in an embodiment of the present application, such as Figure 1 As shown, the database optimization method may include steps S101-S104:
[0050] S101: Acquire multiple execution commands in an ORACLE database.
[0051] Obtaining multiple execution commands in ORACLE refers to extracting a series of Structured Query Language (SQL) execution instructions related to a specific business from the database. This can be done by using database query tools or scripts to query ORACLE database views (such as SQL statement information views or SQL region information views) to obtain execution history records, thereby filtering out commands related to the same target business for subsequent performance analysis and optimization.
[0052] It should be noted that these specific execution commands (such as database query, update, insert, etc.) are designed and executed around a specific business need, goal or process (i.e. target business). These commands may serve different but interrelated functions, such as order management, inventory control, financial reporting, customer relationship management, marketing analysis, etc. Together, they support business decision-making, improve efficiency, improve customer service, or achieve other key business goals.
[0053] For example, in e-commerce business, specific execution commands may include updating inventory status, processing orders, calculating discounts, sending shipping notifications, etc. These operations are concentrated in a unified business framework, aiming to improve the automation of transaction processes and customer satisfaction.
[0054] S102: Determine a command contention type of the target service based on the multiple execution commands.
[0055] Based on multiple execution commands, determining the command contention type of the target business means analyzing the execution of these commands to identify their competition patterns in resource usage. This includes checking whether there are conflicts or resource contention between commands, thus providing a basis for subsequent performance optimization. Through this analysis, we can more clearly understand the specific factors that affect business performance.
[0056] In a possible implementation, the command contention types include free list contention, rollback segment contention, log buffer contention, and scheduling process contention.
[0057] In a possible implementation manner, determining the command contention type of the target service based on the multiple execution commands includes A1-A4:
[0058] A1: If the number of times any free list in the ORACLE database is requested is greater than a request threshold or the processing time of any free list is greater than a time threshold, it is determined that the command contention type of the target service includes the free list contention.
[0059] In the context of Oracle Database, a Free List is a data structure used to store allocated but unused memory blocks. When a process allocates memory, it searches the Free List to find suitable free space. If the number of requests for any Free List in the database increases significantly (greater than the request threshold) or the processing time of any Free List increases significantly (greater than the time threshold), this usually indicates that a large number of memory allocation operations are occurring simultaneously, and during this process, the processing efficiency of the Free List is reduced or the load is too large.
[0060] In this case, it can be concluded that the command competition type of the target business includes "free list competition". This means that when executing a specific business operation, multiple concurrent requests or tasks may be competing for the same limited resource - the free memory block in the free list. This competition may cause performance problems such as extended response time, transaction blocking, and even affect the overall performance and stability of the ORACLE database.
[0061] It should be noted that the free list processing time refers to the time consumed by various activities related to operating the free list in database management.
[0062] In a possible implementation, the request threshold is usually recommended to start from tens of thousands to hundreds of thousands of requests as the threshold, and the specific number depends on the number of concurrent users of the ORACLE database, the average complexity of each request, and the ORACLE database capacity. For example, for a medium-sized application, the initial setting may be 50,000 requests received per minute as the threshold for triggering free list competition. This application does not impose specific restrictions on the size of the request threshold, and users can adjust the size of the request threshold according to actual needs.
[0063] Similarly, the time-consuming threshold should also be set based on the maximum waiting time that the ORACLE database can tolerate. In a high-load environment, a delay of several milliseconds per second may be considered inappropriate. This application does not impose specific restrictions on the size of the time-consuming threshold, and users can adjust the size of the time-consuming threshold according to actual needs.
[0064] A2: If the execution command includes a rollback command, and the ratio of the waiting execution time to the execution time of the rollback command in the rollback segment buffer is greater than the first proportion threshold, it is determined that the command competition type of the target service includes the rollback segment competition.
[0065] In the ORACLE database, "rollback segment" is a key component for storing and tracking the status of transaction operations, which allows the database to be restored to the state before the transaction started under certain circumstances. If the target business execution command contains a rollback instruction, and at a certain point in time, the average waiting execution time and execution time of the rollback command are observed to exceed the preset first percentage threshold, this usually means that the rollback operation has encountered a significant bottleneck in one or more rollback segment buffers. In other words, when processing the rollback request, the ORACLE database has found a certain degree of resource competition or blocking in these buffers. In this case, it can be determined that the command competition type of the target business includes "rollback segment competition".
[0066] It should be noted that the rollback command is a series of commands used to undo or roll back database transactions;
[0067] Rollback segment buffer: Whenever a transaction is completed, the Oracle database will record the update information related to the transaction in the rollback segment. When a transaction that needs to be rolled back occurs later, the Oracle database obtains the relevant data from these buffers for rollback operations. In other words, the rollback segment buffer executes the rollback command through multiple rollback segments;
[0068] Waiting execution time: refers to the sum of the time from when all rollback commands are submitted to when they are executed, that is, the time the commands are queued in the buffer. For example, if there are three rollback commands, the time from when the first rollback command is submitted to when it is executed is 1 millisecond, the time from when the second rollback command is submitted to when it is executed is 2 milliseconds, and the time from when the third rollback command is submitted to when it is executed is 1.5 milliseconds, then the waiting execution time is 4.5 milliseconds;
[0069] Execution time: It is the period from receiving the first rollback command until the last rollback command is executed.
[0070] Therefore, when the ratio of the waiting execution time and the execution time of the rollback command in the rollback segment buffer exceeds the first ratio threshold, it can be determined through detection and analysis that the command competition type for this scenario belongs to "rollback segment competition". Such identification helps to take timely measures to optimize the performance of the ORACLE database, improve the efficiency of the rollback operation, and prevent data consistency problems and other potential ORACLE database stability risks caused by the delay of the rollback operation.
[0071] It should be noted that the present application does not impose any specific restrictions on the size of the first proportion threshold, and the user can adjust the size of the first proportion threshold according to actual needs.
[0072] In a possible implementation, the rollback segment includes a public rollback segment and a private rollback segment.
[0073] The public rollback segment is a shared resource that is automatically managed by the DBMS_REDO package. When a transaction is created that executes COMMIT or ROLLBACK (even if the transaction is in auto-commit mode), the ORACLE database uses the public rollback segment to store the update information of the transaction. This ensures that any transaction that needs to be rolled back can access the required changed data. The public rollback segment is suitable for environments with low concurrency because it can be shared among most concurrent transactions, thereby reducing memory usage.
[0074] In contrast, private rollback segments are exclusive to each database user or a specified client ID (ClientIdentifier, CID). This means that each user or CID has its own independent rollback segment. Although this setting increases memory usage because each transaction has its own rollback segment, it provides better performance and isolation. Especially for applications that require high-concurrency processing, private rollback segments can significantly reduce latency and avoid data conflicts between transactions.
[0075] It should be noted that the choice between public and private rollback segments mainly depends on the requirements of the application and the load situation of the ORACLE database:
[0076] Public rollback segments are suitable for scenarios with low concurrency and low performance requirements. Especially in a multi-user ORACLE database, they can effectively utilize shared resources.
[0077] Private rollback segments are more suitable for high-concurrency environments or scenarios with strict requirements for transaction isolation and performance. Although it increases memory overhead, it is very beneficial for applications that require strict control of concurrency and data consistency.
[0078] A3: If the execution command includes a redo command, and the difference between the size of the redo log corresponding to the redo command and the available log buffer space storage size in the log buffer of the ORACLE database is greater than the difference threshold, it is determined that the command competition type of the target service includes the log buffer competition.
[0079] In the ORACLE database, the log buffer is a key component used to temporarily store online redo log records. When writing operations are performed on the database tablespace, these operations are first recorded in the log buffer and then periodically written to the actual redo log file.
[0080] If "the execution command includes a redo command", this usually means that operations such as data updates or transaction commits are being performed on the database. Each such command generates a redo log record. In the ORACLE database, when executing such a redo command, if the difference between the size of the redo log record and the available storage space in the log buffer (i.e., the remaining space available for storing new log information) is greater than the pre-set "difference threshold", a log buffer competition situation can be identified. That is, when this difference exceeds the "difference threshold", the ORACLE database will detect potential performance bottlenecks or resource pressures, and then mark one of the "command competition types" of the target service as "log buffer competition".
[0081] In a possible implementation, the difference threshold may be set at 50% or higher, depending on the size of the log buffer and the specific requirements of the database. For example, if the log buffer size is 16 megabytes (MB), the difference threshold may be set to 8MB (i.e., 50% of the log buffer space). This application does not impose specific restrictions on the size of the difference threshold, and the user can adjust the size of the difference threshold according to actual needs.
[0082] It should be noted that the redo log stores all modifications made to the data page since the last write operation. It records all row updates, additions, or deletions. When the database is restarted or a failure occurs, the redo log is used to reapply these changes, thereby restoring the database to the state before the failure.
[0083] A4: If the ratio of the number of the execution commands being executed to the number of all the execution commands is greater than the second proportion threshold, it is determined that the command competition type of the target service includes the scheduling process competition.
[0084] In the ORACLE database, if the proportion of the number of commands actually being executed to the total number of commands exceeds the second proportion threshold, it means that the system's command execution has a high degree of competition, namely "scheduling process competition". Scheduling process competition refers to the conflict between tasks (also known as commands or jobs) in the ORACLE database when obtaining and using system resources (such as processors, memory, I / O devices, etc.), especially in multi-tasking or concurrent environments. In this case, due to the limited resources, the priority, execution speed, waiting time and other factors between tasks running at the same time may cause some tasks to not get enough resource support for a long time, while other tasks may become more efficient because they are given priority. This will not only affect the efficiency and response time of task execution, but may also lead to uneven distribution of system resources, affecting overall performance and stability.
[0085] It should be noted that in the ORACLE database, each specific task or operation (collectively referred to as "execution command") does not directly interact with the resources of the entire ORACLE database, but is coordinated and allocated through an intermediate management component, namely the "multi-instance scheduler". This scheduler is responsible for dispatching specific tasks to the most appropriate data processing unit or instance to run based on factors such as the current state of the system, resource availability, and task requirements. These "data volume instances" refer to physical or logical computing nodes that can independently process data operations. They may be distributed in different locations on the network or on the same server.
[0086] It should also be noted that "the rollback segment buffer executes rollback commands through multiple rollback segments" does not conflict with "the execution command is connected to different data volume instances through a multi-instance scheduler to execute the execution command", because the operation of the rollback segment and the scheduling of the execution command are two independent levels. The rollback segment is used for transaction management and data recovery, while the scheduler of the execution command is responsible for resource allocation and task execution. In the ORACLE database, commands need to be executed, and the success or failure of the command may trigger a rollback operation. Therefore, even if the commands are executed concurrently and distributed on multiple instances, an effective rollback mechanism is still required to ensure data consistency. Each execution command can still be assigned to the appropriate instance through the multi-instance scheduler to run, and at the same time, if a rollback is required, the corresponding rollback operation (using the rollback segment) can still be executed independently and accurately.
[0087] In one possible implementation, the size of the second proportion threshold can be but is not limited to being set to 50%. The present application does not impose specific restrictions on the size of the second proportion threshold, and the user can adjust the size of the second proportion threshold according to actual needs.
[0088] S103: Determine a performance tuning method for the ORACLE database according to the command contention type of the target service and contention data corresponding to the command contention type.
[0089] In the ORACLE database, the command competition type and related competition data for the target business can be used to formulate the corresponding ORACLE database performance tuning strategy. Competition data refers to the specific indicators used to analyze and identify command competition types. These indicators help identify ORACLE database bottlenecks, so as to perform targeted optimization to improve the overall performance of the ORACLE database.
[0090] In a possible implementation, determining the performance tuning method of the ORACLE database according to the command competition type of the target service and the competition data corresponding to the command competition type includes B1-B4:
[0091] B1: If the command competition type of the target business is the free list competition, the performance tuning method of the ORACLE database is determined as follows: determining the number of new lists based on the competition data corresponding to the free list competition, and adding new free lists in the ORACLE database based on the number of new lists.
[0092] In the ORACLE database, if the command contention type of the target business is determined to be free list contention, certain performance tuning strategies can be adopted:
[0093] Determine the number of new lists based on competition data: First, collect and analyze competition data related to free list competition. These data usually include the number of requests and request thresholds (or processing time and time thresholds). Based on these data, you can use proportions or rules of thumb to estimate the number of new lists required.
[0094] Add new free lists to the ORACLE database based on the number of newly added lists: Then, based on the results of the above analysis, if the number of requests continues to be higher than the threshold, or the processing time increases significantly, you can decide to create additional free lists to relieve the pressure. The addition of new lists will disperse the concentrated pressure of requests and improve the flexibility and efficiency of the database response system by increasing resource capacity.
[0095] Through this method, ORACLE database can more effectively deal with the free list competition caused by high-concurrency applications or large data volume operations, thereby improving overall performance and stability. Adjusting the number of free lists is a dynamic process, which is carried out based on monitoring system status and continuous optimization needs to maximize resource utilization efficiency.
[0096] B2: If the command competition type of the target business is the rollback segment competition, the performance tuning method of the ORACLE database is determined as follows: the number of newly added rollback segments is determined based on the competition data corresponding to the rollback segment competition, and new rollback segments are added to the rollback segment buffer based on the number of newly added rollback segments.
[0097] If the command contention type of the target business is identified as rollback segment contention, this usually indicates that the rollback segment resource requirements in the ORACLE database are too high when processing transaction rollback operations. In this context, the performance tuning strategy of the ORACLE database will take optimization measures based on the following steps:
[0098] Determine the rollback segment contention data: First, determine the ratio of the waiting execution time to the execution time, and the first ratio threshold.
[0099] Optimize the number of rollback segments based on contention data: Then, the number of new rollback segments required can be calculated based on the degree of contention and the load of the ORACLE database.
[0100] Add new rollback segments: After the calculation, the next step is to increase the number of new rollback segments in the rollback segment buffer. This operation is intended to improve the processing efficiency of rollback operations and reduce the waiting time caused by resource constraints, thereby improving the overall database response speed and transaction processing capabilities.
[0101] This optimization method can effectively improve the database's performance in handling transaction rollbacks, ensuring that when a transaction fails and needs to be rolled back, the database can complete this mechanism quickly and efficiently, reducing the impact on system performance.
[0102] In a possible implementation, the number of rollback segments is usually set according to the following table:
[0103]
[0104] B3: If the command competition type of the target business is the log buffer competition, the performance tuning method of the ORACLE database is determined as follows: determining the amount of newly added storage space based on the competition data corresponding to the log buffer competition, and increasing the size of the log buffer based on the newly added storage space.
[0105] In the ORACLE database, if the command competition type of the target business is identified as log buffer competition, it means that the database has encountered a bottleneck when processing redo log records. In this case, the performance tuning strategy is to determine how to increase the storage capacity of the log buffer by evaluating specific competition data.
[0106] Specifically, first, the competition data corresponding to the log buffer competition can be determined, including the difference between the size of the redo log and the size of the available log buffer space (the larger the difference, the more log records are waiting to be written to the disk, and the closer to the space limit of the log buffer), as well as the difference threshold. Then, based on the competition data corresponding to the log buffer competition, the amount of additional storage space is determined. This process usually involves evaluating the size of the existing log buffer, comparing the current usage level, the expected peak load, and business needs, and calculating a suitable new capacity. By increasing this part of the storage, the pressure of redo log queuing can be reduced, and the processing efficiency and response speed of the database can be improved. Finally, the size of the log buffer is increased based on the additional storage space. The entire process is usually accompanied by monitoring the operating status of the database to ensure that the new configuration can effectively improve performance after being put into production and will not introduce new problems.
[0107] B4: If the command competition type of the target business is the scheduling process competition, the performance tuning method of the ORACLE database is determined as follows: based on the competition data corresponding to the scheduling process competition, the number of newly added multi-instance schedulers is determined, and based on the number of newly added multi-instance schedulers, a new multi-instance scheduler is added to the ORACLE database.
[0108] When the command competition type of the target business is determined to be scheduling process competition, this indicates that a bottleneck has occurred in the resource allocation or management of the multi-instance scheduler when processing a large number of execution commands. Specifically, this type of competition means that the ratio between the commands being executed and the total number of all commands exceeds a preset second ratio threshold. This indicates that the current system's scheduling structure may not be able to effectively and timely handle the influx of concurrent requests.
[0109] In this case, the performance tuning method is to alleviate this competition pressure by increasing the number of multi-instance schedulers. The logic of this strategy is based on improving the system's ability to distribute and manage execution tasks: by introducing additional scheduler instances, more parallel processing capabilities can be provided, waiting queues can be reduced, and ultimately the overall response speed and performance can be improved.
[0110] The specific steps to add a multi-instance scheduler are as follows:
[0111] Determine the number of new schedulers: First, calculate the number of new schedulers required based on the competition data corresponding to the scheduling process competition (i.e., the ratio of the number of commands being executed to the number of all commands being executed) and the known second ratio threshold. This calculation process usually needs to consider factors such as the current database load, the target performance improvement, and other resource constraints.
[0112] Add new schedulers: After determining the number of new schedulers, actually deploy these new multi-instance schedulers in the ORACLE database.
[0113] Optimize resource allocation: When adding schedulers, you also need to optimize resource allocation strategies based on the overall needs of the system and the existing resource status to ensure that each scheduler can run efficiently and effectively handle the tasks assigned to them.
[0114] This approach can not only directly solve the problems caused by scheduling process competition, but also reserve space for future business growth and achieve long-term performance stability and scalability.
[0115] S104: Optimizing the performance of the ORACLE database based on the performance tuning method.
[0116] Optimizing the performance of the ORACLE database based on the performance tuning method means adopting determined, targeted strategies and technical means to improve the performance of the ORACLE database.
[0117] For example, in the case of scheduling process competition, the number of multi-instance schedulers can be increased to enable more efficient parallel processing, reduce task queuing time, and further improve system processing capabilities and overall performance.
[0118] The goal of performance tuning is to ensure that the database can efficiently handle daily business loads through continuous monitoring, analysis, and adjustment of the database, while maintaining good performance and stability when dealing with sudden high loads, ultimately achieving the goal of improving user experience, optimizing resource utilization efficiency, and reducing operating costs.
[0119] In a possible implementation, the method further includes C1-C3:
[0120] C1: querying the hit rate of all the execution commands in the global area (System Global Area, SGA) of the ORACLE database.
[0121] After all execution commands of the target task in the ORACLE database are executed, you can also tune the memory of the ORACLE database (memory mainly refers to SGA). First, you need to measure and analyze the hit rate of executing commands in the ORACLE database SGA, which specifically involves two key components: library cache area and dictionary cache area.
[0122] Overall hit rate: The first thing to calculate is the total hit rate of all executed commands in the SGA. This is determined by comparing the number of total executed commands with the number of mobile commands that hit the SGA, that is, the ratio of the number of commands that do not find the relevant execution items in the cache and need to be accessed from the outside (such as disk) to the total number of executed commands.
[0123] Library cache hit rate: For the library cache, this query focuses on whether the compiled version, parsed result, or execution plan of the execution command exists in the internal cache without additional I / O operations. The so-called "first hit command" refers to those execution commands whose compiled version, parsed result, or execution plan is in the library cache.
[0124] Dictionary cache hit rate: Similar to the library cache hit rate, queries against the dictionary cache focus on those data structures or information whose associated data structures or information are in the cache, so each execution needs to be obtained from external resources. Here, the "second hit command" refers to the execution command that exists in the dictionary cache.
[0125] The core purpose of the entire task is to evaluate the impact of the current SGA configuration, especially the library cache and dictionary cache on performance. Low hit rates may indicate that these caches are insufficient and need to be optimized or expanded to reduce I / O operations, improve data retrieval speed and overall system performance. Through this detailed hit rate analysis, database administrators can adjust cache strategies in a targeted manner, such as increasing cache size, optimizing data preloading, and other measures to improve database response speed and efficiency.
[0126] C2: If the hit rate of the library cache area is less than the hit rate threshold, determine the expansion amount of the library cache area based on the hit rate of the library cache area, and expand the library cache area based on the expansion amount of the library cache area.
[0127] If the hit rate of the library cache (i.e., the proportion of executed commands that hit the cache) is lower than a preset hit rate threshold, then the amount by which the library cache needs to be expanded is determined by comparing the current library cache hit rate with the hit rate threshold. This expansion amount is calculated based on the difference between the current hit rate and the threshold. Based on the calculated expansion amount, the library cache is then physically or configured to be expanded accordingly. This may include increasing memory size, upgrading hardware, or adjusting cache policies.
[0128] C3: If the hit rate of the dictionary cache area is less than the hit rate threshold, determine the expansion amount of the dictionary cache area based on the hit rate of the dictionary cache area, and expand the dictionary cache area based on the expansion amount of the dictionary cache area.
[0129] Similarly, when the hit rate of the dictionary cache is also lower than the hit rate threshold set in the same way, it means that the cache may not be able to effectively store and quickly access its internal data structure or information. At this time, the same method is used to determine an expansion amount based on the comparison result of the hit rate of the dictionary cache and its threshold. Then, based on this expansion amount, the capacity of the dictionary cache is adjusted or expanded. This helps to improve the execution efficiency of the database, especially for tasks involving frequent lookups and accesses to dictionary cache data.
[0130] It should be noted that the present application does not impose any specific restrictions on the size of the hit rate threshold, and the user can adjust the size of the hit rate threshold according to actual needs.
[0131] It should also be noted that in the ORACLE database, SGA is a memory area that stores various shared data, including the shared pool, Java pool, redo log buffer, large pool and PGA (Program Global Area), etc. It has a crucial impact on database performance because most database operations are performed in the cache executed in the SGA.
[0132] Based on the contents of S101-S104, it can be known that multiple execution commands of the same target business can be obtained from the ORACLE database, and the command competition type of the business can be determined based on these commands. Then, according to the command competition type of the target business and its corresponding competition data, a corresponding performance tuning strategy is formulated, and these competition data include indicators for identifying the command competition type. Finally, based on the determined performance tuning strategy, the ORACLE database is optimized. Compared with the traditional tuning strategy based on general rules, the optimization method of the present application has a significant advantage in its high flexibility and pertinence. By deeply analyzing the competition relationship between execution commands in a specific business environment, the performance bottleneck of the ORACLE database can be accurately identified, thereby implementing a more accurate resource allocation and optimization strategy. The present application effectively avoids the ineffective use of resources, not only saves costs, but also ensures the continuous optimization of database performance and adapts to dynamically changing business needs. And it can adjust the optimization plan in real time according to the actual operation situation to ensure efficient operation under different conditions, and ultimately achieve better performance improvement and resource utilization efficiency.
[0133] See also Figure 2 , Figure 2 This is a schematic diagram of the structure of a database optimization device provided in an embodiment of the present application. Figure 2 As shown, the database optimization device includes:
[0134] The acquisition unit 201 is used to acquire multiple execution commands in an Oracle database ORACLE database; the multiple execution commands are from the same target business;
[0135] A first determining unit 202, configured to determine a command contention type of the target service based on the multiple execution commands;
[0136] A second determining unit 203 is used to determine the performance tuning method of the ORACLE database according to the command competition type of the target business and the competition data corresponding to the command competition type; the competition data includes an indicator for determining the command competition type;
[0137] The performance optimization unit 204 is used to optimize the performance of the ORACLE database based on the performance tuning method.
[0138] In a possible implementation, the command contention types include free list contention, rollback segment contention, log buffer contention, and scheduling process contention.
[0139] In a possible implementation, the first determining unit 202 specifically includes:
[0140] A third determining unit, for determining that the command competition type of the target service includes the free list competition, if the number of times any free list in the ORACLE database is requested is greater than a request threshold or the processing time of any free list is greater than a time threshold;
[0141] A fourth determination unit, if the execution command includes a rollback command, and the ratio of the waiting execution time of the rollback command in the rollback segment buffer to the execution time is greater than a first proportion threshold, then the command competition type for determining the target business includes the rollback segment competition; the waiting execution time includes the waiting execution time of all rollback commands in the rollback segment buffer; the execution time includes the time from the rollback segment buffer receiving the first rollback command to the execution of the last rollback command; the rollback segment buffer executes the rollback command through multiple rollback segments;
[0142] A fifth determining unit, if the execution command includes a redo command, and the difference between the size of the redo log corresponding to the redo command and the size of the available log buffer space storage space of the log buffer in the ORACLE database is greater than a difference threshold, then the command competition type for determining the target business includes the log buffer competition; the available log buffer space represents the amount of space remaining in the log buffer that can be used to store new log information;
[0143] The sixth determination unit, if the ratio of the number of execution commands being executed to the number of all the execution commands is greater than the second proportion threshold, then the command competition type used to determine the target business includes the scheduling process competition; the execution command is connected to different data volume instances through a multi-instance scheduler to execute the execution command.
[0144] In a possible implementation, the second determining unit 203 specifically includes:
[0145] A seventh determination unit, if the command competition type of the target business is the free list competition, is used to determine the performance tuning method of the ORACLE database by: determining the number of newly added lists based on the competition data corresponding to the free list competition, and adding a new free list to the ORACLE database based on the number of newly added lists; the competition data corresponding to the free list competition includes the number of requests and the request threshold, or the processing time and the time threshold;
[0146] An eighth determination unit, if the command competition type of the target business is the rollback segment competition, is used to determine the performance tuning method of the ORACLE database by: determining the number of newly added rollback segments based on the competition data corresponding to the rollback segment competition, and adding new rollback segments in the rollback segment buffer based on the number of newly added rollback segments; the competition data corresponding to the rollback segment competition includes the ratio of the waiting execution time to the execution time and the first proportion threshold;
[0147] A ninth determination unit, if the command competition type of the target business is the log buffer competition, is used to determine the performance tuning method of the ORACLE database by: determining the amount of newly added storage space based on the competition data corresponding to the log buffer competition, and increasing the size of the log buffer based on the newly added storage space; the competition data corresponding to the log buffer competition includes the difference between the size of the redo log and the size of the available log buffer space storage space and the difference threshold;
[0148] The tenth determination unit, if the command competition type of the target business is the scheduling process competition, is used to determine the performance tuning method of the ORACLE database as follows: determining the number of newly added multi-instance schedulers based on the competition data corresponding to the scheduling process competition, and adding a new multi-instance scheduler to the ORACLE database based on the number of newly added multi-instance schedulers; the competition data corresponding to the scheduling process competition includes the ratio of the number of execution commands being executed to the number of all the execution commands and the second proportion threshold.
[0149] In a possible implementation manner, the device further includes:
[0150] A query unit, used for querying the hit rate of all the execution commands in the global area SGA of the ORACLE database; the SGA includes a library cache area and a dictionary cache area; the hit rate includes a library cache area hit rate and a dictionary cache area hit rate; the library cache area hit rate includes a ratio of the number of first hit commands to the number of all the execution commands; the dictionary cache area hit rate includes a ratio of the number of second hit commands to the number of all the execution commands; the first hit command includes the execution command whose database execution item exists in the library cache area; the second hit command includes the execution command whose database execution item exists in the dictionary cache area; the database execution item includes a compiled version, a parsed result and / or an execution plan of the execution command.
[0151] A first integration unit, if the hit rate of the library cache area is less than a hit rate threshold, is used to determine an expansion amount of the library cache area based on the hit rate of the library cache area, and expand the library cache area based on the expansion amount of the library cache area;
[0152] The second integration unit is used to determine the expansion amount of the dictionary cache area based on the hit rate of the dictionary cache area if the hit rate of the dictionary cache area is less than the hit rate threshold, and expand the dictionary cache area based on the expansion amount of the dictionary cache area.
[0153] In a possible implementation, the rollback segment includes a public rollback segment and a private rollback segment.
[0154] In addition, an embodiment of the present application also provides a database optimization device, including: a memory, a processor, and a computer program stored in the memory and executable on the processor, and when the processor executes the computer program, the database optimization method described above is implemented.
[0155] In addition, an embodiment of the present application further provides a computer-readable storage medium, in which instructions are stored. When the instructions are executed on a terminal device, the terminal device executes the database optimization method as described above.
[0156] The embodiment of the present application provides a database optimization device, first using an acquisition unit 201 to acquire multiple execution commands from the same target business from an ORACLE database, and using a first determination unit 202 to determine the command competition type of the target business based on the multiple execution commands. The second determination unit 203 determines the performance tuning method of the ORACLE database according to the command competition type of the target business and the competition data corresponding to the command competition type, wherein the competition data includes an indicator for determining the command competition type. Then, the performance optimization unit 204 is used to optimize the performance of the ORACLE database based on the determined performance tuning method. Compared with the tuning method based on general rules, the present application more accurately responds to different business characteristics and realizes efficient resource utilization. By identifying the "command competition type" between execution commands, the ORACLE database bottleneck can be diagnosed to avoid invalid resource increase. Compared with blindly improving resource allocation, the present application scientifically allocates resources, effectively reduces unnecessary hardware and software costs, and ensures performance at the same time. In addition, the continuous acquisition and analysis of execution commands enables the method to monitor changes in business models, adjust optimization strategies in a timely manner, and ensure continuous optimization of database performance in a dynamic environment.
[0157] The above is a detailed introduction to a database optimization method, device, equipment and storage medium provided by the present application. The various embodiments in the specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same and similar parts between the embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part description. It should be pointed out that for ordinary technicians in this technical field, without departing from the principles of the present application, several improvements and modifications can be made to the present application, and these improvements and modifications also fall within the scope of protection of the claims of the present application.
[0158] It should be understood that in this application, "at least one (item)" means one or more, and "plurality" means two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the objects associated before and after are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.
[0159] It should also be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.
Claims
1. A database optimization method, characterized in that: The method comprises: Acquire multiple execution commands in an Oracle database ORACLE database; the multiple execution commands are from the same target business; Determining a command contention type of the target service based on the multiple execution commands; Determining a performance tuning method for the ORACLE database according to a command competition type of the target business and competition data corresponding to the command competition type; the competition data includes an indicator for determining the command competition type; Optimizing the performance of the ORACLE database based on the performance tuning method; The command competition types include free list competition, rollback segment competition, log buffer competition and scheduling process competition; The determining, based on the multiple execution commands, the command contention type of the target service includes: If the number of times any free list in the ORACLE database is requested is greater than the request threshold or the processing time of any free list is greater than the time threshold, it is determined that the command competition type of the target service includes the free list competition; If the execution command includes a rollback command, and the ratio of the waiting execution time of the rollback command in the rollback segment buffer to the execution time is greater than the first ratio threshold, it is determined that the command competition type of the target business includes the rollback segment competition; the waiting execution time includes the waiting execution time of all rollback commands in the rollback segment buffer; the execution time includes the time from the rollback segment buffer receiving the first rollback command to the execution of the last rollback command; the rollback segment buffer executes the rollback command through multiple rollback segments; If the execution command includes a redo command, and the difference between the size of the redo log corresponding to the redo command and the size of the available log buffer space storage space of the log buffer in the ORACLE database is greater than the difference threshold, it is determined that the command competition type of the target business includes the log buffer competition; the available log buffer space represents the amount of space remaining in the log buffer that can be used to store new log information; If the ratio of the number of execution commands being executed to the number of all the execution commands is greater than a second proportion threshold, it is determined that the command competition type of the target business includes the scheduling process competition; the execution command is connected to different data volume instances through a multi-instance scheduler to execute the execution command.
2. The method according to claim 1, characterized in that The determining, according to the command competition type of the target business and the competition data corresponding to the command competition type, a performance tuning method of the ORACLE database includes: If the command competition type of the target business is the free list competition, the performance tuning method of the ORACLE database is determined as follows: determining the number of newly added lists based on competition data corresponding to the free list competition, and adding a new free list to the ORACLE database based on the number of newly added lists; the competition data corresponding to the free list competition includes the number of requests and the request threshold, or the processing time and the time threshold; If the command competition type of the target business is the rollback segment competition, the performance tuning method of the ORACLE database is determined as follows: determining the number of newly added rollback segments based on competition data corresponding to the rollback segment competition, and adding new rollback segments to the rollback segment buffer based on the number of newly added rollback segments; the competition data corresponding to the rollback segment competition includes the ratio of the waiting execution time to the execution time and the first proportion threshold; If the command competition type of the target business is the log buffer competition, the performance tuning method of the ORACLE database is determined as follows: determining the amount of newly added storage space based on competition data corresponding to the log buffer competition, and increasing the size of the log buffer based on the newly added storage space; the competition data corresponding to the log buffer competition includes the difference between the size of the redo log and the size of the available log buffer space storage space and the difference threshold; If the command competition type of the target business is the scheduling process competition, the performance tuning method of the ORACLE database is determined as follows: the number of newly added multi-instance schedulers is determined based on the competition data corresponding to the scheduling process competition, and a new multi-instance scheduler is added to the ORACLE database based on the number of newly added multi-instance schedulers; the competition data corresponding to the scheduling process competition includes the ratio of the number of execution commands being executed to the number of all the execution commands and the second proportion threshold.
3. The method according to claim 1, characterized in that: The method further comprises: Query the hit rate of all the execution commands in the global area SGA of the ORACLE database; the SGA includes a library cache area and a dictionary cache area; the hit rate includes a library cache area hit rate and a dictionary cache area hit rate; the library cache area hit rate includes a ratio of the number of first hit commands to the number of all the execution commands; the dictionary cache area hit rate includes a ratio of the number of second hit commands to the number of all the execution commands; the first hit command includes the execution command whose database execution item exists in the library cache area; the second hit command includes the execution command whose database execution item exists in the dictionary cache area; the database execution item includes a compiled version, a parsing result and / or an execution plan of the execution command; If the hit rate of the library cache area is less than the hit rate threshold, determining an expansion amount of the library cache area based on the hit rate of the library cache area, and expanding the library cache area based on the expansion amount of the library cache area; If the hit rate of the dictionary cache area is less than the hit rate threshold, an expansion amount of the dictionary cache area is determined based on the hit rate of the dictionary cache area, and the dictionary cache area is expanded based on the expansion amount of the dictionary cache area.
4. The method according to claim 1, characterized in that The rollback segment includes a public rollback segment and a private rollback segment.
5. A database optimization device, characterized in that: The device comprises: An acquisition unit, used for acquiring a plurality of execution commands in an Oracle database ORACLE database; the plurality of execution commands are from the same target business; A first determining unit, configured to determine a command contention type of the target service based on the multiple execution commands; A second determining unit is used to determine the performance tuning method of the ORACLE database according to the command competition type of the target business and the competition data corresponding to the command competition type; the competition data includes an indicator for determining the command competition type; A performance optimization unit, used for optimizing the performance of the ORACLE database based on the performance tuning method; The command competition types include free list competition, rollback segment competition, log buffer competition and scheduling process competition; The first determining unit 202 specifically includes: A third determining unit, for determining that the command competition type of the target service includes the free list competition, if the number of times any free list in the ORACLE database is requested is greater than a request threshold or the processing time of any free list is greater than a time threshold; A fourth determination unit, if the execution command includes a rollback command, and the ratio of the waiting execution time of the rollback command in the rollback segment buffer to the execution time is greater than a first proportion threshold, then the command competition type for determining the target business includes the rollback segment competition; the waiting execution time includes the waiting execution time of all rollback commands in the rollback segment buffer; the execution time includes the time from the rollback segment buffer receiving the first rollback command to the execution of the last rollback command; the rollback segment buffer executes the rollback command through multiple rollback segments; A fifth determining unit, if the execution command includes a redo command, and the difference between the size of the redo log corresponding to the redo command and the size of the available log buffer space storage space of the log buffer in the ORACLE database is greater than a difference threshold, then the command competition type for determining the target business includes the log buffer competition; the available log buffer space represents the amount of space remaining in the log buffer that can be used to store new log information; The sixth determination unit, if the ratio of the number of execution commands being executed to the number of all the execution commands is greater than the second proportion threshold, then the command competition type used to determine the target business includes the scheduling process competition; the execution command is connected to different data volume instances through a multi-instance scheduler to execute the execution command.
6. A database optimization device, characterized in that: include: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the method for optimizing a database as described in any one of claims 1 to 4 is implemented.
7. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores instructions, and when the instructions are executed on a terminal device, the terminal device executes the database optimization method according to any one of claims 1 to 4.
Citation Information
Patent Citations
Cloud compute scheduling using a heuristic contention model
CA2928801A1
Task processing method, device and equipment and computer readable storage medium
CN111400330A