CN112783732B - Database table capacity monitoring method and device - Google Patents

Database table capacity monitoring method and device Download PDF

Info

Publication number
CN112783732B
CN112783732B CN202110128401.5A CN202110128401A CN112783732B CN 112783732 B CN112783732 B CN 112783732B CN 202110128401 A CN202110128401 A CN 202110128401A CN 112783732 B CN112783732 B CN 112783732B
Authority
CN
China
Prior art keywords
database table
time node
capacity
current time
early warning
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202110128401.5A
Other languages
Chinese (zh)
Other versions
CN112783732A (en
Inventor
乔波
陆照信
徐建斌
刘琨
张子君
葛志赟
何涛
张宁子
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Agricultural Bank of China
Original Assignee
Agricultural Bank of China
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Agricultural Bank of China filed Critical Agricultural Bank of China
Priority to CN202110128401.5A priority Critical patent/CN112783732B/en
Publication of CN112783732A publication Critical patent/CN112783732A/en
Application granted granted Critical
Publication of CN112783732B publication Critical patent/CN112783732B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3003Monitoring arrangements specially adapted to the computing system or computing system component being monitored
    • G06F11/302Monitoring arrangements specially adapted to the computing system or computing system component being monitored where the computing system component is a software system
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3065Monitoring arrangements determined by the means or processing involved in reporting the monitored data
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/32Monitoring with visual or acoustical indication of the functioning of the machine
    • G06F11/324Display of status information
    • G06F11/327Alarm or error message display
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • G06F16/2282Tablespace storage structures; Management thereof

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Quality & Reliability (AREA)
  • Computing Systems (AREA)
  • Mathematical Physics (AREA)
  • Software Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The application discloses a method and a device for monitoring the capacity of a database table, comprising the following steps: collecting target information of a database table of a target time node; the target time node includes a current time node and a previous time node. And determining the maximum available capacity of the database table of the current time node and the type of the database table of the current time node according to the target information of the database table of the current time node. And determining the used capacity of the database table of the target time node according to the target information of the database table of the target time node. And calculating the capacity utilization rate of the database table of the current time node and the capacity increment rate of the database table according to the maximum available capacity of the database table of the current time node and the used capacity of the database table of the target time node. When the database table meets the early warning conditions according to the capacity utilization rate, the capacity growth rate and the type of the database table of the current time node, an early warning signal is generated, and the high efficiency and the accuracy of the capacity monitoring of the database table are improved.

Description

Database table capacity monitoring method and device
Technical Field
The present application relates to the field of computer technologies, and in particular, to a method and an apparatus for monitoring a database table capacity.
Background
The large-scale banks in China construct a core business system based on the large-scale host computers, and can meet business operation requirements after data are concentrated. The data set is strict with respect to the capacity of the database. The database contains tens of thousands of tables, each of which has the maximum available space. The full capacity of any table may cause transaction congestion of the whole core service system.
Currently, the capacity of a database table is monitored by calculating the usage of the database table, setting a table usage threshold. When the usage rate of the database table exceeds the usage rate threshold, an early warning signal is generated, and a technician carries out corresponding treatment on the database table generating the early warning signal.
However, the database table is monitored only by means of the use rate of the database table, so that the accuracy is low, and false early warning can occur.
Disclosure of Invention
In order to solve the technical problems, the application provides a database table capacity monitoring method and device, which are used for monitoring the database table capacity from multiple dimensions so as to improve the high efficiency and accuracy of the database table capacity monitoring.
In order to achieve the above object, the technical solution provided by the embodiments of the present application is as follows:
the embodiment of the application provides a method for monitoring the capacity of a database table, which comprises the following steps:
Collecting target information of the database table of a target time node; the target information comprises application attribute information, record number and parameter information; the target time node comprises a current time node and a previous time node;
determining the maximum available capacity of the database table of the current time node and the type of the database table of the current time node according to the target information of the database table of the current time node;
determining the used capacity of the database table of the target time node according to the target information of the database table of the target time node;
calculating to obtain the capacity utilization rate of the database table of the current time node and the capacity growth rate of the database table of the current time node according to the maximum available capacity of the database table of the current time node and the used capacity of the database table of the target time node;
and generating an early warning signal when determining that the database table meets the early warning condition according to the capacity utilization rate of the database table of the current time node, the capacity growth rate of the database table of the current time node and the type of the database table of the current time node.
Optionally, the types of the database tables include a fast table and a regular table; when the database table meets the early warning condition according to the capacity utilization rate of the database table of the current time node, the capacity growth rate of the database table of the current time node and the type of the database table of the current time node, an early warning signal is generated, and the method comprises the following steps:
Generating an early warning signal when the capacity utilization rate of the database table of the current time node exceeds a maximum capacity utilization rate threshold value and/or the capacity growth rate of the database table of the current time node exceeds a maximum capacity growth rate threshold value;
generating an early warning signal when the capacity utilization rate of the database table of the current time node accords with a preset capacity utilization range and the capacity growth rate of the database table of the current time node accords with a preset capacity growth range; the preset capacity use range is a range between a minimum capacity use rate threshold value and a maximum capacity use rate threshold value; the preset capacity increase range is a range between a minimum capacity increase rate threshold value and a maximum capacity increase rate threshold value;
generating an early warning signal when the capacity utilization rate of the database table of the current time node is smaller than the minimum capacity utilization rate threshold, the capacity growth rate of the database table of the current time node accords with a preset capacity growth range, and the type of the database table of the current time node is a fast table;
and when the capacity growth rate of the database table of the current time node is smaller than the minimum capacity growth rate threshold, the capacity utilization rate of the database table of the current time node accords with a preset capacity utilization range, and the type of the database table of the current time node is a fast table, generating an early warning signal.
Optionally, the determining the maximum available capacity of the database table of the current time node and the type of the database table of the current time node according to the target information of the database table of the current time node includes:
calculating the maximum available capacity of the database table of the current time node according to the parameter information of the database table of the current time node;
and determining the type of the database table of the current time node according to the application attribute information of the database table of the current time node.
Optionally, the determining the used capacity of the database table of the target time node according to the target information of the database table of the target time node includes:
and calculating the used capacity of the database table of the target time node according to the record number of the database table of the target time node and the space occupied by each record number.
Optionally, the calculating to obtain the capacity usage rate of the database table of the current time node and the capacity growth rate of the database table of the current time node according to the maximum available capacity of the database table of the current time node and the used capacity of the database table of the target time node includes:
Calculating the ratio of the used capacity of the database table of the current time node to the maximum available capacity of the database table of the current time node to obtain the capacity utilization rate of the database table of the current time node;
and calculating the capacity increment rate of the database table of the current time node according to the used capacity of the database table of the current time node, the used capacity of the database table of the previous time node and the maximum available capacity of the database table of the current time node.
Optionally, the determining the type of the database table of the current time node according to the application attribute information of the database table of the current time node includes:
when the application attribute information of the database table of the current time node comprises any one of important transaction access, the access number of the database table exceeds a preset access value and the database table is switched daily, determining that the database table of the current time node is a fast table, otherwise, determining that the database table of the current time node is a conventional table.
The embodiment of the application also provides a database table capacity monitoring device, which comprises:
the acquisition unit is used for acquiring target information of the database table of the target time node; the target information comprises application attribute information, record number and parameter information; the target time node comprises a current time node and a previous time node;
A first determining unit, configured to determine a maximum available capacity of the database table of the current time node and a type of the database table of the current time node according to target information of the database table of the current time node;
a second determining unit, configured to determine an used capacity of the database table of the target time node according to target information of the database table of the target time node;
a calculation unit, configured to calculate, according to the maximum available capacity of the database table of the current time node and the used capacity of the database table of the target time node, a capacity usage rate of the database table of the current time node and a capacity growth rate of the database table of the current time node;
and the early warning unit is used for generating an early warning signal when the database table meets the early warning condition according to the capacity utilization rate of the database table of the current time node, the capacity growth rate of the database table of the current time node and the type of the database table of the current time node.
Optionally, the early warning unit includes:
the first early warning subunit is used for generating an early warning signal when the capacity utilization rate of the database table of the current time node exceeds a maximum capacity utilization rate threshold value and/or the capacity growth rate of the database table of the current time node exceeds a maximum capacity growth rate threshold value;
The second early warning subunit is used for generating an early warning signal when the capacity utilization rate of the database table of the current time node accords with a preset capacity utilization range and the capacity growth rate of the database table of the current time node accords with a preset capacity growth range; the preset capacity use range is a range between a minimum capacity use rate threshold value and a maximum capacity use rate threshold value; the preset capacity increase range is a range between a minimum capacity increase rate threshold value and a maximum capacity increase rate threshold value;
the third early warning subunit is used for generating an early warning signal when the capacity utilization rate of the database table of the current time node is smaller than the minimum capacity utilization rate threshold value, the capacity growth rate of the database table of the current time node accords with a preset capacity growth range, and the type of the database table of the current time node is a fast table;
and the fourth early warning subunit is used for generating an early warning signal when the capacity growth rate of the database table of the current time node is smaller than the minimum capacity growth rate threshold value, the capacity utilization rate of the database table of the current time node accords with a preset capacity utilization range, and the type of the database table of the current time node is a fast table.
Optionally, the first determining unit includes:
a first calculating subunit, configured to calculate, according to parameter information of a database table of the current time node, a maximum available capacity of the database table of the current time node;
and the determining subunit is used for determining the type of the database table of the current time node according to the application attribute information of the database table of the current time node.
Optionally, the computing unit includes:
a second calculating subunit, configured to calculate a ratio of an available capacity of the database table of the current time node to a maximum available capacity of the database table of the current time node, and obtain a capacity usage rate of the database table of the current time node;
and the third calculation subunit is used for calculating the capacity increment rate of the database table of the current time node according to the used capacity of the database table of the current time node, the used capacity of the database table of the previous time node and the maximum available capacity of the database table of the current time node.
According to the technical scheme, the application has the following beneficial effects:
the embodiment of the application provides a method and a device for monitoring the capacity of a database table, wherein the method comprises the following steps: collecting target information of a database table of a target time node; the target information includes application attribute information, record number and parameter information; the target time node includes a current time node and a previous time node. And determining the maximum available capacity of the database table of the current time node and the type of the database table of the current time node according to the target information of the database table of the current time node. And determining the used capacity of the database table of the target time node according to the target information of the database table of the target time node. And calculating the capacity utilization rate of the database table of the current time node and the capacity increment rate of the database table of the current time node according to the maximum available capacity of the database table of the current time node and the used capacity of the database table of the target time node. And generating an early warning signal when the database table is determined to be in accordance with the early warning condition according to the capacity utilization rate of the database table of the current time node, the capacity growth rate of the database table of the current time node and the type of the database table of the current time node. The method comprises the steps of judging the data table capacity of a current time node by collecting and utilizing three-dimensional data, namely the utilization rate of the data table of the current time node, the growth rate of the data table of the current time node and the type of the data table of the current time node, collecting and analyzing data from multiple dimensions, and giving an early warning signal, wherein early warning is efficient and accurate. The high efficiency and the accuracy of the database table capacity monitoring are improved.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings that are required in the embodiments or the description of the prior art will be briefly described, and it is obvious that the drawings in the following description are some embodiments of the present application, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flowchart of a method for monitoring database table capacity according to an embodiment of the present application;
FIG. 2 is a flowchart of another method for monitoring database capacity according to an embodiment of the present application;
fig. 3 is a schematic diagram of a database table capacity monitoring device according to an embodiment of the present application.
Detailed Description
In order that the above-recited objects, features and advantages of the present application will become more readily apparent, a more particular description of embodiments of the application will be rendered by reference to the appended drawings and appended drawings.
Referring to fig. 1, fig. 1 is a flowchart of a method for monitoring a database table capacity according to an embodiment of the present application. As shown in fig. 1, the method includes steps S101-S105:
s101: collecting target information of a database table of a target time node; the target information includes application attribute information, record number and parameter information; the target time node includes a current time node and a previous time node.
And establishing a monitoring database, and placing the acquired target information of the database table of the target time node into the database. The target time node includes a current time node and a previous time node. The target information includes application attribute information, the number of records, and parameter information. In addition, the target information of the database table also comprises information such as the establishment time of the database table, the latest recombination maintenance time and the like. It will be appreciated that the monitoring database contains target information of at least one data table, and the database table in S101 is a table.
As one example, the target information is RTS information. The RTS information includes application attribute information, record number, and parameter information. The record number is the number of records in the data table. It should be noted that, the system will automatically update RTS information every half an hour according to the actual situation. It will be appreciated that the update time of the RTS information is fixed.
The time between the current time node and the previous time node is the time corresponding to the fixed period. The method comprises the steps of acquiring target information of a database table of a target time node, wherein the acquisition of target information of a database table of a previous time node and the acquisition of target information of a database table of a current time node are included. It will be appreciated that the target information of the database table is collected, i.e. once every fixed period. In this embodiment, the fixed period may be selected according to practical situations, which is not limited herein. For example, the fixed period is 1 hour, and then the target information of the database table is collected from the system to the built database every 1 hour. In one embodiment, the specific implementation is to perform scanning inspection on target information of tens of thousands of tables every 1 hour to obtain target information of all data tables, so that efficient and accurate management and control are realized.
S102: and determining the maximum available capacity of the database table of the current time node and the type of the database table of the current time node according to the target information of the database table of the current time node.
After the target information of the database table of the current time node is obtained, the maximum available capacity of the database table of the current time node and the type of the database table of the current time node can be determined according to the target information of the database table of the current time node.
Specifically, determining the maximum available capacity of the database table of the current time node and the type of the database table of the current time node according to the target information of the database table of the current time node includes:
calculating the maximum available capacity of the database table of the current time node according to the parameter information of the database table of the current time node;
and determining the type of the database table of the current time node according to the application attribute information of the database table of the current time node.
The physical space of the data table is not infinitely extended, and an upper limit of the physical space extension of the data table is defined when parameter setting of the data table is established, wherein the upper limit of the physical space extension of the data table is the maximum available capacity.
In specific implementation, calculating the maximum available capacity of the database table of the current time node according to the parameter information of the database table of the current time node comprises the following steps:
Calculating the maximum available capacity of the database table according to SEGSIZE, DSSIZE, PARTITION and BUFFEROOL of the database table; the parameter information of the database table includes SEGSIZE, DSSIZE, PARTITION and buffersol of the database table.
In some embodiments, the information of SEGSIZE, DSSIZE, PARTITION, BUFFEROOL of the table is obtained from the system by SQL statement, if the parameters are changed or there is a new table, the parameters are updated in time. The maximum available capacity of the database table is calculated according to SEGSIZE, DSSIZE, PARTITION and BUFFEROOL of the database table, specifically as follows:
(1) If parameter is equal to 0, it represents that the data table is a non-partitioned table, then the maximum available space of the data table= (DSSIZE 1024 x 1024) K.
(2) If the parameter is greater than 0, it represents that the data table is a partition table, and when BUFFERPOOL is equal to BP32K, the maximum available space of the data table= (segize 1024 1.5) K; wherein BUFFERPOOL defines the physical space size of each page of the data table. BP32K represents a physical space size of 32K per page of the data table.
(3) If parameter is greater than 0 and BUFFERPOOL is not equal to BP32K, the maximum available space of the data table= (segize 1024K).
It should be noted that the types of database tables include a fast table and a regular table. In specific implementation, determining the type of the database table of the current time node according to the application attribute information of the database table of the current time node comprises the following steps:
When the application attribute information of the database table of the current time node comprises any one of important transaction access, the access number of the database table exceeds a preset access value and the database table is switched on a daily basis, determining that the database table of the current time node is a fast table, otherwise, determining that the database table is a conventional table.
The application attribute information of the express sheet is not limited to any one of important transaction access, the number of accesses to the database table exceeding a preset access value, and daily switching of the database table. The application attribute information of the fast table can be determined according to actual conditions, and the data table is the fast table as long as the application attribute information of the data table meets the preset application attribute. For example, when the data table needs to pay attention to due to a specific reason, the type of the data table is a fast table, and the specific reason is a preset application attribute. For another example, when the record of the data table grows faster, and exceeds a preset record growth rate, the data table is a fast table. The record growth rate of the data table exceeds the preset record growth rate, namely belongs to the preset application attribute. For another example, if the transaction insertion data amount of some data tables exceeds the preset data amount, the data table is a fast table. The transaction insertion data amount of the data table exceeds the preset data amount, namely belongs to the preset application attribute. It is understood that the application attribute information is a comprehensive concept.
It should be noted that, in some embodiments, a fast table list is established according to application attribute information of the data table, and the fast table list is modified irregularly along with the change of the service. When the data table belongs to the fast table list, the data table is the fast table.
S103: and determining the used capacity of the database table of the target time node according to the target information of the database table of the target time node.
According to the setting of the database, each time a data table is newly built, the system allocates a dedicated physical space for the data table, and along with the increase of data in the data table, the physical space actually used by the data table is defined as the used capacity of the database table.
Since the target time node includes the previous time node and the current time node, determining the used capacity of the database table of the target time node according to the target information of the database table of the target time node includes:
the method comprises the steps of determining the used capacity of a database table of a previous time node according to target information of the database table of the previous time node, and determining the used capacity of the database table of the current time node according to target information of the database table of the current time node.
In the implementation, the used capacity of the database table of the target time node is calculated according to the record number of the database table of the target time node and the space occupied by each record number. For example, the result of multiplying the number of records of the database table of the current time node by the space occupied by each number of records is the used capacity of the database table of the current time node.
S104: and calculating the capacity utilization rate of the database table of the current time node and the capacity increment rate of the database table of the current time node according to the maximum available capacity of the database table of the current time node and the used capacity of the database table of the target time node.
Calculating the capacity utilization rate of the database table of the current time node and the capacity increment rate of the database table of the current time node according to the maximum available capacity of the database table of the current time node and the used capacity of the database table of the target time node, wherein the method comprises the following steps:
and calculating the ratio of the used capacity of the database table of the current time node to the maximum available capacity of the database table of the current time node, and obtaining the capacity utilization rate of the database table of the current time node. That is, the capacity usage rate s= (the used capacity of the database table of the current time node/the maximum available capacity of the database table of the current time node) ×100% of the database table of the current time node, and the usage rate has two thresholds, i.e., a minimum capacity usage rate threshold S2 and a maximum capacity usage rate threshold S1, respectively. Wherein S2> S1. A capacity usage of the database table of the current time node higher than S2 indicates a very high growth rate, and lower than S1 indicates a lower growth rate.
And calculating the capacity increment rate of the database table of the current time node according to the used capacity of the database table of the current time node, the used capacity of the database table of the previous time node and the maximum available capacity of the database table of the current time node. I.e., the capacity increase rate z= [ (used capacity of the database table of the current time node-used capacity of the database table of the previous time node)/maximum available capacity of the database table of the current time node ] ×100%. There are two thresholds for usage, a minimum capacity growth rate threshold Z1 and a maximum capacity growth rate threshold Z2, respectively. Wherein Z2> Z1. A capacity growth rate of the database table of the current time node higher than Z2 indicates a high growth rate, and lower than Z1 indicates a low growth rate.
S105: and generating an early warning signal when the database table is determined to be in accordance with the early warning condition according to the capacity utilization rate of the database table of the current time node, the capacity growth rate of the database table of the current time node and the type of the database table of the current time node.
When the implementation is carried out, when the database table meets the early warning condition according to the capacity utilization rate of the database table of the current time node, the capacity growth rate of the database table of the current time node and the type of the database table of the current time node, an early warning signal is generated, and the method comprises the following steps:
And generating an early warning signal when the capacity utilization rate of the database table of the current time node exceeds a maximum capacity utilization rate threshold value and/or the capacity growth rate of the database table of the current time node exceeds a maximum capacity growth rate threshold value. If the capacity utilization rate S > S2 of the database table of the current time node indicates that the capacity utilization is about to reach the upper limit, sending out an early warning signal; if the capacity growth rate Z > Z2 of the database table of the current time node indicates that the capacity growth is fast, the abnormal fast capacity growth is indicated, and an early warning signal is directly sent. After sending out the early warning signal, the technician can process the data sheet, and the specific processing modes comprise: cleaning the data table, compressing the data table, expanding the maximum available capacity of the data table, deleting the data table and rebuilding the data table. In some embodiments, the two thresholds of Z and S are set to z1=15%, z2=20%, s1=75%, s2=82%, and both thresholds of Z and S are obtained from a large summary of data analysis and working experience of the technician.
Generating an early warning signal when the capacity utilization rate of the database table of the current time node accords with a preset capacity utilization range and the capacity growth rate of the database table of the current time node accords with a preset capacity growth range; the preset capacity use range is a range between a value larger than the minimum capacity use rate threshold value and a value smaller than the maximum capacity use rate threshold value; the preset capacity increase range is a range between greater than the minimum capacity increase rate threshold and less than the maximum capacity increase rate threshold. Namely Z1< Z2 and S1< S2, the growth rate is higher, the use rate is also higher, and an early warning signal is sent.
When the capacity utilization rate of the database table of the current time node is smaller than the minimum capacity utilization rate threshold, the capacity growth rate of the database table of the current time node accords with the preset capacity growth range, and the type of the database table of the current time node is a fast table, an early warning signal is generated. That is, when S < S1 and Z1< Z2, the growth rate is high, but the usage rate is not high, and if an early warning signal is sent, the type of the data table needs to be introduced to assist the judgment. And when the data table is a fast table, sending out an early warning signal.
When the capacity increasing rate of the database table of the current time node is smaller than the minimum capacity increasing rate threshold, the capacity using rate of the database table of the current time node accords with the preset capacity using range, and the type of the database table of the current time node is a fast table, an early warning signal is generated. That is, Z < Z1 and S1< S < S2 indicate that the capacity growth rate is not high, but the utilization rate is high, and if an early warning signal is sent out, the type of the data table needs to be introduced to assist judgment. And when the data table is a fast table, sending out an early warning signal.
In some implementations, the compute kernel analysis process in S102-S105 may be implemented using SQL and REXX scripts.
By the database capacity monitoring method provided by the embodiment of the application, the judgment of the data table capacity of the current time node is carried out by collecting and utilizing the data of three dimensions, namely the utilization rate of the data table of the current time node, the growth rate of the data table of the current time node and the type of the data table of the current time node, the early warning is efficient and accurate, the data is collected and analyzed from multiple dimensions, and the early warning signal is given. The capacity sensitive data table can be early warned quickly in advance, and the compression resistance and external service capacity of the database are improved. For the table with slow capacity growth, useless early warning is filtered, and manpower and material resources of a data center are saved. In addition, the used capacity of the data table is collected at fixed time intervals and is imported into the monitoring database, so that a certain period of time can be queried at any time, and the used capacity of the data table provides data support for a subsequent formulation scheme. The system resource can be saved, the technical means of printing the used space of the disk information acquisition table in the prior art is not needed, and the consumption of disk I/O can be reduced.
Referring to fig. 2, fig. 2 is a flowchart of another method for monitoring capacity of a database according to an embodiment of the present application. As shown in fig. 2, the method includes steps S201 to S210:
s201: calculating first dimension data: capacity growth rate Z of the data table;
after target information of a database table of a target time node is acquired, first dimension data are calculated: the capacity growth rate Z of the data table of the current time node. The target time node includes a current time node and a previous time node.
S202: judging whether Z is larger than Z2; if yes, jump to S210; if not, jumping to S203;
s203: calculating second dimension data: capacity usage S of the data table;
calculating second dimension data based on the target information of the database table of the target time node: capacity usage S of the data table.
S204: judging whether S is greater than S2; if yes, jump to S210; if not, jumping to S205;
s205: judging whether Z1< Z < Z2 and S1< S < S2 are satisfied at the same time; if yes, jump to S210; if not, jumping to S206;
s206: judging whether Z1< Z < Z2 and S < S1 are satisfied at the same time; if yes, jump to S208; if not, jumping to S207;
s207: judging whether S1< S < S2 and Z < Z1 are satisfied at the same time; if yes, jump to S208; if not, ending;
S208: introducing third dimension data: application attribute information of the data table;
the application attribute information of the data table may also be referred to as a usage attribute. Determining third-dimensional data based on the target information of the database table of the target time node: application attribute information of the data table.
S209: judging whether the data table is a fast table or not;
and judging whether the data table is a fast table according to the application attribute information of the data table.
S210: and (5) carrying out data table capacity early warning.
The method comprises the steps of judging the data table capacity of a current time node by collecting and utilizing three-dimensional data, namely the utilization rate of the data table of the current time node, the growth rate of the data table of the current time node and the type of the data table of the current time node, collecting and analyzing data from multiple dimensions, and giving an early warning signal, wherein early warning is efficient and accurate. The high efficiency and the accuracy of the database table capacity monitoring are improved.
Referring to fig. 3, fig. 3 is a schematic diagram of a database table capacity monitoring device according to an embodiment of the present application. As shown in fig. 3, the apparatus includes:
an acquisition unit 301, configured to acquire target information of the database table of a target time node; the target information comprises application attribute information, record number and parameter information; the target time node comprises a current time node and a previous time node;
A first determining unit 302, configured to determine, according to target information of the database table of the current time node, a maximum available capacity of the database table of the current time node and a category of the database table of the current time node;
a second determining unit 303, configured to determine an used capacity of the database table of the target time node according to target information of the database table of the target time node;
a calculating unit 304, configured to calculate, according to the maximum available capacity of the database table of the current time node and the used capacity of the database table of the target time node, a capacity usage rate of the database table of the current time node and a capacity growth rate of the database table of the current time node;
and the early warning unit 305 is configured to generate an early warning signal when determining that the database table meets an early warning condition according to the capacity utilization rate of the database table of the current time node, the capacity growth rate of the database table of the current time node, and the type of the database table of the current time node.
In some implementations of the embodiments of the present application, the early warning unit 305 includes:
the first early warning subunit is used for generating an early warning signal when the capacity utilization rate of the database table of the current time node exceeds a maximum capacity utilization rate threshold value and/or the capacity growth rate of the database table of the current time node exceeds a maximum capacity growth rate threshold value;
The second early warning subunit is used for generating an early warning signal when the capacity utilization rate of the database table of the current time node accords with a preset capacity utilization range and the capacity growth rate of the database table of the current time node accords with a preset capacity growth range; the preset capacity use range is a range between a minimum capacity use rate threshold value and a maximum capacity use rate threshold value; the preset capacity increase range is a range between a minimum capacity increase rate threshold value and a maximum capacity increase rate threshold value;
the third early warning subunit is used for generating an early warning signal when the capacity utilization rate of the database table of the current time node is smaller than the minimum capacity utilization rate threshold value, the capacity growth rate of the database table of the current time node accords with a preset capacity growth range, and the type of the database table of the current time node is a fast table;
and the fourth early warning subunit is used for generating an early warning signal when the capacity growth rate of the database table of the current time node is smaller than the minimum capacity growth rate threshold value, the capacity utilization rate of the database table of the current time node accords with a preset capacity utilization range, and the type of the database table of the current time node is a fast table.
In some implementations of the embodiments of the present application, the first determining unit 302 includes:
a first calculating subunit, configured to calculate, according to parameter information of a database table of the current time node, a maximum available capacity of the database table of the current time node;
and the determining subunit is used for determining the type of the database table of the current time node according to the application attribute information of the database table of the current time node.
In some implementations of the embodiments of the present application, the computing unit 304 includes:
a second calculating subunit, configured to calculate a ratio of an available capacity of the database table of the current time node to a maximum available capacity of the database table of the current time node, and obtain a capacity usage rate of the database table of the current time node;
and the third calculation subunit is used for calculating the capacity increment rate of the database table of the current time node according to the used capacity of the database table of the current time node, the used capacity of the database table of the previous time node and the maximum available capacity of the database table of the current time node.
According to the database table capacity monitoring device provided by the embodiment of the application, the target information of the database table of the target time node is collected; the target information includes application attribute information, record number and parameter information; the target time node includes a current time node and a previous time node. And determining the maximum available capacity of the database table of the current time node and the type of the database table of the current time node according to the target information of the database table of the current time node. And determining the used capacity of the database table of the target time node according to the target information of the database table of the target time node. And calculating the capacity utilization rate of the database table of the current time node and the capacity increment rate of the database table of the current time node according to the maximum available capacity of the database table of the current time node and the used capacity of the database table of the target time node. And generating an early warning signal when the database table is determined to be in accordance with the early warning condition according to the capacity utilization rate of the database table of the current time node, the capacity growth rate of the database table of the current time node and the type of the database table of the current time node. The data of the three dimensions, namely the utilization rate of the data table of the current time node, the growth rate of the data table of the current time node and the type of the data table of the current time node, are collected and utilized to judge the capacity of the data table of the current time node, the early warning is efficient and accurate, the data is collected and analyzed from a plurality of dimensions, early warning signals are given, and the efficiency and the accuracy of monitoring the capacity of the database table are improved.
From the above description of embodiments, it will be apparent to those skilled in the art that all or part of the steps of the above described example methods may be implemented in software plus necessary general purpose hardware platforms. Based on such understanding, the technical solution of the present application may be embodied essentially or in a part contributing to the prior art in the form of a software product, which may be stored in a storage medium, such as ROM/RAM, a magnetic disk, an optical disk, etc., including several instructions for causing a computer device (which may be a personal computer, a server, or a network communication device such as a media gateway, etc.) to execute the method described in the embodiments or some parts of the embodiments of the present application.
It should be noted that, in the present description, each embodiment is described in a progressive manner, and each embodiment is mainly described in a different manner from other embodiments, and identical and similar parts between the embodiments are all enough to refer to each other. For the method disclosed in the embodiment, since it corresponds to the system disclosed in the embodiment, the description is relatively simple, and the relevant points refer to the system part.
It should also be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the application. Thus, the present application is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (10)

1. A method for monitoring the capacity of a database table, the method comprising:
collecting target information of the database table of a target time node; the target information comprises application attribute information, record number and parameter information; the target time node comprises a current time node and a previous time node; the application attribute information comprises any one of important transaction access, the access number of the database table exceeding a preset access value and daily switching of the database table;
determining the maximum available capacity of the database table of the current time node and the type of the database table of the current time node according to the target information of the database table of the current time node;
determining the used capacity of the database table of the target time node according to the target information of the database table of the target time node;
calculating to obtain the capacity utilization rate of the database table of the current time node and the capacity growth rate of the database table of the current time node according to the maximum available capacity of the database table of the current time node and the used capacity of the database table of the target time node;
generating an early warning signal when determining that the database table meets the early warning condition according to the capacity utilization rate of the database table of the current time node, the capacity growth rate of the database table of the current time node and the type of the database table of the current time node;
The types of the database tables comprise a fast table and a conventional table;
when the database table meets the early warning condition according to the capacity utilization rate of the database table of the current time node, the capacity growth rate of the database table of the current time node and the type of the database table of the current time node, an early warning signal is generated, and the method comprises the following steps:
generating an early warning signal when the capacity utilization rate of the database table of the current time node is smaller than a minimum capacity utilization rate threshold, the capacity growth rate of the database table of the current time node accords with a preset capacity growth range, and the type of the database table of the current time node is a fast table;
generating an early warning signal when the capacity growth rate of the database table of the current time node is smaller than a minimum capacity growth rate threshold, the capacity utilization rate of the database table of the current time node accords with a preset capacity utilization range, and the type of the database table of the current time node is a fast table; the preset capacity use range is a range between a minimum capacity use rate threshold value and a maximum capacity use rate threshold value; the preset capacity increase range is a range between greater than a minimum capacity increase rate threshold and less than a maximum capacity increase rate threshold.
2. The method according to claim 1, wherein the generating the pre-warning signal when the database table meets the pre-warning condition according to the capacity usage rate of the database table of the current time node, the capacity growth rate of the database table of the current time node, and the kind of the database table of the current time node comprises:
generating an early warning signal when the capacity utilization rate of the database table of the current time node exceeds a maximum capacity utilization rate threshold value and/or the capacity growth rate of the database table of the current time node exceeds a maximum capacity growth rate threshold value;
and generating an early warning signal when the capacity utilization rate of the database table of the current time node accords with a preset capacity utilization range and the capacity growth rate of the database table of the current time node accords with a preset capacity growth range.
3. The method according to claim 1, wherein the determining the maximum available capacity of the database table of the current time node and the kind of the database table of the current time node according to the target information of the database table of the current time node includes:
calculating the maximum available capacity of the database table of the current time node according to the parameter information of the database table of the current time node;
And determining the type of the database table of the current time node according to the application attribute information of the database table of the current time node.
4. The method of claim 1, wherein said determining the available capacity of the database table of the target time node from the target information of the database table of the target time node comprises:
and calculating the used capacity of the database table of the target time node according to the record number of the database table of the target time node and the space occupied by each record number.
5. The method according to claim 1, wherein said calculating the capacity usage rate of the database table of the current time node and the capacity growth rate of the database table of the current time node from the maximum available capacity of the database table of the current time node and the used capacity of the database table of the target time node comprises:
calculating the ratio of the used capacity of the database table of the current time node to the maximum available capacity of the database table of the current time node to obtain the capacity utilization rate of the database table of the current time node;
and calculating the capacity increment rate of the database table of the current time node according to the used capacity of the database table of the current time node, the used capacity of the database table of the previous time node and the maximum available capacity of the database table of the current time node.
6. A method according to claim 3, wherein said determining the type of the database table of the current time node according to the application attribute information of the database table of the current time node comprises:
when the application attribute information of the database table of the current time node comprises any one of important transaction access, the access number of the database table exceeds a preset access value and the database table is switched daily, determining that the database table of the current time node is a fast table, otherwise, determining that the database table of the current time node is a conventional table.
7. A database table capacity monitoring apparatus, the apparatus comprising:
the acquisition unit is used for acquiring target information of the database table of the target time node; the target information comprises application attribute information, record number and parameter information; the target time node comprises a current time node and a previous time node; the application attribute information comprises any one of important transaction access, the access number of the database table exceeding a preset access value and daily switching of the database table;
a first determining unit, configured to determine a maximum available capacity of the database table of the current time node and a type of the database table of the current time node according to target information of the database table of the current time node;
A second determining unit, configured to determine an used capacity of the database table of the target time node according to target information of the database table of the target time node;
a calculation unit, configured to calculate, according to the maximum available capacity of the database table of the current time node and the used capacity of the database table of the target time node, a capacity usage rate of the database table of the current time node and a capacity growth rate of the database table of the current time node;
the early warning unit is used for generating an early warning signal when the database table meets the early warning condition according to the capacity utilization rate of the database table of the current time node, the capacity growth rate of the database table of the current time node and the type of the database table of the current time node;
the types of the database tables comprise a fast table and a conventional table;
the early warning unit comprises:
the third early warning subunit is used for generating an early warning signal when the capacity utilization rate of the database table of the current time node is smaller than a minimum capacity utilization rate threshold value, the capacity growth rate of the database table of the current time node accords with a preset capacity growth range, and the type of the database table of the current time node is a fast table;
A fourth early warning subunit, configured to generate an early warning signal when the capacity growth rate of the database table of the current time node is less than a minimum capacity growth rate threshold, the capacity usage rate of the database table of the current time node accords with a preset capacity usage range, and the type of the database table of the current time node is a fast table; the preset capacity use range is a range between a minimum capacity use rate threshold value and a maximum capacity use rate threshold value; the preset capacity increase range is a range between greater than a minimum capacity increase rate threshold and less than a maximum capacity increase rate threshold.
8. The apparatus of claim 7, wherein the pre-warning unit comprises:
the first early warning subunit is used for generating an early warning signal when the capacity utilization rate of the database table of the current time node exceeds a maximum capacity utilization rate threshold value and/or the capacity growth rate of the database table of the current time node exceeds a maximum capacity growth rate threshold value;
and the second early warning subunit is used for generating an early warning signal when the capacity utilization rate of the database table of the current time node accords with a preset capacity utilization range and the capacity growth rate of the database table of the current time node accords with a preset capacity growth range.
9. The apparatus according to claim 7, wherein the first determining unit includes:
a first calculating subunit, configured to calculate, according to parameter information of a database table of the current time node, a maximum available capacity of the database table of the current time node;
and the determining subunit is used for determining the type of the database table of the current time node according to the application attribute information of the database table of the current time node.
10. The apparatus of claim 7, wherein the computing unit comprises:
a second calculating subunit, configured to calculate a ratio of an available capacity of the database table of the current time node to a maximum available capacity of the database table of the current time node, and obtain a capacity usage rate of the database table of the current time node;
and the third calculation subunit is used for calculating the capacity increment rate of the database table of the current time node according to the used capacity of the database table of the current time node, the used capacity of the database table of the previous time node and the maximum available capacity of the database table of the current time node.
CN202110128401.5A 2021-01-29 2021-01-29 Database table capacity monitoring method and device Active CN112783732B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110128401.5A CN112783732B (en) 2021-01-29 2021-01-29 Database table capacity monitoring method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110128401.5A CN112783732B (en) 2021-01-29 2021-01-29 Database table capacity monitoring method and device

Publications (2)

Publication Number Publication Date
CN112783732A CN112783732A (en) 2021-05-11
CN112783732B true CN112783732B (en) 2023-10-10

Family

ID=75759972

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110128401.5A Active CN112783732B (en) 2021-01-29 2021-01-29 Database table capacity monitoring method and device

Country Status (1)

Country Link
CN (1) CN112783732B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104636450A (en) * 2015-01-26 2015-05-20 上海新炬网络信息技术有限公司 Database table space monitoring method
WO2019062189A1 (en) * 2017-09-30 2019-04-04 平安科技(深圳)有限公司 Electronic device, method and system for conducting data table filing processing, and storage medium
CN110287082A (en) * 2019-07-02 2019-09-27 中国工商银行股份有限公司 Database table spatial content monitoring method and device
CN111694816A (en) * 2020-06-15 2020-09-22 中国工商银行股份有限公司 Processing method and device for optimizing database table

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10042674B2 (en) * 2011-09-30 2018-08-07 Teradata Us, Inc. Regulating capacity and managing services of computing environments and systems that include a database

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104636450A (en) * 2015-01-26 2015-05-20 上海新炬网络信息技术有限公司 Database table space monitoring method
WO2019062189A1 (en) * 2017-09-30 2019-04-04 平安科技(深圳)有限公司 Electronic device, method and system for conducting data table filing processing, and storage medium
CN110287082A (en) * 2019-07-02 2019-09-27 中国工商银行股份有限公司 Database table spatial content monitoring method and device
CN111694816A (en) * 2020-06-15 2020-09-22 中国工商银行股份有限公司 Processing method and device for optimizing database table

Also Published As

Publication number Publication date
CN112783732A (en) 2021-05-11

Similar Documents

Publication Publication Date Title
JP7279266B2 (en) Methods and apparatus for storing and querying time series data, and their servers and storage media
CN105207806A (en) Monitoring method and apparatus of distributed service
CN110708212B (en) Method and device for tracking call link in distributed system
CN104778185B (en) Anomaly sxtructure query language SQL statement determines method and server
CN110399389B (en) Data paging query method, device, equipment and storage medium
CN109062769B (en) Method, device and equipment for predicting IT system performance risk trend
CN111143158A (en) Monitoring data real-time storage method and system, electronic equipment and storage medium
CN112764993A (en) Node information collection method, device, equipment and readable storage medium
CN110519263A (en) Anti- brush amount method, apparatus, equipment and computer readable storage medium
CN105429792A (en) User behavior flow obtaining method and device and user behavior analysis method and system
CN112783732B (en) Database table capacity monitoring method and device
CN113592156A (en) Power plant coal quantity scheduling method and device, terminal equipment and storage medium
CN108920098A (en) A kind of storage management system collects method, system and the equipment of information
CN105242873A (en) Method and apparatus for acquiring and storing performance data of cloud computing system
CN109450672B (en) Method and device for identifying bandwidth demand burst
CN110932935A (en) Resource control method, device, equipment and computer storage medium
CN108880883B (en) Method for calculating number of internet access websites based on active and passive data
CN108255710B (en) Script abnormity detection method and terminal thereof
CN110543509A (en) Monitoring system, method and device for user access data and electronic equipment
CN114077532A (en) SQL statement execution efficiency detection method and device
CN113034201A (en) Real-time early warning method, system and computer based on advertisement putting process
CN113568898A (en) Electric power data leakage point completion method, device, equipment and readable storage medium
CN114816770B (en) Universal system for measuring computer service pressure state and implementation method
EP2497256B1 (en) Reducing computational complexity during user data analysis
CN111309835A (en) Processing method, system and equipment for spatial data visualization

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant