CN109726073A - Database monitoring method, device, equipment and readable storage medium storing program for executing - Google Patents

Database monitoring method, device, equipment and readable storage medium storing program for executing Download PDF

Info

Publication number
CN109726073A
CN109726073A CN201810835443.0A CN201810835443A CN109726073A CN 109726073 A CN109726073 A CN 109726073A CN 201810835443 A CN201810835443 A CN 201810835443A CN 109726073 A CN109726073 A CN 109726073A
Authority
CN
China
Prior art keywords
monitoring
database
subitem
default
monitored
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.)
Pending
Application number
CN201810835443.0A
Other languages
Chinese (zh)
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.)
Ping An Technology Shenzhen Co Ltd
Original Assignee
Ping An Technology Shenzhen Co Ltd
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 Ping An Technology Shenzhen Co Ltd filed Critical Ping An Technology Shenzhen Co Ltd
Priority to CN201810835443.0A priority Critical patent/CN109726073A/en
Priority to PCT/CN2018/103337 priority patent/WO2020019405A1/en
Publication of CN109726073A publication Critical patent/CN109726073A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring

Abstract

The present invention provides a kind of database monitoring method, comprising: receives the connection configuration information of database to be monitored, and according to the connection configuration information, configures to the connecting object in default monitoring template set, to obtain current monitor template set;In the database to be monitored, the monitoring SQL statement that subitem is respectively monitored in the current monitor template set is executed, and the monitored results according to each monitoring subitem determine whether trigger data library alarm command;If trigger data library alarm command, the monitored results according to each monitoring subitem generate warning information, and the warning information is sent to alarm group of contacts according to preset alarm mode.The present invention also provides a kind of database monitoring device, equipment and readable storage medium storing program for executing.The present invention can effectively improve the applicability of database monitoring.

Description

Database monitoring method, device, equipment and readable storage medium storing program for executing
Technical field
The present invention relates to the technical field of database monitoring more particularly to a kind of database monitoring method, device, equipment and Readable storage medium storing program for executing.
Background technique
In the operational process of database, need to monitor the operating status of database in real time, including to data The monitoring of library session, database journal, data file fragment, table space and user's access etc., finds the operation of database in real time Abnormal and resource consumption situation can quickly remind user when database is operating abnormally.
Currently, the monitor mode of PostgreSQL (Object-relational Database) is that operation maintenance personnel uses monitoring tools, configuration Monitoring strategies monitoring data library, for the database used under different application systems, operation maintenance personnel needs to configure different prisons Control strategy, the applicability of database monitoring are lower.
Therefore, how to improve the applicability of database monitoring is current urgent problem to be solved.
Summary of the invention
The main purpose of the present invention is to provide a kind of database monitoring method, device, equipment and readable storage medium storing program for executing, purports In the applicability and reliability for improving database monitoring.
To achieve the above object, the present invention provides a kind of database monitoring method, the database monitoring method include with Lower step:
The connection configuration information of database to be monitored is received, and according to the connection configuration information, to default monitoring template The connecting object of concentration is configured, to obtain current monitor template set;
In the database to be monitored, the monitoring SQL statement that subitem is respectively monitored in the current monitor template set is executed, And the monitored results according to each monitoring subitem determine whether trigger data library alarm command;
If trigger data library alarm command, the monitored results according to each monitoring subitem generate warning information, and according to pre- If alarm mode the warning information is sent to alarm group of contacts.
Optionally, according to the connection configuration information, the connecting object in default monitoring template set is configured, to obtain The step of taking current monitor template set include:
The identification field of each connecting object in default monitoring template set, and the identification field according to each connecting object are obtained, The correspondence configuration parameter of each connecting object is obtained from the connection configuration information;
According to the correspondence configuration parameter of each connecting object, the connecting object in default monitoring template set is configured, with Obtain current monitor template set.
Optionally, the step of monitored results according to each monitoring subitem determine whether trigger data library alarm command packet It includes:
It determines in each monitoring subitem and is located in default monitored results group with the presence or absence of the monitored results of at least one monitoring subitem;
If the monitored results that respectively there is at least one monitoring subitem in monitoring subitem are located in default monitored results group, trigger Database alarm command, otherwise not trigger data alarm command.
Optionally, the step of monitored results generation warning information according to each monitoring subitem includes:
Default warning information template is obtained, and the monitored results of each monitoring subitem are filled to the default warning information mould In plate, to generate warning information.
Optionally, the monitored results by each monitoring subitem are filled into the default warning information template, to generate The step of warning information includes:
Obtain the location information of each monitoring subitem in the default warning information template;
According to the location information of each monitoring subitem, affiliated filling of each monitoring subitem in default warning information template is determined Position;
The monitored results of each monitoring subitem are filled into filling position belonging to the correspondence into default warning information template.
Optionally, the database monitoring method further include:
Currently available cpu resource is obtained, and according to currently available cpu resource, determines the execution side of database monitoring operation Formula is single task executive mode or multitask executive mode;
If the executive mode of database monitoring operation is single task executive mode, the monitoring of a monitoring subitem is executed every time SQL statement;
If the executive mode of database monitoring operation is multitask executive mode, determined according to currently available cpu resource It is synchronous to execute number of tasks, and according to the synchronous execution number of tasks, execute the monitoring SQL statement of the monitoring subitem of corresponding number.
Optionally, described to determine that synchronous the step of executing page number includes: according to currently available cpu resource
The mapping table of the currently available cpu resource that acquisition prestores and synchronous execution number of tasks, and closed from the mapping It is to inquire synchronous execution number of tasks corresponding with currently available cpu resource in table.
In addition, to achieve the above object, the present invention also provides a kind of database monitoring device, the database monitoring device Include:
Configuration module is right for receiving the connection configuration information of database to be monitored, and according to the connection configuration information Connecting object in default monitoring template set is configured, to obtain current monitor template set;
Execution module, for executing in the current monitor template set and respectively monitoring subitem in the database to be monitored Monitoring SQL statement, and according to it is each monitoring subitem monitored results determine whether trigger data library alarm command;
Alarm module, if being used for trigger data library alarm command, the monitored results according to each monitoring subitem generate alarm Information, and the warning information is sent to alarm group of contacts according to preset alarm mode.
In addition, to achieve the above object, the present invention also provides a kind of database monitoring equipment, the database monitoring equipment Including processor, memory and it is stored in the database monitor that can be executed on the memory and by the processor, When wherein the database monitor is executed by the processor, realize such as the step of above-mentioned database monitoring method.
In addition, to achieve the above object, the present invention also provides a kind of readable storage medium storing program for executing, being deposited on the readable storage medium storing program for executing Database monitor is contained, wherein realizing that above-mentioned database such as is supervised when the database monitor is executed by processor The step of prosecutor method.
The present invention provides a kind of database monitoring method, device, equipment and readable storage medium storing program for executing, and the present invention receives to be monitored The connection configuration information of database, and according to connection configuration information, the connecting object in default monitoring template set is configured, To obtain current monitor template set;In database to be monitored, the monitoring SQL that subitem is respectively monitored in current monitor template set is executed Sentence, and the monitored results according to each monitoring subitem determine whether trigger data library alarm command;If the alarm of trigger data library refers to It enables, then the monitored results according to each monitoring subitem generate warning information, and send warning information according to preset alarm mode Alarm group of contacts is given, template set is monitored by setting, monitoring template set is used in PostgreSQL database under each application system Monitoring, do not need operation maintenance personnel configuration monitoring strategy, only need simple configuration database connecting object, can be realized The monitoring of PostgreSQL database, the effective deployment difficulty for lowering monitoring, improves the applicability of database monitoring.
Detailed description of the invention
Fig. 1 is the hardware structural diagram for the database monitoring equipment that various embodiments of the present invention are related to;
Fig. 2 is the flow diagram of database monitoring method first embodiment of the present invention;
Fig. 3 is the flow diagram of database monitoring method second embodiment of the present invention;
Fig. 4 is the functional block diagram of database monitoring device first embodiment of the present invention.
The embodiments will be further described with reference to the accompanying drawings for the realization, the function and the advantages of the object of the present invention.
Specific embodiment
It should be appreciated that the specific embodiments described herein are merely illustrative of the present invention, it is not intended to limit the present invention.
The present embodiments relate to database monitoring method be mainly used in database monitoring equipment, the database monitoring Equipment, which can be PC (personal computer personal computer), portable computer, mobile terminal etc., has display and processing The equipment of function.
Referring to Fig.1, Fig. 1 is the hardware structural diagram of database monitoring equipment involved in the embodiment of the present invention. In the embodiment of the present invention, database monitoring equipment may include (such as the central processing unit Central of processor 1001 Processing Unit, CPU), communication bus 1002, user interface 1003, network interface 1004, memory 1005.Wherein, Communication bus 1002 is for realizing the connection communication between these components;User interface 1003 may include display screen (Display), input unit such as keyboard (Keyboard);Network interface 1004 optionally may include that the wired of standard connects Mouth, wireless interface (such as WI-FI interface);Memory 1005 can be high speed RAM memory, be also possible to stable memory (non-volatile memory), such as magnetic disk storage, memory 1005 optionally can also be independently of aforementioned processor 1001 storage device.It will be understood by those skilled in the art that hardware configuration shown in Fig. 1 is not constituted to limit of the invention It is fixed, it may include perhaps combining certain components or different component layouts than illustrating more or fewer components.
With continued reference to Fig. 1, the memory 1005 in Fig. 1 as a kind of readable storage medium storing program for executing may include operating system, net Network communication module and database monitor.In Fig. 1, network communication module is mainly used for connecting server, with server Carry out data communication;And processor 1001 can call the database monitor stored in memory 1005, and execute this hair The database monitoring method that bright embodiment provides.
The embodiment of the invention provides a kind of database monitoring methods.
It is the flow diagram of database monitoring method first embodiment of the present invention referring to Fig. 2, Fig. 2.
In the present embodiment, which is realized by database monitoring equipment, which can be with It is the terminal devices such as PC, palm PC and tablet computer, is chosen as equipment shown in FIG. 1, the database monitoring method includes Following steps:
Step S101 receives the connection configuration information of database to be monitored, and according to connection configuration information, to default monitoring Connecting object in template set is configured, to obtain current monitor template set;
Step S102 executes the monitoring SQL language that subitem is respectively monitored in current monitor template set in database to be monitored Sentence, and the monitored results according to each monitoring subitem determine whether trigger data library alarm command;
Step S103, if trigger data library alarm command, the monitored results according to each monitoring subitem generate warning information, And warning information is sent to alarm group of contacts according to preset alarm mode.
Currently, the monitor mode of PostgreSQL database is that operation maintenance personnel uses monitoring tools, configuration monitoring strategy prison Database is controlled, for the database used under different application systems, operation maintenance personnel needs to configure different monitoring strategies, data The applicability and reliability of library monitoring are lower, influence the monitoring efficiency of database.In view of the above problem, proposed in the present embodiment A kind of database monitoring method, the specific steps of database monitoring method described in detail below:
Step S101 receives the connection configuration information of database to be monitored, and according to connection configuration information, to default monitoring Connecting object in template set is configured, to obtain current monitor template set;
In the present embodiment, when monitoring the configuration-direct of monitoring data collection of operation maintenance personnel triggering, equipment display connection Object configuration interface, and receive the connection configuration for the database to be monitored that operation maintenance personnel is inputted based on the connecting object configuration interface Information.Wherein, which includes but is not limited to grouping, system where the said system of database to be monitored, system Affiliated function or subsidiary, alarm group of contacts, PostgreSQL database host IP, PostgreSQL database host port, Database-name, database login user and database login password, the connecting object configuration interface show object oriented and Parameter declaration, and grouping, system affiliated function or subsidiary where the said system of database to be monitored, system and alarm connection The parameter declaration of group is alarm satellite information, and PostgreSQL database host IP, PostgreSQL database host port, The parameter declaration of database-name, database login user and database login password is monitoring data library configuration information.
Equipment receives the connection configuration information of database to be monitored, and according to connection configuration information, to default monitoring template The connecting object of concentration is configured, to obtain current monitor template set, i.e., to the data to be monitored in default monitoring template set Said system, the grouping of system place, system affiliated function or the subsidiary in library, alarm group of contacts, PostgreSQL database master Machine IP, PostgreSQL database host port, database-name, database login user and database login password are matched It sets.
Wherein, presetting monitoring template set includes but is not limited to the monitoring SQL statement of database availability monitor subitem, application SQL execution efficiency monitors monitoring SQL statement, the database of the monitoring SQL statement of subitem, background job executive condition monitoring subitem Connection number monitors the monitoring SQL statement of subitem and the monitoring SQL statement of Database lock monitoring subitem.Database availability monitor Whether the monitoring SQL statement of subitem can receive external request for monitoring data library, monitors subitem using SQL execution efficiency Monitoring SQL statement be used to pass through database snapshot information, it is determined whether there are what execution efficiency was lower than default efficiency to apply SQL And for obtaining the current execution time for applying SQL by pg_stat_activity view, it is determined whether exist and currently hold The row time is more than specified duration using SQL;The monitoring SQL statement that background job executive condition monitors subitem is used for Function quartzchk is created in PostgreSQL database, is recalled function select*from quartzchk inquiry backstage and is made Industry executive condition;Current connection sum of the monitoring SQL statement of database connection number monitoring subitem for monitoring data library accounts for number It whether is more than given threshold according to the ratio of the maximum allowable connection number in library;The monitoring SQL statement of Database lock monitoring subitem is for supervising When controlling whether database Database lock occurs, and Database lock occur, pass through pg_locks and pg_stat_activity view It is associated inquiry, refines each SQL statement lock status.
Specifically, equipment obtains the identification field of each connecting object in default monitoring template set, and according to each connecting object Identification field, the correspondence configuration parameter of each connecting object is obtained from the connection configuration information, i.e., connection configuration information in Configuration parameter and identification field have corresponding relationship, can be inquired by the identification field of each connecting object and get each connecting object Correspondence configuration parameter, then according to the correspondence configuration parameter of each connecting object, to the connecting object in default monitoring template set It is configured, to obtain current monitor template set, i.e., is configured the design parameter of each connecting object in default monitoring template set For corresponding configuration parameter.
Step S102 executes the monitoring SQL language that subitem is respectively monitored in current monitor template set in database to be monitored Sentence, and the monitored results according to each monitoring subitem determine whether trigger data library alarm command;
In the present embodiment, in configuring default template set after the connecting object of database to be monitored, equipment is wait supervise It controls in database, executes the monitoring SQL statement for respectively monitoring subitem in current monitor template set, and the monitoring according to each monitoring subitem As a result determine whether trigger data library alarm command.Specifically, the monitoring SQL statement of database availability monitor subitem is executed, Whether monitoring data library can receive external request, if external request can not be received by monitoring database, monitor knot Fruit is that database access is abnormal, if monitoring database can receive external request, monitored results are database access Normally;
The monitoring SQL statement using SQL execution efficiency monitoring subitem is executed, monitoring data library SNAPSHOT INFO, statistics is recently SQL executive condition is applied in given number of days, it is determined whether is lower than the application SQL of default efficiency there are execution efficiency and is passed through Pg_stat_activity view obtains the current execution time for applying SQL, it is determined whether there are current execution times more than finger Timing it is long apply SQL, be lower than the application SQL of default efficiency if there is execution efficiency or there are current execution times to be more than Specified duration applies SQL, then monitored results are that execution efficiency is lower than the application SQL of default efficiency or current execution time is more than Specified duration applies SQL, i.e. SQL execution efficiency is abnormal, if default effect is respectively above or be equal to using the execution efficiency of SQL Rate, and be respectively no more than specified duration using the current execution time of SQL, then monitored results are that SQL execution efficiency is normal;
The monitoring SQL statement for executing background job executive condition monitoring subitem, creates letter in PostgreSQL database Number quartzchk recalls function select*from quartzchk inquiry background job executive condition, and monitored results are Backstage effect executive condition;Wherein, using first create function quartzchk, recall function select*from When the mode of quartzchk inquires background job executive condition, when can avoid system of the monitoring without background job, the SQL of appearance Sentence reports an error phenomenon, improves applicability;
The monitoring SQL statement of database connection number monitoring subitem is executed, the current connection sum in monitoring data library accounts for data Whether the ratio of the maximum allowable connection number in library is more than preset threshold, if the current connection sum of database accounts for database maximum and permits Perhaps the ratio of connection number is more than preset threshold, then monitored results are the connection number of each user, and database excess load, if data The ratio that the current connection sum in library accounts for the maximum allowable connection number of database is no more than given threshold, then monitored results are database Non- excess load;
The monitoring SQL statement of Database lock monitoring subitem is executed, whether there is the SQL language of lock status in monitoring data library Sentence, if there are the SQL statements of lock status for database, is associated by pg_locks and pg_stat_activity view Inquiry, refines the lock status of the SQL statement, and monitored results include the affairs letter of the PID for generating the process locked, latching mode and lock Breath does not generate monitored results if the SQL statement of lock status is not present in database, wherein latching mode includes AccessShareLock、RowShareLock、RowExclusiveLock、ShareUpdateExclusiveLock、 ShareLock, ShareRowExclusiveLock, ExclusiveLock and AccessExclusiveLock etc..
Specifically, equipment, which determines in each monitoring subitem, is located at default prison with the presence or absence of the monitored results of at least one monitoring subitem It controls in result group, if the monitored results that respectively there is at least one monitoring subitem in monitoring subitem are located in default monitored results group, Trigger data library alarm command, otherwise trigger data alarm command, i.e., the monitored results of each monitoring subitem are not located at default In monitored results group, then not trigger data alarm command.It should be noted that above-mentioned default monitored results group can be by this field skill Art personnel are configured based on actual conditions, and the present embodiment is not especially limited this.
Step S103, if trigger data library alarm command, the monitored results according to each monitoring subitem generate warning information, And warning information is sent to alarm group of contacts according to preset alarm mode.
In the present embodiment, if trigger data library alarm command, the monitored results according to each monitoring subitem generate alarm Information, and the warning information is sent to alarm group of contacts according to preset alarm mode.Specifically, default warning information is obtained Template, and the monitored results of each monitoring subitem are filled into the default warning information template, to generate warning information, that is, obtain The location information of each monitoring subitem in the default warning information template, and the location information according to each monitoring subitem are taken, is determined Affiliated filling position of each monitoring subitem in default warning information template, and the monitored results of each monitoring subitem are filled to pre- If filling position belonging to the correspondence in warning information template, to generate warning information.Wherein, warning information includes but is not limited to institute Grouping, system affiliated function or subsidiary, alarm group of contacts and exception information where category system, system, and the exception information packet Include but be not limited to database disconnect, the low SQL language using SQL, background job executive condition and lock status of execution efficiency Sentence, the alarm mode include but is not limited to mail alarm, short message alarm and warning by telephone.
In the present embodiment, the present invention receives the connection configuration information of database to be monitored, and according to connection configuration information, right Connecting object in default monitoring template set is configured, to obtain current monitor template set;In database to be monitored, execute The monitoring SQL statement of subitem is respectively monitored in current monitor template set, and the monitored results according to each monitoring subitem determine whether to touch Send out database alarm command;If trigger data library alarm command, the monitored results according to each monitoring subitem generate warning information, And warning information is sent to alarm group of contacts according to preset alarm mode, template set is monitored by setting, monitors template set It is used in the monitoring of PostgreSQL database under each application system, does not need operation maintenance personnel configuration monitoring strategy, is only needed simple Configuration database connecting object, the monitoring of PostgreSQL database can be realized, the effective deployment difficulty for lowering monitoring, Improve the applicability of database monitoring.
Further, referring to Fig. 3, it is based on above-mentioned first embodiment, proposes the second of database monitoring method of the present invention Embodiment, the difference with previous embodiment be, the database monitoring method further include:
Step 104 obtains currently available cpu resource, and according to currently available cpu resource, determines that database monitoring operates Executive mode be single task executive mode or multitask executive mode;
In the present embodiment, equipment obtains currently available cpu resource, and according to currently available cpu resource, determines that database is supervised The executive mode of control operation is single task executive mode or multitask executive mode, specially determines currently available cpu resource Whether it is more than default cpu resource, if currently available cpu resource is more than default cpu resource, can determines that database monitoring is grasped The executive mode of work is multitask executive mode, if currently available cpu resource is less than default cpu resource, can be determined The executive mode of database monitoring operation is single task executive mode.
If the executive mode of step 105, database monitoring operation is multitask executive mode, according to currently available CPU Resource determines synchronous execution number of tasks, and according to the synchronous execution number of tasks, executes the monitoring of the monitoring subitem of corresponding number SQL statement.
In the present embodiment, if the executive mode of database monitoring operation is multitask executive mode, foundation currently may be used With cpu resource determine it is synchronous execute number of tasks, that is, obtain the currently available cpu resource that prestores and the mapping of synchronous execution page number Relation table, and from mapping table, synchronous execution number of tasks corresponding with currently available cpu resource is inquired, and according to synchronization Number of tasks is executed, executes the monitoring SQL statement of the monitoring subitem of corresponding number, i.e. equipment executes sequence according to default, wait supervise It controls in database, executes and the monitoring SQL statement of the synchronous monitoring subitem for executing number of tasks corresponding number.If database monitoring The executive mode of operation is single task executive mode, then executes the monitoring SQL statement of a monitoring subitem every time, i.e., equipment is according to pre- If executing sequence, in database to be monitored, the monitoring SQL statement that subitem is respectively monitored in current monitor template set is executed.It needs Illustrate, above-mentioned default execution sequence can be configured by those skilled in the art based on actual conditions, and the present embodiment is to this It is not especially limited.
Wherein, default cpu resource can be arranged according to CPU total resources, or be arranged according to specific needs by user.When When cpu resource is less than default cpu resource, it can be determined according to the mapping relations that can be used between cpu resource and synchronization page quantity The synchronization page quantity that can be performed simultaneously, such as in mapping relations, when available cpu resource is less than A, what correspondence can be performed simultaneously Synchronization page quantity is 2;When available cpu resource is more than or equal to A, is less than B, synchronization page number that correspondence can be performed simultaneously Amount is 3;When available cpu resource is more than or equal to B, is less than C, the synchronization page quantity that correspondence can be performed simultaneously is 4, In, A < B < C.
In the present embodiment, the present invention determines the prison of the synchronous monitoring subitem executed by the currently available cpu resource of equipment SQL statement is controlled, equipment can be performed simultaneously the monitoring SQL statement of multiple monitoring subitems, effective to improve database monitoring efficiency.
In addition, the embodiment of the present invention also provides a kind of database monitoring device.
It is the functional block diagram of database monitoring device first embodiment of the present invention referring to Fig. 4, Fig. 4.
Database monitoring device of the present invention is virtual bench, is stored in the memory of database monitoring equipment shown in Fig. 1 It is functional for realizing the institute of database monitor in 1005;Receive the connection configuration information of database to be monitored, and foundation The connection configuration information configures the connecting object in default monitoring template set, to obtain current monitor template set;? In the database to be monitored, the monitoring SQL statement that subitem is respectively monitored in the current monitor template set is executed, and according to each prison The monitored results of control subitem determine whether trigger data library alarm command;If trigger data library alarm command, according to each monitoring The monitored results of subitem generate warning information, and the warning information is sent to alarm connection according to preset alarm mode Group.
Specifically, in the present embodiment, the database monitoring device includes:
Configuration module 101 matches confidence for receiving the connection configuration information of database to be monitored, and according to the connection Breath configures the connecting object in default monitoring template set, to obtain current monitor template set;
Execution module 102, for executing in the database to be monitored, respectively monitoring is sub in the current monitor template set The monitoring SQL statement of item, and the monitored results according to each monitoring subitem determine whether trigger data library alarm command;
Alarm module 103, if being used for trigger data library alarm command, the monitored results according to each monitoring subitem, which generate, is accused Alert information, and the warning information is sent to alarm group of contacts according to preset alarm mode.
Further, the configuration module 101 is also used to:
The identification field of each connecting object in default monitoring template set, and the identification field according to each connecting object are obtained, The correspondence configuration parameter of each connecting object is obtained from the connection configuration information;
According to the correspondence configuration parameter of each connecting object, the connecting object in default monitoring template set is configured, with Obtain current monitor template set.
Further, the execution module 102 is also used to:
It determines in each monitoring subitem and is located in default monitored results group with the presence or absence of the monitored results of at least one monitoring subitem;
If the monitored results that respectively there is at least one monitoring subitem in monitoring subitem are located in default monitored results group, trigger Database alarm command, otherwise not trigger data alarm command.
Further, the alarm module 103 is also used to:
Default warning information template is obtained, and the monitored results of each monitoring subitem are filled to the default warning information mould In plate, to generate warning information.
Further, the alarm module 103 is also used to:
Obtain the location information of each monitoring subitem in the default warning information template;
According to the location information of each monitoring subitem, affiliated filling of each monitoring subitem in default warning information template is determined Position;
The monitored results of each monitoring subitem are filled into filling position belonging to the correspondence into default warning information template.
Further, the database monitoring device further include:
Determining module determines database monitoring for obtaining currently available cpu resource, and according to currently available cpu resource The executive mode of operation is single task executive mode or multitask executive mode;
The execution module 102, if the executive mode for being also used to database monitoring operation is single task executive mode, often The secondary monitoring SQL statement for executing a monitoring subitem;
The execution module 102, if the executive mode for being also used to database monitoring operation is multitask executive mode, according to Synchronous execution number of tasks is determined according to currently available cpu resource, and according to the synchronous execution number of tasks, executes the prison of corresponding number Control the monitoring SQL statement of subitem.
Further, the execution module, is also used to:
The mapping table of the currently available cpu resource that acquisition prestores and synchronous execution number of tasks, and closed from the mapping It is to inquire synchronous execution number of tasks corresponding with currently available cpu resource in table.
Wherein, the function of modules is realized and above-mentioned database monitoring method embodiment in above-mentioned database monitoring device In each step it is corresponding, function and realization process no longer repeat one by one here.
In addition, the embodiment of the present invention also provides a kind of readable storage medium storing program for executing.
It is stored with database monitor on readable storage medium storing program for executing of the present invention, wherein the database monitor is processed When device executes, realize such as the step of above-mentioned database monitoring method.
Wherein, database monitor, which is performed realized method, can refer to each of database monitoring method of the present invention A embodiment, details are not described herein again.
It should be noted that, in this document, the terms "include", "comprise" or its any other variant are intended to non-row His property includes, so that the process, method, article or the system that include a series of elements not only include those elements, and And further include other elements that are not explicitly listed, or further include for this process, method, article or system institute it is intrinsic Element.In the absence of more restrictions, the element limited by sentence "including a ...", it is not excluded that including being somebody's turn to do There is also other identical elements in the process, method of element, article or system.
The serial number of the above embodiments of the invention is only for description, does not represent the advantages or disadvantages of the embodiments.
Through the above description of the embodiments, those skilled in the art can be understood that above-described embodiment side Method can be realized by means of software and necessary general hardware platform, naturally it is also possible to by hardware, but in many cases The former is more preferably embodiment.Based on this understanding, technical solution of the present invention substantially in other words does the prior art The part contributed out can be embodied in the form of software products, which is stored in one as described above In storage medium (such as ROM/RAM, magnetic disk, CD), including some instructions are used so that terminal device (it can be mobile phone, Computer, server, air conditioner or network equipment etc.) execute method described in each embodiment of the present invention.
The above is only a preferred embodiment of the present invention, is not intended to limit the scope of the invention, all to utilize this hair Equivalent structure or equivalent flow shift made by bright specification and accompanying drawing content is applied directly or indirectly in other relevant skills Art field, is included within the scope of the present invention.

