CN115658420A - Database monitoring method and system - Google Patents

Database monitoring method and system Download PDF

Info

Publication number
CN115658420A
CN115658420A CN202211124460.6A CN202211124460A CN115658420A CN 115658420 A CN115658420 A CN 115658420A CN 202211124460 A CN202211124460 A CN 202211124460A CN 115658420 A CN115658420 A CN 115658420A
Authority
CN
China
Prior art keywords
database
monitoring
data
state
information
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
CN202211124460.6A
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.)
Traffic Control Technology TCT Co Ltd
Original Assignee
Traffic Control Technology TCT 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 Traffic Control Technology TCT Co Ltd filed Critical Traffic Control Technology TCT Co Ltd
Priority to CN202211124460.6A priority Critical patent/CN115658420A/en
Publication of CN115658420A publication Critical patent/CN115658420A/en
Pending legal-status Critical Current

Links

Images

Abstract

The invention provides a database monitoring method and a system, wherein the method comprises the following steps: generating a corresponding monitoring mode according to the system type of the database; monitoring hardware state data and service performance state data of the database according to the monitoring mode to obtain database state monitoring data; and judging the database state monitoring data, and generating corresponding fault warning information according to a judgment result. The invention realizes the omnibearing monitoring of the hardware state data and the service performance state data of the database based on the monitoring mode by uniformly monitoring the multi-database system and generating the corresponding monitoring mode aiming at different types of databases, thereby carrying out real-time monitoring on the database, avoiding the mode of manually and periodically monitoring the database, and improving the efficiency of the database monitoring process and the accuracy of the monitoring result.

Description