Claims (10)

1. a kind of database monitoring method, which is characterized in that the database monitoring method the following steps are included:
The connection configuration information of database to be monitored is received, and according to the connection configuration information, in default monitoring template set Connecting object configured, to obtain current monitor template set;
In the database to be monitored, the monitoring SQL statement that subitem is respectively monitored in the current monitor template set is executed, and according to Monitored results according to each monitoring subitem determine whether trigger data library alarm command;
If trigger data library alarm command, the monitored results according to each monitoring subitem generate warning information, and according to preset The warning information is sent to alarm group of contacts by alarm mode.
2. database monitoring method as described in claim 1, which is characterized in that according to the connection configuration information, to default Connecting object in monitoring template set is configured, and includes: the step of current monitor template set to obtain
The identification field of each connecting object in default monitoring template set, and the identification field according to each connecting object are obtained, from institute State the correspondence configuration parameter that each connecting object is obtained in connection configuration information;
According to the correspondence configuration parameter of each connecting object, the connecting object in default monitoring template set is configured, to obtain Current monitor template set.
3. database monitoring method as described in claim 1, which is characterized in that the monitored results according to each monitoring subitem The step of determining whether trigger data library alarm command include:
It determines in each monitoring subitem and is located in default monitored results group with the presence or absence of the monitored results of at least one monitoring subitem;
If the monitored results that respectively there is at least one monitoring subitem in monitoring subitem are located in default monitored results group, trigger data Library alarm command, otherwise not trigger data alarm command.
4. database monitoring method as described in claim 1, which is characterized in that the monitored results according to each monitoring subitem Generate warning information the step of include:
Default warning information template is obtained, and the monitored results of each monitoring subitem are filled to the default warning information template In, to generate warning information.
5. database monitoring method as claimed in claim 4, which is characterized in that the monitored results by each monitoring subitem are filled out It is charged in the default warning information template, to generate warning information the step of includes:
Obtain the location information of each monitoring subitem in the default warning information template;
According to the location information of each monitoring subitem, affiliated filler of each monitoring subitem in default warning information template is determined It sets;
The monitored results of each monitoring subitem are filled into filling position belonging to the correspondence into default warning information template.
6. database monitoring method according to any one of claims 1 to 5, which is characterized in that the database monitoring method Further include:
Currently available cpu resource is obtained, and according to currently available cpu resource, determines that the executive mode of database monitoring operation is No is multitask executive mode;
If the executive mode of database monitoring operation is multitask executive mode, determines and synchronize according to currently available cpu resource Number of tasks is executed, and according to the synchronous execution number of tasks, executes the monitoring SQL statement of the monitoring subitem of corresponding number.
7. database monitoring method as claimed in claim 6, which is characterized in that described to be determined according to currently available cpu resource Synchronizing the step of executing page number includes:
Obtain the mapping table of the currently available cpu resource that prestores with synchronous execution number of tasks, and from the mapping table In, inquire synchronous execution number of tasks corresponding with currently available cpu resource.
8. a kind of database monitoring device, which is characterized in that the database monitoring device includes:
Configuration module, for receiving the connection configuration information of database to be monitored, and according to the connection configuration information, to default Connecting object in monitoring template set is configured, to obtain current monitor template set;
Execution module, for executing the prison for respectively monitoring subitem in the current monitor template set in the database to be monitored SQL statement is controlled, and the monitored results according to each monitoring subitem determine whether trigger data library alarm command;
Alarm module, if being used for trigger data library alarm command, the monitored results according to each monitoring subitem generate warning information, And the warning information is sent to alarm group of contacts according to preset alarm mode.
9. a kind of database monitoring equipment, which is characterized in that the database monitoring equipment include processor, memory and It is stored in the database monitor that can be executed on the memory and by the processor, wherein the database monitor When being executed by the processor, the step of realizing database monitoring method as described in any one of claims 1 to 7.
10. a kind of readable storage medium storing program for executing, which is characterized in that it is stored with database monitor on the readable storage medium storing program for executing, Described in database monitor when being executed by processor, realize the database monitoring as described in any one of claims 1 to 7 The step of method.
CN201810835443.0A 2018-07-26 2018-07-26 Database monitoring method, device, equipment and readable storage medium storing program for executing Pending CN109726073A (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201810835443.0A CN109726073A (en) 2018-07-26 2018-07-26 Database monitoring method, device, equipment and readable storage medium storing program for executing
PCT/CN2018/103337 WO2020019405A1 (en) 2018-07-26 2018-08-30 Database monitoring method, device and apparatus, and computer storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810835443.0A CN109726073A (en) 2018-07-26 2018-07-26 Database monitoring method, device, equipment and readable storage medium storing program for executing

Publications (1)

Publication Number Publication Date
CN109726073A true CN109726073A (en) 2019-05-07

Family

ID=66294587

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810835443.0A Pending CN109726073A (en) 2018-07-26 2018-07-26 Database monitoring method, device, equipment and readable storage medium storing program for executing

Country Status (2)

Country Link
CN (1) CN109726073A (en)
WO (1) WO2020019405A1 (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111737233A (en) * 2020-06-24 2020-10-02 浙江大华技术股份有限公司 Data monitoring method and device
CN112787858A (en) * 2020-12-30 2021-05-11 浙江三维利普维网络有限公司 Data model parameter configuration method and device, electronic device and storage medium
CN113127290A (en) * 2019-12-31 2021-07-16 北京金山云网络技术有限公司 Service operation index monitoring method and device and server
CN113204565A (en) * 2021-05-28 2021-08-03 中国工商银行股份有限公司 Database monitoring method and device
CN115118598A (en) * 2022-06-23 2022-09-27 三六零科技集团有限公司 Information acquisition method, device, equipment and storage medium

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101989283A (en) * 2009-08-04 2011-03-23 中兴通讯股份有限公司 Monitoring method and device of performance of database
CN105427545A (en) * 2015-12-30 2016-03-23 山东中创软件商用中间件股份有限公司 Drools-based equipment warning management method and device
CN106385331A (en) * 2016-09-08 2017-02-08 努比亚技术有限公司 Method and system for monitoring alarm based on log
US20170123890A1 (en) * 2015-10-29 2017-05-04 Commvault Systems, Inc. Monitoring, diagnosing, and repairing a management database in a data storage management system
CN107491371A (en) * 2016-06-13 2017-12-19 阿里巴巴集团控股有限公司 A kind of method and device for monitoring deployment
CN107797866A (en) * 2016-05-31 2018-03-13 广东欧珀移动通信有限公司 The distribution method and mobile terminal and medium product of processor resource
CN108052553A (en) * 2017-11-29 2018-05-18 平安养老保险股份有限公司 Method, apparatus, computer equipment and the storage medium of electronic documentation generation

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101763389B (en) * 2008-12-23 2012-02-08 中兴通讯股份有限公司 Device and method for controlling database resource
JP5691723B2 (en) * 2011-03-25 2015-04-01 富士通株式会社 Monitoring method, information processing apparatus, and monitoring program
WO2013121529A1 (en) * 2012-02-14 2013-08-22 株式会社日立製作所 Computer program and monitoring device

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101989283A (en) * 2009-08-04 2011-03-23 中兴通讯股份有限公司 Monitoring method and device of performance of database
US20170123890A1 (en) * 2015-10-29 2017-05-04 Commvault Systems, Inc. Monitoring, diagnosing, and repairing a management database in a data storage management system
CN105427545A (en) * 2015-12-30 2016-03-23 山东中创软件商用中间件股份有限公司 Drools-based equipment warning management method and device
CN107797866A (en) * 2016-05-31 2018-03-13 广东欧珀移动通信有限公司 The distribution method and mobile terminal and medium product of processor resource
CN107491371A (en) * 2016-06-13 2017-12-19 阿里巴巴集团控股有限公司 A kind of method and device for monitoring deployment
CN106385331A (en) * 2016-09-08 2017-02-08 努比亚技术有限公司 Method and system for monitoring alarm based on log
CN108052553A (en) * 2017-11-29 2018-05-18 平安养老保险股份有限公司 Method, apparatus, computer equipment and the storage medium of electronic documentation generation

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113127290A (en) * 2019-12-31 2021-07-16 北京金山云网络技术有限公司 Service operation index monitoring method and device and server
CN111737233A (en) * 2020-06-24 2020-10-02 浙江大华技术股份有限公司 Data monitoring method and device
CN112787858A (en) * 2020-12-30 2021-05-11 浙江三维利普维网络有限公司 Data model parameter configuration method and device, electronic device and storage medium
CN112787858B (en) * 2020-12-30 2022-05-10 浙江三维利普维网络有限公司 Data model parameter configuration method and device, electronic device and storage medium
CN113204565A (en) * 2021-05-28 2021-08-03 中国工商银行股份有限公司 Database monitoring method and device
CN115118598A (en) * 2022-06-23 2022-09-27 三六零科技集团有限公司 Information acquisition method, device, equipment and storage medium

Also Published As

Publication number Publication date
WO2020019405A1 (en) 2020-01-30

Similar Documents

Publication Publication Date Title
CN109726073A (en) Database monitoring method, device, equipment and readable storage medium storing program for executing
CN109120426B (en) Network slice management method and device and computer readable storage medium
CN107291547B (en) Task scheduling processing method, device and system
CN109471789B (en) Multi-device management method and device for testing, server and storage medium
CN105099739B (en) One kind being based on plug-in type software deployment method, apparatus and application server
CN108256118B (en) Data processing method, device, system, computing equipment and storage medium
CN109582466A (en) A kind of timed task executes method, distributed server cluster and electronic equipment
CN109144559B (en) Update data packet pushing method and server
WO2021203979A1 (en) Operation and maintenance processing method and apparatus, and computer device
CN108600034B (en) Service pressure management method, device, equipment, system and storage medium
CN110308985B (en) Cloud exclusive server resource management method, device, equipment and storage medium
CN103188088A (en) Equipment information acquisition system and equipment information acquisition method
CN111429083A (en) Web front end and system for realizing batch management of RPA robots
CN110677274A (en) Event-based cloud network service scheduling method and device
CN104168326A (en) Server load balancing method and system
CN111143069A (en) Service management method, device, electronic equipment and storage medium
García-Valls et al. Using DDS middleware in distributed partitioned systems
CN110059472A (en) Menu authority configuring method, device, equipment and readable storage medium storing program for executing
CN105843995A (en) Model-driven based IMA system time resource configuration verification method
CN111339194A (en) Automatic scheduling method and device for middleware of database access layer
CN114138506A (en) Message queue scheduling method and device, equipment, medium and product thereof
CN103944940A (en) Equipment and method for dynamically configuring proxy server
Yuan et al. Conceptual model of real-time IoT systems
CN109144676A (en) A kind of self-starting detection method, device and the server of application program
CN109976883A (en) A kind of processing method and its system of task

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
RJ01 Rejection of invention patent application after publication

Application publication date: 20190507

RJ01 Rejection of invention patent application after publication