Database monitoring method and system
Technical Field
The invention relates to the technical field of database monitoring, in particular to a database monitoring method and a database monitoring system.
Background
An Automatic Train Supervision (ATS) subsystem mainly comprises a series of servers (including a host server and a database server) and related supporting devices, wherein the database server is a safety device in a Communication-Based Train Automatic Control system (CBTC), and mainly stores operation-related data such as a statistical form, playback, alarm, operation record and operation plan, so that various application software Based on the ATS realizes various functions required by the application software by inquiring and downloading real-time data in a database.
The existing database server establishes a redundant protection mechanism through a cluster function, a plurality of database servers run simultaneously, and once a fault occurs, the database servers are directly switched for standby, so that the stability, the integrity and the reliability of the whole system are ensured. The database servers not only meet the relevant functions of the dispatching workstations for completing query, uploading and downloading of operation data, but also need to be connected with databases for application programs of other ATS workstations in the cluster, so that the databases are frequently operated. The server state needs to be regularly observed and maintained aiming at the conditions of the connection number, the storage space overrun and the data volume expansion of the database, however, the scheme that field personnel regularly observe the server is adopted at present, the maintenance difficulty of the field personnel is undoubtedly increased, and the efficiency and the accuracy of the database monitoring process are lower.
Therefore, a database monitoring method and system are needed to solve the above problems.
Disclosure of Invention
Aiming at the problems in the prior art, the invention provides a database monitoring method and a database monitoring system.
The invention provides a database monitoring method, which comprises the following steps:
generating a corresponding monitoring mode according to the system type of the database;
monitoring the hardware state data and the service performance state data of the database according to the monitoring mode to obtain database state monitoring data;
and judging the database state monitoring data, and generating corresponding fault warning information according to a judgment result.
According to the database monitoring method provided by the invention, the generation of the corresponding monitoring mode according to the system type of the database comprises the following steps:
acquiring a system type of a database, wherein the system type comprises an Oracle database or a golden cabin database;
if the database is a cash box database, monitoring a system configuration file and a network configuration file of the database to construct a monitoring mode corresponding to hardware state data;
and if the database is an Oracle database, directly monitoring the hardware information of the database through a preset monitoring component so as to construct a monitoring mode corresponding to the hardware state data.
According to the database monitoring method provided by the invention, the monitoring of the hardware state data and the service performance state data of the database according to the monitoring mode to obtain the database state monitoring data comprises the following steps:
monitoring the CPU state, the disk state and the real-time network card rate of the database to obtain the CPU occupancy rate, the disk use space data and the network rate;
generating corresponding first monitoring data according to the CPU occupancy rate, the disk usage space data and the network rate;
monitoring the service performance state of the database based on the connection information between the database and the application program to obtain the user connection number, the session number and the SQL statement time consumption of the database;
generating corresponding second monitoring data according to the user connection number, the session number and the SQL statement time consumption;
and obtaining database state monitoring data through the first monitoring data and the second monitoring data.
According to the database monitoring method provided by the invention, before the service performance state of the database is monitored based on the connection information between the database and the application program to obtain the user connection number, the session number and the time consumption of SQL statements of the database, the method further comprises the following steps:
if the database is a gold warehouse database, collecting the log information of the database in a preset time period, and acquiring the SQL sentences in the log information.
According to the database monitoring method provided by the invention, before the corresponding monitoring mode is generated according to the system type and the preset monitoring mode of the database, the method further comprises the following steps:
and based on a secure shell protocol, verifying the account information of the database and the password information corresponding to the account information, and if the verification is passed, establishing communication connection with the database so as to monitor the database.
According to the database monitoring method provided by the invention, the judging of the database state monitoring data and the generation of the corresponding fault alarm information according to the judging result comprise the following steps:
comparing the database state monitoring data with a preset monitoring data threshold, judging whether the database state monitoring data is greater than or equal to the preset monitoring data threshold to know that the database has a fault risk, and generating corresponding fault alarm information according to a judgment result;
and generating alarm display information according to the fault alarm information so as to display the alarm display information through a display terminal.
According to the database monitoring method provided by the invention, after the database state monitoring data is judged and the corresponding fault alarm information is generated according to the judgment result, the method further comprises the following steps:
determining a fault type corresponding to the fault warning information;
acquiring fault processing step information according to the fault type;
and displaying the information of the fault processing step through a display terminal.
The invention also provides a database monitoring system, comprising:
the monitoring mode determining module is used for generating a corresponding monitoring mode according to the system type of the database;
the monitoring module is used for monitoring the hardware state data and the service performance state data of the database according to the monitoring mode to obtain database state monitoring data;
and the fault alarm module is used for judging the database state monitoring data and generating corresponding fault alarm information according to a judgment result.
The invention also provides an electronic device, which comprises a memory, a processor and a computer program stored on the memory and capable of running on the processor, wherein the processor executes the program to realize the database monitoring method.
The present invention also provides a non-transitory computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements a database monitoring method as described in any of the above.
According to the database monitoring method and system provided by the invention, the database monitoring process efficiency and the monitoring result accuracy are improved by uniformly monitoring the multiple database systems, generating corresponding monitoring modes aiming at different types of databases and realizing the omnibearing monitoring of the hardware state data and the service performance state data of the databases based on the monitoring modes, so that the databases are monitored in real time, the mode that the databases need to be monitored manually and periodically is avoided.
Drawings
In order to more clearly illustrate the present invention or the technical solutions in the prior art, the drawings used in the embodiments or the description of the prior art will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and other drawings can be obtained by those skilled in the art without creative efforts.
FIG. 1 is a schematic flow chart of a database monitoring method according to the present invention;
FIG. 2 is a schematic diagram of database failure analysis provided by the present invention;
FIG. 3 is a schematic diagram of a database monitoring system according to the present invention;
fig. 4 is a schematic structural diagram of an electronic device provided in the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention clearer, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings, and it is obvious that the described embodiments are some, but not all embodiments of the present invention. All other embodiments, which can be obtained by a person skilled in the art without making any creative effort based on the embodiments in the present invention, belong to the protection scope of the present invention.
With the rapid development of the performance of the database, for different requirements, the database is deployed in different operating systems, and higher requirements are provided for the maintenance and management capabilities of field personnel, in addition, related application tasting of the database needs to be operated within the resource capacity range, when the application tasting is excessively expanded, an alarm is given, the resource alarm depends on a service scene, the situations of false alarm and false alarm exist, the real-time influence is difficult to evaluate, and the performance of the multi-platform database cannot be monitored and centrally controlled.
The invention aims at database systems (Oracle database and KingbaseES) deployed in a multi-operating system (Windows system and Linux system) environment to carry out unified monitoring and alarming, wherein the hardware aspect of the database mainly comprises monitoring measures such as a firewall state, a disk space state, a CPU utilization rate state and a network state; the service performance state mainly includes monitoring measures such as database configuration, session state checking, time-consuming Structured Query Language (SQL) checking, abnormal connection number conditions, database blocking and the like. Moreover, in the invention, corresponding fault processing guidance can be provided for different fault types, so that the fault position can be positioned for field personnel, a solution is provided, end-to-end monitoring and diagnosis are realized, and the field personnel are assisted to position and investigate simple problems.
Fig. 1 is a schematic flow chart of a database monitoring method provided by the present invention, and as shown in fig. 1, the present invention provides a database monitoring method, which includes:
step 101, generating a corresponding monitoring mode according to the system type of the database.
In the present invention, when monitoring a certain database, first, the system type of the database is determined, for example, whether the database is an Oracle database or a gold warehouse database is determined. Because the databases of different system types need to be deployed in the corresponding operating systems, the monitoring mode of the hardware state of the database needs to be set according to the system type of each database, for example, for a coffer database deployed in a Linux system, the current hardware state information of the database needs to be obtained by acquiring the configuration information in the database and calculating by using a related algorithm, so that hardware monitoring and fault analysis are realized; and for an Oracle database deployed in a Windows system, related hardware information can be directly called from the database system through a preset monitoring component.
102, monitoring hardware state data and service performance state data of the database according to the monitoring mode to obtain database state monitoring data;
after the monitoring mode is determined, monitoring is carried out from two aspects of the hardware state and the service performance state of the database by executing the monitoring mode, wherein the hardware state mainly comprises the monitoring of data such as CPU utilization rate, database IO resources, disk state, firewall state, system network state and the like; the service performance state mainly comprises monitoring of information such as application program information of a connection database, an IP address of an application server, the number of user connections, the number of sessions, SQL statement time consumption and the like.
And 103, judging the database state monitoring data, and generating corresponding fault alarm information according to a judgment result.
In the invention, the state data (including the hardware state and the service performance state) obtained by real-time monitoring is judged, so that whether the database at the current moment has a fault or not is quickly obtained, and the condition that the normal operation of the service is influenced by the fault of the database system, such as the conditions of database cluster state, abnormal database connection, slow database response, abnormal database filing log generation and the like, is avoided. In the invention, a corresponding preset threshold value is set for each monitoring state data, and each monitoring state data is compared with the corresponding preset threshold value to determine whether a fault exists in the current operation state of the database, for example, when the monitored CPU occupancy rate of the database is 85%, the monitored CPU occupancy rate exceeds the preset CPU threshold value (set to 80%), the current fault risk of abnormal CPU occupancy rate is judged, and the CPU fault warning information is generated. Preferably, in an embodiment, the fault risk level may be further determined according to a degree of difference between the monitoring data and a preset threshold, for example, in the above embodiment, the CPU occupancy exceeds the preset CPU threshold by 5%, which may be defined as a medium fault risk, and when the CPU occupancy exceeds the preset CPU threshold by 10%, which may be defined as a high fault risk, thereby providing a more intuitive fault warning effect for field maintenance personnel.
According to the database monitoring method provided by the invention, the database monitoring process efficiency and the monitoring result accuracy are improved by uniformly monitoring the multiple database systems, generating corresponding monitoring modes aiming at different types of databases and realizing the omnibearing monitoring of the hardware state data and the service performance state data of the databases based on the monitoring modes, so that the databases are monitored in real time, the mode that the databases need to be monitored manually and periodically is avoided.
On the basis of the above embodiment, the generating a corresponding monitoring mode according to the system type of the database includes:
acquiring a system type of a database, wherein the system type comprises an Oracle database or a golden warehouse database;
if the database is a cash box database, monitoring a system configuration file and a network configuration file of the database to construct a monitoring mode corresponding to hardware state data;
and if the database is an Oracle database, directly monitoring the hardware information of the database through a preset monitoring component so as to construct a monitoring mode corresponding to the hardware state data.
In the invention, for a golden cabin database deployed in a Linux server, when the database is monitored, after connection with the database is established, all hardware resource check items such as CPU (central processing unit) use condition, memory use condition, disk occupation condition, network state and the like are bound by using a Combo Box control, so that corresponding monitoring data can be displayed for field maintenance personnel through a display terminal (for example, a mobile phone and a tablet personal computer).
Specifically, in an embodiment, a shell command object is newly created through a selectendexchanged event of a ComboBox control, a shell specified command and parameters are provided according to a selectedlndex selected value, and related information (namely, a system configuration file) of a CPU, an internal memory, a disk and a system configuration file in a/proc directory of a Linux server and information such as a network configuration file in a/etc/sysconfig/network-scripts directory are respectively read, so that the contents in the configuration files are monitored in real time, a monitoring mode about the server hardware state of a vault database is constructed, and whether faults such as CPU utilization rate abnormality, network abnormality, server disk use overrun and the like exist in a server of the vault database is judged according to monitoring data.
In another embodiment, for an Oracle database deployed in a Windows server, a preset monitoring component, such as a system management device monitoring component, is introduced, and basic hardware information of the Oracle database, such as a CPU utilization rate, a disk available space, and the like, is accessed through a management class, so that a corresponding hardware state monitoring mode is quickly constructed for the Oracle database.
The invention respectively constructs the monitoring modes of the system configuration file and the network configuration file in the golden warehouse database and the monitoring mode of the hardware information in the Oracle database aiming at the databases of different system types, thereby adopting different hardware state monitoring modes, meeting the monitoring requirements of a plurality of database systems and realizing cross-platform centralized monitoring.
On the basis of the foregoing embodiment, the monitoring the hardware state data and the service performance state data of the database according to the monitoring mode to obtain database state monitoring data includes:
monitoring the CPU state, the disk state and the real-time network card rate of the database to obtain the CPU occupancy rate, the disk use space data and the network rate;
generating corresponding first monitoring data according to the CPU occupancy rate, the disk usage space data and the network rate;
monitoring the service performance state of the database based on the connection information between the database and the application program to obtain the user connection number, the session number and the SQL statement time consumption of the database;
generating corresponding second monitoring data according to the user connection number, the session number and the SQL statement time consumption;
and obtaining database state monitoring data through the first monitoring data and the second monitoring data.
In the invention, information such as CPU occupancy rate, disk use condition, real-time speed of a network card and the like of related processes in a database server is obtained and displayed through a display terminal. Specifically, for the situation that a golden storehouse database and an Oracle database are deployed at the same time, when the golden storehouse database is monitored, a query command is sent to the database every second, the CPU activity time in a/proc/stat file and the CPU activity time occupied by each process from the self-starting of the/proc/[ pid ]/stat are respectively read, the information read for a single process is utilized for calculation twice, the time that the single process occupies the CPU in a fixed interval time (which can be set according to the actual monitoring requirement) is obtained, and the total CPU time (the clock ticking number of the fixed interval time 1 s) is calculated at the same time, so that the CPU occupancy rate of the single process is calculated, and the CPU information is obtained; calculating the receiving and reading rates of the network card through two packet receiving and sending processes to obtain the network rate; because the golden warehouse database directory mainly uses physical files and occupies the space of a disk, the used space and the residual space of the disk are calculated by inquiring the total space of the disk of the directory and the size of each file in the directory, so as to obtain the used space data of the disk. For the Oracle database, a System management device monitoring component is introduced, and the management class is used for accessing basic hardware information of the Oracle database, such as CPU utilization rate, available space of a magnetic disk and the like, so that the hardware state of the Oracle database is quickly acquired. And respectively obtaining the CPU occupancy rate, the disk use space data and the network rate of the different types of databases so as to obtain the first monitoring data.
Further, for the abnormal situation of the database service, the main reasons include abnormal database connection, slow database response, process blocking, and the like, so the connection number of users, the number of sessions, and the time consumption of SQL statements of the database need to be monitored through the IP address of the application server and the connection situation of the application according to the connection information between the database and the application. In the invention, for Oracle and a golden storehouse database, an EntityFramework drive is introduced, and the database is accessed through a configured database connection character string. After the application program is connected with the database, counting the IP, the application program information, the user connection number, the session number and the SQL statement time consumption of the application server by executing the SQL statement; and analyzing the abnormal state of the session connection in the log through the shell terminal command, thereby monitoring the performance of the database.
The invention monitors the occupancy rate of a CPU (Central processing Unit), the use space data of a disk, the network rate, the number of user connections, the number of sessions and the time consumption of SQL (structured query language) statements of the database aiming at different types of databases, and can observe the system state of the database in real time so as to improve the failure analysis efficiency of the database.
On the basis of the above embodiment, before the monitoring of the service performance state of the database based on the connection information between the database and the application program to obtain the user connection number, the session number, and the time consumption of the SQL statement of the database, the method further includes:
if the database is a gold warehouse database, collecting the log information of the database in a preset time period, and acquiring the SQL sentences in the log information.
In the invention, when the golden-cabin database is monitored, the functions of log copying and log cleaning within a specified time range under a server log directory of the golden-cabin database can be realized by establishing File Transfer Protocol (FTP) connection. Specifically, after the FTP connection is established, SQL time-consuming information in a log is read, and slow query statements are counted, so that a large number of built-in integration functions are provided: such as database log analysis functions, database runtime calculations, database cluster status, authorization expiration times, number of database connections, IP information, software version numbers, and other important information display functions. According to the invention, through collecting and analyzing the logs of the gold warehouse database, research personnel can optimize SQL query conveniently; by reading information such as connection establishment, interruption, error codes and the like related to the ATS workstation and the database in the log, field personnel can conveniently perform problem troubleshooting.
On the basis of the above embodiment, before generating the corresponding monitoring mode according to the system type and the preset monitoring mode of the database, the method further includes:
and based on a secure shell protocol, verifying the account information of the database and the password information corresponding to the account information, and if the verification is passed, establishing communication connection with the database so as to monitor the database.
In the invention, the IP address of the server, the system user, the password and other information in the configuration file are read firstly, then the information is verified, after the verification is passed, the remote computer is operated by utilizing an SSH.NET component, and thus, the remote computer is remotely connected to the Linux database server by establishing a Secure Shell (SSH for short). When the SSH is ensured to remotely complete information verification and realize opening, the firewall is closed, normal communication can be carried out, and therefore connection is established with the database, the warning function is realized, and monitoring safety is improved.
On the basis of the foregoing embodiment, the determining the database state monitoring data and generating corresponding fault warning information according to a determination result includes:
comparing the database state monitoring data with a preset monitoring data threshold, judging whether the database state monitoring data is greater than or equal to the preset monitoring data threshold to know that the database has a fault risk, and generating corresponding fault alarm information according to a judgment result;
and generating alarm display information according to the fault alarm information so as to display the alarm display information through a display terminal.
In the invention, when the calculated CPU occupancy rate, the disk usage space and the network rate exceed the threshold values, alarm information is sent to the dispatching workstation through the ATS dual-network, thereby achieving the monitoring alarm effect. According to the invention, whether the current monitoring data has fault risks or not can be determined according to the difference degree between the monitoring data and the threshold value, so that different alarm levels are generated, and the alarm levels are displayed for field maintenance personnel through the display terminal, thereby providing more accurate database alarm information. It should be noted that, in the present invention, the databases are configured in a dual-network redundancy manner, and are in normal communication with other ATS workstations, and the Linux database server starts the full log function.
On the basis of the above embodiment, after the determining the database state monitoring data and generating corresponding fault warning information according to the determination result, the method further includes:
determining a fault type corresponding to the fault warning information;
acquiring fault processing step information according to the fault type;
and displaying the information of the fault processing step through a display terminal.
In the invention, after the database is determined to have a fault, the fault type of the current time is acquired, and then according to the fault type, the server fault guide or the database fault guide is respectively displayed by setting a TabPage control on an interface of a display terminal through a fault type guide scheme constructed in the earlier stage. Specifically, the interface of the display terminal uses a ComboBox control to bind the fault item, so that after a field maintainer clicks the Button control, fault processing steps and contents are displayed in the TextBox control according to a selected value (a determined database fault type) of the ComboBox, the Button control is displayed for a fault which can be processed by the server, and the field maintainer clicks to complete fault repair. Fig. 2 is a schematic diagram of database fault analysis provided by the present invention, and specific fault types can be referred to in fig. 2. According to the invention, through setting corresponding fault processing schemes for different fault types, after the fault warning information is obtained, maintenance personnel can be quickly guided to solve existing faults according to the fault type corresponding to the fault warning information, so that the fault processing efficiency of the database is improved.
The database monitoring system provided by the invention is described below, and the database monitoring system described below and the database monitoring method described above can be referred to correspondingly.
Fig. 3 is a schematic structural diagram of a database monitoring system provided by the present invention, and as shown in fig. 3, the present invention provides a database monitoring system, which includes a monitoring mode determining module 301, a monitoring module 302, and a fault warning module 303, where the monitoring mode determining module 301 is configured to generate a corresponding monitoring mode according to a system type of a database; the monitoring module 302 is configured to monitor the hardware state data and the service performance state data of the database according to the monitoring mode to obtain database state monitoring data; the fault alarm module 303 is configured to determine the database status monitoring data, and generate corresponding fault alarm information according to a determination result.
In the invention, the database monitoring system needs to complete the functions of cross-platform system resource access, database query, log copy and the like. Because the Oracle database is installed in the Windows operating system and the vault database is installed in the Linux operating system, if the line (i.e. the application platform such as the dispatching workstation) configures the Oracle database and the vault database simultaneously, the database monitoring system needs to be deployed in the same server of the Oracle database. In the present invention, the abnormal fault causes of the database system are mainly divided into two categories, including server hardware abnormality and database service performance abnormality, and in order to ensure the normal operation of the database system, when the database monitoring system monitors a certain database, the system type of the database is determined by the monitoring mode determining module 301, for example, whether the database is an Oracle database or a gold warehouse database is determined. Because the databases of different system types need to be deployed in the corresponding operating systems, the monitoring mode of the hardware state of the database needs to be set according to the system type of each database, for example, for a coffer database deployed in a Linux system, the current hardware state information of the database needs to be obtained by acquiring the configuration information in the database and calculating by using a related algorithm, so that hardware monitoring and fault analysis are realized; and for an Oracle database deployed in a Windows system, related hardware information can be directly called from the database system through a preset monitoring component.
Further, in the present invention, after the monitoring mode is determined, the monitoring module 302 executes the monitoring mode to monitor the hardware state and the service performance state of the database, where the hardware state mainly includes monitoring of data such as a CPU utilization rate, a database IO resource, a disk state, a firewall state, and a system network state; the service performance state mainly comprises monitoring of information such as application program information of a connection database, an IP address of an application server, the number of user connections, the number of sessions, SQL statement time consumption and the like.
Further, the fault alarm module 303 determines status data (including a hardware status and a service performance status) obtained through real-time monitoring, so as to quickly obtain whether a fault exists in the database at the current time, so as to avoid that the fault of the database system will affect normal operation of the service, for example, the conditions of database cluster status, abnormal database connection, slow database response, abnormal database filing log, and the like. In the present invention, the fault warning module 303 sets a corresponding preset threshold for each monitored state data, and compares each monitored state data with the corresponding preset threshold to determine whether a fault exists in the current operating state of the database, for example, when the monitored CPU occupancy of the database is 85%, the monitored CPU occupancy exceeds the preset CPU threshold (set to 80%), the current fault risk of CPU occupancy abnormality is determined, and thus CPU fault warning information is generated. Preferably, in an embodiment, the fault warning module 303 may further determine a fault risk level according to a degree of difference between the monitoring data and a preset threshold, for example, in the above embodiment, the CPU occupancy exceeds the preset CPU threshold by 5%, which may be defined as a medium fault risk, and when the CPU occupancy exceeds the preset CPU threshold by 10%, which may be defined as a high fault risk, so as to provide a more intuitive fault warning effect for the field maintenance personnel.
In a circuit configured with a multi-database system, an operator can observe the state of the server system in real time by checking the database monitoring system, and when the CPU utilization rate of the database system exceeds a set threshold value, the disk utilization rate exceeds the limit and other abnormal conditions, the database monitoring system can send alarm information; when the connection between the ATS application software and the database is abnormal, an operator can check the database cluster state through the database monitoring system, analyze whether the database cluster state is a server system problem or a database problem according to the fault processing guidance function, and recover the database state according to a database fault solution; meanwhile, the database monitoring system can also provide a log analysis function, so that operators can use the log analysis function to check slow SQL sentences, deadlock sentences, session connection information and the like after completing the operation according to the specified monthly check and seasonal check process, and when the database fails, the problems can be analyzed and solved according to the logs, thereby rapidly recovering the database.
According to the database monitoring system provided by the invention, through carrying out unified monitoring on a plurality of database systems, corresponding monitoring modes are generated aiming at different types of databases, and all-round monitoring of hardware state data and service performance state data of the databases is realized based on the monitoring modes, so that the databases are monitored in real time, the mode that the databases need to be monitored manually and periodically is avoided, and the efficiency of the database monitoring process and the accuracy of the monitoring result are improved.
The system provided by the present invention is used for executing the above method embodiments, and for the specific processes and details, reference is made to the above embodiments, which are not described herein again.
Fig. 4 is a schematic structural diagram of an electronic device provided in the present invention, and as shown in fig. 4, the electronic device may include: a Processor (Processor) 401, a communication Interface (Communications Interface) 402, a Memory (Memory) 403 and a communication bus 404, wherein the Processor 401, the communication Interface 402 and the Memory 403 communicate with each other via the communication bus 404. Processor 401 may call logic instructions in memory 403 to perform a database monitoring method comprising: generating a corresponding monitoring mode according to the system type of the database; monitoring hardware state data and service performance state data of the database according to the monitoring mode to obtain database state monitoring data; and judging the database state monitoring data, and generating corresponding fault warning information according to a judgment result.
In addition, the logic instructions in the memory 403 may be implemented in the form of software functional units and stored in a computer readable storage medium when the software functional units are sold or used as independent products. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
In another aspect, the present invention also provides a computer program product comprising a computer program stored on a non-transitory computer-readable storage medium, the computer program comprising program instructions, which when executed by a computer, enable the computer to perform the database monitoring method provided by the above methods, the method comprising: generating a corresponding monitoring mode according to the system type of the database; monitoring the hardware state data and the service performance state data of the database according to the monitoring mode to obtain database state monitoring data; and judging the database state monitoring data, and generating corresponding fault warning information according to a judgment result.
In yet another aspect, the present invention also provides a non-transitory computer-readable storage medium, on which a computer program is stored, where the computer program is implemented by a processor to execute the database monitoring method provided in the foregoing embodiments, where the method includes: generating a corresponding monitoring mode according to the system type of the database; monitoring the hardware state data and the service performance state data of the database according to the monitoring mode to obtain database state monitoring data; and judging the database state monitoring data, and generating corresponding fault warning information according to a judgment result.
The above-described embodiments of the apparatus are merely illustrative, and the units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment. One of ordinary skill in the art can understand and implement it without inventive effort.
Through the above description of the embodiments, those skilled in the art will clearly understand that each embodiment can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware. With this understanding in mind, the above-described technical solutions may be embodied in the form of a software product, which can be stored in a computer-readable storage medium such as ROM/RAM, magnetic disk, optical disk, etc., and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the methods described in the embodiments or some parts of the embodiments.
Finally, it should be noted that: the above examples are only intended to illustrate the technical solution of the present invention, but not to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.

Claims (10)

1. A database monitoring method, comprising:
generating a corresponding monitoring mode according to the system type of the database;
monitoring hardware state data and service performance state data of the database according to the monitoring mode to obtain database state monitoring data;
and judging the database state monitoring data, and generating corresponding fault alarm information according to a judgment result.
2. The database monitoring method according to claim 1, wherein the generating of the corresponding monitoring mode according to the system type of the database comprises:
acquiring a system type of a database, wherein the system type comprises an Oracle database or a golden cabin database;
if the database is a cash box database, monitoring a system configuration file and a network configuration file of the database to construct a monitoring mode corresponding to hardware state data;
and if the database is an Oracle database, directly monitoring the hardware information of the database through a preset monitoring component so as to construct a monitoring mode corresponding to the hardware state data.
3. The database monitoring method according to claim 2, wherein the monitoring the hardware status data and the service performance status data of the database according to the monitoring mode to obtain the database status monitoring data comprises:
monitoring the CPU state, the disk state and the real-time network card rate of the database to obtain the CPU occupancy rate, the disk use space data and the network rate;
generating corresponding first monitoring data according to the CPU occupancy rate, the disk usage space data and the network rate;
monitoring the service performance state of the database based on the connection information between the database and the application program to obtain the user connection number, the session number and the SQL statement time consumption of the database;
generating corresponding second monitoring data according to the user connection number, the session number and the SQL statement time consumption;
and obtaining database state monitoring data through the first monitoring data and the second monitoring data.
4. The database monitoring method according to claim 3, wherein before the monitoring of the service performance status of the database based on the connection information between the database and the application program, and obtaining the user connection number, the session number, and the time consumption of the SQL statement of the database, the method further comprises:
if the database is a gold storehouse database, collecting the log information of the database in a preset time period, and acquiring the time consumed by SQL sentences in the log information.
5. The database monitoring method according to claim 1, wherein before the generating of the corresponding monitoring mode according to the system type and the preset monitoring mode of the database, the method further comprises:
and verifying the account information of the database and the password information corresponding to the account information based on a secure shell protocol, and if the account information passes the verification, establishing communication connection with the database to monitor the database.
6. The database monitoring method according to claim 1, wherein the determining the database status monitoring data and generating corresponding fault warning information according to the determination result includes:
comparing the database state monitoring data with a preset monitoring data threshold, judging whether the database state monitoring data is greater than or equal to the preset monitoring data threshold to know that the database has a fault risk, and generating corresponding fault alarm information according to a judgment result;
and generating alarm display information according to the fault alarm information so as to display the alarm display information through a display terminal.
7. The database monitoring method according to claim 1, wherein after the determining the database status monitoring data and generating corresponding fault warning information according to the determining result, the method further comprises:
determining a fault type corresponding to the fault warning information;
acquiring fault processing step information according to the fault type;
and displaying the information of the fault processing step through a display terminal.
8. A database monitoring system, comprising:
the monitoring mode determining module is used for generating a corresponding monitoring mode according to the system type of the database;
the monitoring module is used for monitoring the hardware state data and the service performance state data of the database according to the monitoring mode to obtain database state monitoring data;
and the fault alarm module is used for judging the database state monitoring data and generating corresponding fault alarm information according to a judgment result.
9. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the database monitoring method according to any one of claims 1 to 7 when executing the computer program.
10. A non-transitory computer-readable storage medium on which a computer program is stored, wherein the computer program, when executed by a processor, implements the database monitoring method according to any one of claims 1 to 7.
CN202211124460.6A 2022-09-15 2022-09-15 Database monitoring method and system Pending CN115658420A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211124460.6A CN115658420A (en) 2022-09-15 2022-09-15 Database monitoring method and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211124460.6A CN115658420A (en) 2022-09-15 2022-09-15 Database monitoring method and system

Publications (1)

Publication Number Publication Date
CN115658420A true CN115658420A (en) 2023-01-31

Family

ID=84984166

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211124460.6A Pending CN115658420A (en) 2022-09-15 2022-09-15 Database monitoring method and system

Country Status (1)

Country Link
CN (1) CN115658420A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116560944A (en) * 2023-05-12 2023-08-08 上海天玑科技股份有限公司 Database monitoring method
CN116662059A (en) * 2023-07-24 2023-08-29 上海爱可生信息技术股份有限公司 MySQL database CPU fault diagnosis and self-healing method and readable storage medium
CN117174260A (en) * 2023-11-02 2023-12-05 四川省肿瘤医院 Medical image data management system and data analysis method

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116560944A (en) * 2023-05-12 2023-08-08 上海天玑科技股份有限公司 Database monitoring method
CN116662059A (en) * 2023-07-24 2023-08-29 上海爱可生信息技术股份有限公司 MySQL database CPU fault diagnosis and self-healing method and readable storage medium
CN116662059B (en) * 2023-07-24 2023-10-24 上海爱可生信息技术股份有限公司 MySQL database CPU fault diagnosis and self-healing method and readable storage medium
CN117174260A (en) * 2023-11-02 2023-12-05 四川省肿瘤医院 Medical image data management system and data analysis method
CN117174260B (en) * 2023-11-02 2024-01-30 四川省肿瘤医院 Medical image data management system and data analysis method

Similar Documents

Publication Publication Date Title
CN115658420A (en) Database monitoring method and system
US9900226B2 (en) System for managing a remote data processing system
CN106775929B (en) A kind of virtual platform safety monitoring method and system
CN111092786B (en) Network equipment safety authentication service reliability enhancing system
CN109688188A (en) Monitoring alarm method, apparatus, equipment and computer readable storage medium
CN110046073B (en) Log collection method and device, equipment and storage medium
CN106789306B (en) Method and system for detecting, collecting and recovering software fault of communication equipment
CN110851320A (en) Server downtime supervision method, system, terminal and storage medium
US20220050765A1 (en) Method for processing logs in a computer system for events identified as abnormal and revealing solutions, electronic device, and cloud server
CN107800783B (en) Method and device for remotely monitoring server
CN101197621A (en) Method and system for remote diagnosing and locating failure of network management system
CN112256593B (en) Program processing method and device, computer equipment and readable storage medium
CN111082998A (en) Architecture system of operation and maintenance monitoring campus convergence layer
CN111897556B (en) Video monitoring service system based on cloud computing
CN115632706B (en) FC link management method, device, equipment and readable storage medium
CN116149954A (en) Intelligent operation and maintenance system and method for server
CN114500178B (en) Self-operation intelligent Internet of things gateway
CN112905410B (en) Equipment state monitoring system and method
CN112131090B (en) Service system performance monitoring method, device, equipment and medium
CN115037597A (en) Fault detection method and equipment
CN111447329A (en) Method, system, device and medium for monitoring state server in call center
JP7436737B1 (en) Server management system that supports multi-vendors
CN114640572B (en) Method, device and equipment for processing data disaster tolerance and computer readable storage medium
CN113688017B (en) Automatic abnormality testing method and device for multi-node BeeGFS file system
CN115883178A (en) Network security reinforcing and checking tool

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