CN109299064A - Database monitoring method and terminal device - Google Patents

Database monitoring method and terminal device Download PDF

Info

Publication number
CN109299064A
CN109299064A CN201810788623.8A CN201810788623A CN109299064A CN 109299064 A CN109299064 A CN 109299064A CN 201810788623 A CN201810788623 A CN 201810788623A CN 109299064 A CN109299064 A CN 109299064A
Authority
CN
China
Prior art keywords
database
online
online database
server
determined
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.)
Granted
Application number
CN201810788623.8A
Other languages
Chinese (zh)
Other versions
CN109299064B (en
Inventor
梁海安
孙泽祥
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
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 CN201810788623.8A priority Critical patent/CN109299064B/en
Priority to PCT/CN2018/105556 priority patent/WO2020015116A1/en
Publication of CN109299064A publication Critical patent/CN109299064A/en
Application granted granted Critical
Publication of CN109299064B publication Critical patent/CN109299064B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3003Monitoring arrangements specially adapted to the computing system or computing system component being monitored
    • G06F11/302Monitoring arrangements specially adapted to the computing system or computing system component being monitored where the computing system component is a software system
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3051Monitoring arrangements for monitoring the configuration of the computing system or of the computing system component, e.g. monitoring the presence of processing resources, peripherals, I/O links, software programs

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computing Systems (AREA)
  • Physics & Mathematics (AREA)
  • Quality & Reliability (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Mathematical Physics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The present invention is suitable for field of computer technology, provides a kind of database monitoring method and terminal device.The described method includes: on detection service device each database presence, determine that online database therein, the online database include primary climate database and backup environment database;According to the version of each online database, the acquisition index of each online database is determined respectively;The corresponding script of acquisition index for running each online database, the monitoring data of each online database is obtained by the script respectively;The monitoring data that will acquire is sent to the server, the monitoring data, which is used by the server, judges each online database whether normal operation, solve existing each monitoring collection for acting on behalf of a responsible database, the problem of causing the agency run on server excessive, increasing agent maintenance complexity and server resource consumption.

Description

Database monitoring method and terminal device
Technical field
The invention belongs to field of computer technology more particularly to a kind of database monitoring methods and terminal device.
Background technique
With the rapid development of computer and network technologies, database is widely used in every field, is types of applications With the operating functions such as service for queries, increase, modification and deletion.More and more responses of the application and service to database Duration, database performance etc. propose higher requirement.Therefore, it is necessary to each operation links to database finely to be supervised Control.If there are multiple databases on individual server, need to start on the server multiple agencies (agent), each agency It is responsible for the monitoring collection of a database, each agency can consume certain server resource, lead to the generation run on server Reason is excessive, increases the complexity of agent maintenance and the consumption of server resource.
Summary of the invention
The embodiment of the present invention provides a kind of database monitoring method and terminal device, is responsible for one to solve existing each agency The monitoring collection of a database causes the agency run on server excessive, increases agent maintenance complexity and server resource The problem of consumption.
The first aspect of the embodiment of the present invention provides a kind of database monitoring method, comprising:
The presence of each database on detection service device determines online database therein, the online data Library includes primary climate database and backup environment database;
According to the version of each online database, the acquisition index of each online database is determined respectively;
The corresponding script of acquisition index for running each online database obtains each institute by the script respectively State the monitoring data of online database;
The monitoring data that will acquire is sent to the server, and the monitoring data, which is used by the server, to be sentenced Each online database break whether normal operation.
The second aspect of the embodiment of the present invention provides a kind of terminal device, including memory, processor and is stored in In the memory and the computer program that can run on the processor, when the processor executes the computer program Realize following steps:
The presence of each database on detection service device determines online database therein, the online data Library includes primary climate database and backup environment database;
According to the version of each online database, the acquisition index of each online database is determined respectively;
The corresponding script of acquisition index for running each online database obtains each institute by the script respectively State the monitoring data of online database;
The monitoring data that will acquire is sent to the server, and the monitoring data, which is used by the server, to be sentenced Each online database break whether normal operation.
The third aspect of the embodiment of the present invention provides a kind of computer readable storage medium, the computer-readable storage Media storage has computer program, realizes when the computer program is executed by processor such as the step of the above method.
Existing beneficial effect is the embodiment of the present invention compared with prior art: the embodiment of the present invention is according to number on server The acquisition index that database is determined according to the version in library obtains the monitoring number of database by the corresponding script of operation acquisition index According to, multiple databases on a server can be monitored, solve it is existing it is each act on behalf of be responsible for a database prison Control acquisition, the problem of causing the agency run on server excessive, increase agent maintenance complexity and server resource consumption, together When, the monitoring to offline database is excluded during database monitoring, is avoided the wrong report of the monitoring to offline database, is protected The accuracy of database monitoring is demonstrate,proved, while reducing O&M cost, improves database monitoring efficiency.
Detailed description of the invention
It to describe the technical solutions in the embodiments of the present invention more clearly, below will be to embodiment or description of the prior art Needed in attached drawing be briefly described, it should be apparent that, the accompanying drawings in the following description is only of the invention some Embodiment for those of ordinary skill in the art without any creative labor, can also be according to these Attached drawing obtains other attached drawings.
Fig. 1 is a kind of schematic flow diagram of database monitoring method provided in an embodiment of the present invention;
Fig. 2 be another embodiment of the present invention provides a kind of database monitoring method schematic flow diagram;
Fig. 3 is a kind of schematic flow diagram for database monitoring method that yet another embodiment of the invention provides;
Fig. 4 is a kind of schematic block diagram of terminal device provided in an embodiment of the present invention;
Fig. 5 is a kind of schematic block diagram of database monitor provided in an embodiment of the present invention.
Specific embodiment
In being described below, for illustration and not for limitation, the tool of such as particular system structure, technology etc is proposed Body details, to understand thoroughly the embodiment of the present invention.However, it will be clear to one skilled in the art that there is no these specific The present invention also may be implemented in the other embodiments of details.In other situations, it omits to well-known system, device, electricity The detailed description of road and method, in case unnecessary details interferes description of the invention.
In order to illustrate technical solutions according to the invention, the following is a description of specific embodiments.
It is a kind of schematic flow diagram of database monitoring method provided in an embodiment of the present invention referring to Fig. 1, Fig. 1, in the reality It applies in example, is illustrated by taking the triggering of the angle of agency as an example, here, agency carries out information exchange with server.As shown in Figure 1, In this embodiment, the treatment process of agency may comprise steps of:
S101: the presence of each database on detection service device determines online database therein, described online Database includes primary climate database and backup environment database.
Here it is possible to execute each embodiment of the invention by agency, in specific implementation process, server can pass through Prefixed time interval sends enabled instruction to acting on behalf of, and agency starts according to the enabled instruction.Wherein, prefixed time interval can root It is determined according to the supervision interval of database each in server, first the corresponding relationship of the basis database prestored and supervision interval, It determines the supervision interval of each database in above-mentioned server, then obtains the supervision interval of each database in above-mentioned server Minimum value, as above-mentioned prefixed time interval.
Specifically, primary climate database abbreviation master library is the place of centrally stored management filing data, backup environment data Library is the backup database of main environment data base.Agency detects the presence of each database on the server, sentences first Disconnected database is backup database or primary climate database, and specifically, by taking database A as an example, database A is above-mentioned server Any one online database in upper each database, obtains the database name and db unique name of database A, if The db unique name of database A is the combination of the first preset characters and the database name of database A, judges that database A is Primary climate database, wherein the first preset characters can be arranged according to the db unique name of existing primary climate database, For example, the first preset characters may include all characters of the db unique name of multiple existing primary climate databases.Together Whether reason, can use the mode of the db unique name of above-mentioned Test database to judge database for backup environment data Library, the db unique name of backup environment database are the combination of the second preset characters and wide area information server name, such as For oracle, the db unique name of backup environment database are as follows: with city backup library: l+ database name, remote backup library: R+ database name, the second preset characters are that l or r specifically can be according to existing backup environment data for above-mentioned oracle The db unique name in library is arranged, for example, the second preset characters may include the db of multiple existing backup environment databases The all characters of unique name.
Alternatively, obtain database A access limit, if the access limit of database A be it is read-only, judge that database A is Backup environment database, if the access limit of database A be it is read-write, judge database A for main environment data base.
Alternatively, obtaining the user name of database A, wherein database user name is the user using database server Whether the user name of title, Test database A is started with third preset characters or the 4th preset characters, such as primary climate database User name started with op, the user name of backup environment database is started with os.If the user name of database A is default with third Character beginning, judges database A for main environment data base, here, third preset characters are according to existing primary climate database User name all characters determine, for example, third preset characters include the user name beginning word of multiple existing primary climate databases Symbol.Similarly, if the user name of database A is started with the 4th preset characters, judge database A for backup environment database, Four preset characters are determined according to the user name all characters of existing backup environment database, for example, the 4th preset characters include The user name all characters of multiple existing backup environment databases.
Then to the online and offline state for removing to look into each database of server in configuration management database CMDB, In, CMDB records the online of all databases, the states such as offline.If some or certain databases of server are in CMDB State be it is offline, the application programming interface of offline database can be called, such as call the API of zabbix, will be counted offline It is set as disabled state (down state) according to all alarm items in library, that is, closes the alarm switch of offline database, keep away Exempt to report by mistake, then can call mail interface, the alarm switch for notifying related operation maintenance personnel to have been switched off, by operation maintenance personnel The cleaning being monitored after confirmation.Above-mentioned agency determine primary climate database in the online database in addition to offline database and Backup environment database carries out subsequent operation, avoids being monitored offline database, saves resource.Wherein, zabbix is The open source solution of the enterprise-level of one monitoring of offer distributed system and network monitoring function based on WEB interface. Zabbix can monitor various network parameters, guarantee the safe operation of server system;And flexible informing mechanism is provided to allow and is System administrator is quickly various existing for positioning/solve the problems, such as.
S102: according to the version of each online database, determine that the acquisition of each online database refers to respectively Mark.
Here, above-mentioned agency determines that the version of online database in server may include: that can order by calling script Select*from v $ version is enabled to determine the version of online database, specifically, by calling script command select Version from v $ instance determines the version number of online database, by calling script command select*from v $ Option determines the function of online database.
Specifically, the corresponding database version information of different database versions is different, and database version information includes phase The acquisition mark answered, obtains primary climate version database on above-mentioned server according to the version of primary climate database on above-mentioned server Acquisition mark in this information, the acquisition index of above-mentioned primary climate database, here, above-mentioned agency are determined according to acquisition mark The acquisition index for determining primary climate database may include: connection number, throughput of system tps, capacity, the indexs such as load pressure. Above-mentioned agency can be main in determination according to the corresponding relationship with the corresponding relationship of pre-stored data library version and database version information Then the corresponding database version information of the version of environment data base obtains the acquisition mark in primary climate database version information Know, the acquisition index for determining primary climate database is identified according to the acquisition.
Similarly, above-mentioned agency obtains according to the version of backup environment database on above-mentioned server and backs up on above-mentioned server The database version information of environment data base obtains on above-mentioned server in backup environment wide area information server version information Acquisition mark, the acquisition index for determining backup environment database, here, the acquisition of backup environment database are identified according to the acquisition Index may include: the lag of data synchronization delay, the indexs such as data synchronizing process state.
S103: the corresponding script of acquisition index of each online database of operation is obtained respectively by the script The monitoring data of each online database.
Specifically, after the acquisition index for determining each online database, above-mentioned agency is according to the acquisition index prestored With the corresponding relationship of script, the corresponding script of acquisition index and above-mentioned backup environment number of above-mentioned primary climate database are determined According to the corresponding script of the acquisition index in library, further, the corresponding script of acquisition index for running above-mentioned primary climate database is obtained The monitoring data of primary climate database, the corresponding script of acquisition index for running above-mentioned backup environment database obtain backup environment The monitoring data of database.
It here, can be by running sql script command if the acquisition index of primary climate database is connection number (select'session:'| | count (*) from v $ session) obtains the corresponding data of primary climate database, and result is protected It is stored in the temporary file of operating system, the data in the temporary file is then sent to server again.
If the acquisition index of primary climate database is tps, Run Script order (select'user_ can be passed through Tran:'| | round (value) " user_tran " from v $ sysmetric where group_id=2and METRIC_ NAME='User Transaction Per Sec') obtain primary climate database corresponding data, result is saved in operation In the temporary file of system, the data in the temporary file are then sent to server again.
If the acquisition index of primary climate database is capacity, Run Script order (select'db_ can be passed through size:'||to_char(datafile_size+tempfile_size)"dbsize"from(select sum(bytes) datafile_size from dba_data_files),(select sum(bytes)tempfile_size from dba_ Temp_files the corresponding data for)) obtaining primary climate database, result is saved in the temporary file of operating system, then The data in the temporary file are sent on server again.
If the acquisition index of primary climate database is load pressure, Run Script order (select'db_ can be passed through Time:'| | round (value) " db_time " from v $ sysmetric where group_id=2and METRIC_ NAME='Database Time Per Sec') obtain primary climate database corresponding data, result is saved in operating system Temporary file in, then the data in the temporary file are sent on server again.
If the acquisition index of backup environment database is the lag of data synchronization delay, Run Script order can be passed through
(select
'last_apply_time_min:'||nvl(floor((sysdate-max(TIMESTAMP))*24*60), 100)
Last_apply_time from gv $ recovery_progress where item='Last Applied Redo') obtain backup environment database corresponding data, result is saved in the temporary file of operating system, then again Data in the temporary file are sent to server.
If the acquisition index of backup environment database is data synchronizing process state, Run Script order can be passed through (select'mrp0_process:'| | count (1) from gv $ managed_standby where process=' MRP0';
select'rfs_process:'||count(1)from gv$managed_standby where process =' RFS') and obtain backup environment database corresponding data, result is saved in the temporary file of operating system, then again Data in the temporary file are sent to server.
S104: the monitoring data that will acquire is sent to the server, and the monitoring data is by the server For judging each online database whether normal operation.
Here, server receives the monitoring data of above-mentioned primary climate database and the monitoring data of backup environment database, The monitoring data of received above-mentioned primary climate database can be compared with the achievement data of the primary climate database prestored, If the monitoring data of above-mentioned primary climate database determines above-mentioned master within the scope of the achievement data of the primary climate database prestored The index of environment data base is normal, otherwise, it determines the Indexes Abnormality of above-mentioned primary climate database, and obtain above-mentioned primary climate data The abnormal index in library, and the abnormal index that will acquire is sent to database monitoring personnel, similarly, for received above-mentioned backup ring The monitoring data of border database is compared with the achievement data of the backup environment database prestored, if above-mentioned backup environment number According to the monitoring data in library within the scope of the achievement data of the backup environment database prestored, above-mentioned backup environment database is determined Index is normal, otherwise, it determines the Indexes Abnormality of above-mentioned backup environment database, and obtain the exception of above-mentioned backup environment database Index, and the abnormal index that will acquire is sent to database monitoring personnel.Wherein, the achievement data of the primary climate database prestored Achievement data when operating normally for main environment data base, the achievement data of the backup environment database prestored are backup environment number Achievement data when being operated normally according to library.
It is evidenced from the above discussion that the database monitoring method of the embodiment of the present invention, it can basis by configuring an agency The version of database determines the acquisition index of database on server, obtains database by the corresponding script of operation acquisition index Monitoring data, multiple databases on a server are monitored, solve it is existing it is each act on behalf of be responsible for a database Monitoring collection, cause the agency run on server excessive, increase asking for agent maintenance complexity and server resource consumption Topic, meanwhile, the monitoring to offline database is excluded during database monitoring, avoids the mistake of the monitoring to offline database Report, guarantees the accuracy of database monitoring, while reducing O&M cost, improves database monitoring efficiency.
Referring to Fig. 2, Fig. 2 be another embodiment of the present invention provides a kind of database monitoring method schematic flow diagram. The difference of the present embodiment and above-described embodiment is S205, and S201~S204 is identical as S101~S104 in a upper embodiment, Referring specifically to the associated description of S101~S104 in above-described embodiment, do not repeat herein.Database monitoring in the present embodiment Method can also include:
S205: the application programming interface by calling offline database in the server, by the off-line data The alarm item in library is set as down state.
Here, if the state of some or certain databases of server in CMDB be it is offline, above-mentioned agency can adjust With the application programming interface of offline database, down state state is set by all alarm items of offline database, The alarm switch for closing offline database, avoids the occurrence of wrong report, then may call upon mail interface, notifies related O&M people The alarm switch that member has been switched off, the cleaning being monitored after being confirmed by operation maintenance personnel.Aforesaid operations avoid off-line data The monitoring in library is reported by mistake, reduces O&M cost, and only close to alarm switch, can be with if CMDB configuration information is wrong Restore monitoring rapidly.Meanwhile also after closing alarm switch, secondary-confirmation is carried out by mail notification operation maintenance personnel, confirms nothing Complete deletion monitors after accidentally, guarantees to improve efficiency while the accuracy of O&M.Here by taking the API for calling zabbix as an example, Each database is corresponding a monitored object mark in zabbix, if finding database in CMDB is off-line state, Operation maintenance personnel can call the API of zabbix, be passed to monitored object mark of the database in zabbix, pass through API and monitoring The monitored item of database can be closed and be cleaned up to object identity.
Optionally, on the detection service device each database presence, determine online database therein it Afterwards, further includes:
Obtain the access limit of each online database;
If the access limit of the online database is read-write, it is determined that the online database is main environmental data Library;
If the access limit of the online database is read-only, it is determined that the online database is backup environment data Library.
Optionally, on the detection service device each database presence, determine online database therein it Afterwards, further includes:
Obtain the database name and db unique name of each online database;
If the db unique name of the online database is the database of the first preset characters and the online database The combination of name, it is determined that the online database is main environment data base;
If the db unique name of the online database is the database of the second preset characters and the online database The combination of name, it is determined that the online database is backup environment database;
Or
Obtain the user name of each online database;
If the user name of the online database is with the beginning of third preset characters, it is determined that the online database is main ring Border database;
If the user name of the online database is started with the 4th preset characters, it is determined that the online database is backup Environment data base.
Optionally, for the primary climate database, the version according to each online database determines respectively The acquisition index of each online database includes:
The mark of the acquisition in the primary climate database version information is obtained according to the version of the primary climate database;
The acquisition index of the primary climate database is determined according to the acquisition mark.
Here, the corresponding database version information of different database versions is different, and database version information includes corresponding Acquisition mark, primary climate database version on above-mentioned server is obtained according to the version of primary climate database on above-mentioned server Acquisition mark in information, the acquisition index of above-mentioned primary climate database is determined according to acquisition mark.
The application of the above method in order to better understand, a database monitoring method of the present invention detailed below is real Example.
In conjunction with above-mentioned each embodiment, in the present embodiment, carried out by taking the interactive process between server and agency as an example Explanation, wherein the database on server have it is multiple, it is this explanation not to the present invention program constitute limit.
As shown in figure 3, this application example may include:
S301: server sends enabled instruction to acting on behalf of by prefixed time interval, and agency opens according to the enabled instruction It is dynamic.
Wherein, server determines each data on server according to the database prestored and the corresponding relationship of supervision interval Determining supervision interval minimum value is set above-mentioned prefixed time interval by the supervision interval in library.
S302: after start completion, agency passes through according to the online and offline state of database each on above-mentioned server The application programming interface for calling offline database in the server sets the alarm item of the offline database to not Available mode.
S303: agency determines the online database on above-mentioned server in addition to offline database, the online database packet Include primary climate database and backup environment database.
Specifically, agency obtains the access limit of each online database;
If the access limit of an online database is read-write, it is determined that the online database is main environment data base;
If the access limit of an online database is read-only, it is determined that the online database is backup environment database.
Or
Obtain the database name and db unique name of each online database;
If the db unique name of an online database is the database of the first preset characters and the online database The combination of name, it is determined that the online database is main environment data base;
If the db unique name of an online database is the database of the second preset characters and the online database The combination of name, it is determined that the online database is backup environment database.
Or
Obtain the user name of each online database;
If the user name of an online database is with the beginning of third preset characters, it is determined that the online database is primary climate Database;
If the user name of an online database is started with the 4th preset characters, it is determined that the online database is backup ring Border database.
S304: agency determines adopting for each online database according to the version of each online database respectively Collect index.
Here, agency can determine the version of database by calling script command select*from v $ version, with For primary climate database, the acquisition in version information is then obtained according to the version of primary climate database and is identified, is adopted according to this Set identifier determines the acquisition index of primary climate database.
S305: agency runs the corresponding script of acquisition index of each online database, is distinguished by the script Obtain the monitoring data of each online database.
S306: the monitoring data that agency will acquire is sent to the server.
S307: server judges each online database whether normal operation according to the monitoring data.
It is evidenced from the above discussion that the present embodiment can be true according to the version of database on server by configuring an agency The acquisition index for determining database is obtained the monitoring data of database by the corresponding script of operation acquisition index, serviced one Multiple databases on device are monitored, and are solved existing each monitoring collection for acting on behalf of a responsible database, are led to server The problem of agency of upper operation is excessive, increases agent maintenance complexity and server resource consumption, meanwhile, in database monitoring mistake The monitoring to offline database is excluded in journey, is avoided the wrong report of the monitoring to offline database, is guaranteed the standard of database monitoring True property, while O&M cost is reduced, improve database monitoring efficiency.
It should be understood that the size of the serial number of each step is not meant that the order of the execution order in above-described embodiment, each process Execution sequence should be determined by its function and internal logic, the implementation process without coping with the embodiment of the present invention constitutes any limit It is fixed.
Corresponding to database monitoring method described in foregoing embodiments, Fig. 4 shows data provided in an embodiment of the present invention The running environment schematic diagram of library monitoring programme.For ease of description, only the parts related to this embodiment are shown.
In the present embodiment, the database monitor 400 is installed and is run in terminal device 40.The terminal is set Standby 40 can be mobile terminal, palm PC, server etc..The terminal device 40 may include, but be not limited only to, memory 401, Processor 402 and display 403.Fig. 4 illustrates only the terminal device 40 with component 401-403, it should be understood that simultaneously All components shown realistic are not applied, the implementation that can be substituted is more or less component.
The memory 401 can be the internal storage unit of the terminal device 40 in some embodiments, such as should The hard disk or memory of terminal device 40.The memory 401 is also possible to the terminal device 40 in further embodiments The plug-in type hard disk being equipped on External memory equipment, such as the terminal device 40, intelligent memory card (Smart Media Card, SMC), secure digital (Secure Digital, SD) card, flash card (Flash Card) etc..Further, described to deposit Reservoir 401 can also both including the terminal device 40 internal storage unit and also including External memory equipment.The memory 401 for storing the application software and Various types of data for being installed on the terminal device 40, such as the database monitor 400 Program code etc..The memory 401 can be also used for temporarily storing the data that has exported or will export.
The processor 402 can be a central processing unit (Central Processing in some embodiments Unit, CPU), microprocessor or other data processing chips, for run the program code stored in the memory 401 or Handle data, such as execute the database monitor 400 etc..
The display 403 can be light-emitting diode display, liquid crystal display, touch control type LCD in some embodiments and show Device and Organic Light Emitting Diode (Organic Light-Emitting Diode, OLED) touch device etc..The display 403 For being shown in the information handled in the terminal device 40 and for showing visual user interface, such as application menu Interface, application icon interface etc..The component 401-403 of the terminal device 40 is in communication with each other by system bus.
Referring to Fig. 5, being the functional block diagram of database monitor 400 provided in an embodiment of the present invention.In this implementation In example, the database monitor 400 can be divided into one or more modules, one or more of module quilts It is stored in the memory 401, and performed by one or more processors (the present embodiment is the processor 402), with Complete the present invention.For example, in Fig. 5, the database monitor 400 can be divided into database determination unit 501, Acquisition index determination unit 502, monitoring data obtaining unit 503 and monitoring data transmission unit 504.The so-called unit of the present invention It is the series of computation machine program instruction section for referring to complete specific function, than program more suitable for describing the database monitoring Implementation procedure of the program 400 in the terminal device 40.The function of the unit 501-504 will specifically be introduced by being described below.
Wherein, database determination unit 501, the presence of each database, determines it on detection service device In online database, the online database includes primary climate database and backup environment database.Acquisition index determines single Member 502, for the version according to each online database, determines the acquisition index of each online database respectively. Monitoring data obtaining unit 503 passes through the foot for running the corresponding script of acquisition index of each online database This obtains the monitoring data of each online database respectively.Monitoring data transmission unit 504, for it will acquire described in Monitoring data is sent to the server, and the monitoring data, which is used by the server, judges that each online database is No normal operation.
Optionally, the database monitor 400 can also be divided into alarm closing unit 505.
Wherein, closing unit 505 is alerted, for the application programming by calling offline database in the server The alarm item of the offline database is set down state by interface.
Optionally, on the detection service device each database presence, determine online database therein it Afterwards, further includes:
Obtain the access limit of each online database;
If the access limit of the online database is read-write, it is determined that the online database is main environmental data Library;
If the access limit of the online database is read-only, it is determined that the online database is backup environment data Library.
Optionally, on the detection service device each database presence, determine online database therein it Afterwards, further includes:
Obtain the database name and db unique name of each online database;
If the db unique name of the online database is the database of the first preset characters and the online database The combination of name, it is determined that the online database is main environment data base;
If the db unique name of the online database is the database of the second preset characters and the online database The combination of name, it is determined that the online database is backup environment database;
Or
Obtain the user name of each online database;
If the user name of the online database is with the beginning of third preset characters, it is determined that the online database is main ring Border database;
If the user name of the online database is started with the 4th preset characters, it is determined that the online database is backup Environment data base.
Optionally, for the primary climate database, the version according to each online database determines respectively The acquisition index of each online database includes:
The mark of the acquisition in the primary climate database version information is obtained according to the version of the primary climate database;
The acquisition index of the primary climate database is determined according to the acquisition mark.
It is apparent to those skilled in the art that for convenience of description and succinctly, only with above-mentioned each function Can unit, module division progress for example, in practical application, can according to need and by above-mentioned function distribution by different Functional unit, module are completed, i.e., the internal structure of described device is divided into different functional unit or module, more than completing The all or part of function of description.Each functional unit in embodiment, module can integrate in one processing unit, can also To be that each unit physically exists alone, can also be integrated in one unit with two or more units, it is above-mentioned integrated Unit both can take the form of hardware realization, can also realize in the form of software functional units.In addition, each function list Member, the specific name of module are also only for convenience of distinguishing each other, the protection scope being not intended to limit this application.Above system The specific work process of middle unit, module, can refer to corresponding processes in the foregoing method embodiment, and details are not described herein.
In the above-described embodiments, it all emphasizes particularly on different fields to the description of each embodiment, is not described in detail or remembers in some embodiment The part of load may refer to the associated description of other embodiments.
Those of ordinary skill in the art may be aware that list described in conjunction with the examples disclosed in the embodiments of the present disclosure Member and algorithm steps can be realized with the combination of electronic hardware or computer software and electronic hardware.These functions are actually It is implemented in hardware or software, the specific application and design constraint depending on technical solution.Professional technician Each specific application can be used different methods to achieve the described function, but this realization is it is not considered that exceed The scope of the present invention.
In embodiment provided by the present invention, it should be understood that disclosed device/terminal device and method, it can be with It realizes by another way.For example, device described above/terminal device embodiment is only schematical, for example, institute The division of module or unit is stated, only a kind of logical function partition, there may be another division manner in actual implementation, such as Multiple units or components can be combined or can be integrated into another system, or some features can be ignored or not executed.Separately A bit, shown or discussed mutual coupling or direct-coupling or communication connection can be through some interfaces, device Or the INDIRECT COUPLING or communication connection of unit, it can be electrical property, mechanical or other forms.
The unit as illustrated by the separation member may or may not be physically separated, aobvious as unit The component shown may or may not be physical unit, it can and it is in one place, or may be distributed over multiple In network unit.It can select some or all of unit therein according to the actual needs to realize the mesh of this embodiment scheme 's.
It, can also be in addition, the functional units in various embodiments of the present invention may be integrated into one processing unit It is that each unit physically exists alone, can also be integrated in one unit with two or more units.Above-mentioned integrated list Member both can take the form of hardware realization, can also realize in the form of software functional units.
If the integrated module/unit be realized in the form of SFU software functional unit and as independent product sale or In use, can store in a computer readable storage medium.Based on this understanding, the present invention realizes above-mentioned implementation All or part of the process in example method, can also instruct relevant hardware to complete, the meter by computer program Calculation machine program can be stored in a computer readable storage medium, the computer program when being executed by processor, it can be achieved that on The step of stating each embodiment of the method.Wherein, the computer program includes computer program code, the computer program generation Code can be source code form, object identification code form, executable file or certain intermediate forms etc..The computer-readable medium It may include: any entity or device, recording medium, USB flash disk, mobile hard disk, magnetic that can carry the computer program code Dish, CD, computer storage, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), electric carrier signal, telecommunication signal and software distribution medium etc..It should be noted that the meter The content that calculation machine readable medium includes can carry out increase and decrease appropriate according to the requirement made laws in jurisdiction with patent practice, It such as does not include electric carrier signal and telecommunications according to legislation and patent practice, computer-readable medium in certain jurisdictions Signal.
Embodiment described above is merely illustrative of the technical solution of the present invention, rather than its limitations;Although referring to aforementioned reality Applying example, invention is explained in detail, those skilled in the art should understand that: it still can be to aforementioned each Technical solution documented by embodiment is modified or equivalent replacement of some of the technical features;And these are modified Or replacement, the spirit and scope for technical solution of various embodiments of the present invention that it does not separate the essence of the corresponding technical solution should all It is included within protection scope of the present invention.

Claims (10)

1. a kind of database monitoring method characterized by comprising
The presence of each database on detection service device determines online database therein, the online database packet Include primary climate database and backup environment database;
According to the version of each online database, the acquisition index of each online database is determined respectively;
The corresponding script of acquisition index for running each online database, obtained respectively by the script it is each described The monitoring data of line database;
The monitoring data that will acquire is sent to the server, and it is each that the monitoring data is used by the server judgement A online database is whether normal operation.
2. database monitoring method as described in claim 1, which is characterized in that further include:
By calling the application programming interface of offline database in the server, by the alarm item of the offline database It is set as down state.
3. database monitoring method as described in claim 1, which is characterized in that each database on the detection service device Presence, after determining online database therein, further includes:
Obtain the access limit of each online database;
If the access limit of the online database is read-write, it is determined that the online database is main environment data base;
If the access limit of the online database is read-only, it is determined that the online database is backup environment database.
4. database monitoring method as described in claim 1, which is characterized in that each database on the detection service device Presence, after determining online database therein, further includes:
Obtain the database name and db unique name of each online database;
If the db unique name of the online database is the first preset characters and the database name of the online database Combination, it is determined that the online database is main environment data base;
If the db unique name of the online database is the second preset characters and the database name of the online database Combination, it is determined that the online database is backup environment database;
Or
Obtain the user name of each online database;
If the user name of the online database is with the beginning of third preset characters, it is determined that the online database is primary climate number According to library;
If the user name of the online database is started with the 4th preset characters, it is determined that the online database is backup environment Database.
5. database monitoring method as described in claim 1, which is characterized in that for the primary climate database, described According to the version of each online database, determine that the acquisition index of each online database includes: respectively
The mark of the acquisition in the primary climate database version information is obtained according to the version of the primary climate database;
The acquisition index of the primary climate database is determined according to the acquisition mark.
6. a kind of terminal device, which is characterized in that in the memory and can be in institute including memory, processor and storage The computer program run on processor is stated, the processor realizes following steps when executing the computer program:
The presence of each database on detection service device determines online database therein, the online database packet Include primary climate database and backup environment database;
According to the version of each online database, the acquisition index of each online database is determined respectively;
The corresponding script of acquisition index for running each online database, obtained respectively by the script it is each described The monitoring data of line database;
The monitoring data that will acquire is sent to the server, and it is each that the monitoring data is used by the server judgement A online database is whether normal operation.
7. terminal device as claimed in claim 6, which is characterized in that the processor is realized when executing the computer program Following steps:
By calling the application programming interface of offline database in the server, by the alarm item of the offline database It is set as down state.
8. terminal device as claimed in claim 6, which is characterized in that each database in threadiness on the detection service device State, after determining online database therein, further includes:
Obtain the access limit of each online database;
If the access limit of the online database is read-write, it is determined that the online database is main environment data base;
If the access limit of the online database is read-only, it is determined that the online database is backup environment database.
9. terminal device as claimed in claim 6, which is characterized in that each database in threadiness on the detection service device State, after determining online database therein, further includes:
Obtain the database name and db unique name of each online database;
If the db unique name of the online database is the first preset characters and the database name of the online database Combination, it is determined that the online database is main environment data base;
If the db unique name of the online database is the second preset characters and the database name of the online database Combination, it is determined that the online database is backup environment database;
Or
Obtain the user name of each online database;
If the user name of the online database is with the beginning of third preset characters, it is determined that the online database is primary climate number According to library;
If the user name of the online database is started with the 4th preset characters, it is determined that the online database is backup environment Database.
10. a kind of computer readable storage medium, the computer-readable recording medium storage has computer program, and feature exists In when the computer program is executed by processor the step of any one of such as claim 1 to 5 of realization the method.
CN201810788623.8A 2018-07-18 2018-07-18 Database monitoring method and terminal equipment Active CN109299064B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201810788623.8A CN109299064B (en) 2018-07-18 2018-07-18 Database monitoring method and terminal equipment
PCT/CN2018/105556 WO2020015116A1 (en) 2018-07-18 2018-09-13 Database monitoring method and terminal device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810788623.8A CN109299064B (en) 2018-07-18 2018-07-18 Database monitoring method and terminal equipment

Publications (2)

Publication Number Publication Date
CN109299064A true CN109299064A (en) 2019-02-01
CN109299064B CN109299064B (en) 2024-02-09

Family

ID=65172570

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810788623.8A Active CN109299064B (en) 2018-07-18 2018-07-18 Database monitoring method and terminal equipment

Country Status (2)

Country Link
CN (1) CN109299064B (en)
WO (1) WO2020015116A1 (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111552612A (en) * 2020-04-24 2020-08-18 杭州浮云网络科技有限公司 MSSQL monitoring management method, management device, system and computer equipment
CN113297028A (en) * 2021-03-18 2021-08-24 中国平安人寿保险股份有限公司 Script execution method and device, computer equipment and storage medium
CN113852672A (en) * 2021-09-07 2021-12-28 天翼数字生活科技有限公司 Method and system for managing and monitoring distributed data collection tasks
CN114567633A (en) * 2022-03-01 2022-05-31 上海浦东发展银行股份有限公司 Cloud platform system supporting full life cycle of multi-stack database and management method

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11907111B2 (en) * 2021-09-13 2024-02-20 Sap Se Database troubleshooting with automated functionality
CN114401273A (en) * 2022-01-18 2022-04-26 中国建设银行股份有限公司 Equipment control method and system

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104331457A (en) * 2014-10-31 2015-02-04 北京思特奇信息技术股份有限公司 Database node-based data access method and system
CN105847039A (en) * 2016-03-17 2016-08-10 王庆东 Network monitoring method and network monitoring system based on dynamic executable script
CN108121559A (en) * 2017-12-29 2018-06-05 重庆金融资产交易所有限责任公司 Configuration file method for pushing, server and storage medium

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9547675B2 (en) * 2013-07-10 2017-01-17 Oracle International Corporation Database diagnostics interface system
CN108241566A (en) * 2018-02-12 2018-07-03 黄倚霄 A kind of data-base performance monitoring method based on configuration

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104331457A (en) * 2014-10-31 2015-02-04 北京思特奇信息技术股份有限公司 Database node-based data access method and system
CN105847039A (en) * 2016-03-17 2016-08-10 王庆东 Network monitoring method and network monitoring system based on dynamic executable script
CN108121559A (en) * 2017-12-29 2018-06-05 重庆金融资产交易所有限责任公司 Configuration file method for pushing, server and storage medium

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111552612A (en) * 2020-04-24 2020-08-18 杭州浮云网络科技有限公司 MSSQL monitoring management method, management device, system and computer equipment
CN113297028A (en) * 2021-03-18 2021-08-24 中国平安人寿保险股份有限公司 Script execution method and device, computer equipment and storage medium
CN113852672A (en) * 2021-09-07 2021-12-28 天翼数字生活科技有限公司 Method and system for managing and monitoring distributed data collection tasks
CN113852672B (en) * 2021-09-07 2024-02-20 天翼数字生活科技有限公司 Method, system and medium for managing and monitoring distributed data acquisition tasks
CN114567633A (en) * 2022-03-01 2022-05-31 上海浦东发展银行股份有限公司 Cloud platform system supporting full life cycle of multi-stack database and management method

Also Published As

Publication number Publication date
CN109299064B (en) 2024-02-09
WO2020015116A1 (en) 2020-01-23

Similar Documents

Publication Publication Date Title
CN109299064A (en) Database monitoring method and terminal device
JP5102901B2 (en) Method and system for maintaining data integrity between multiple data servers across a data center
WO2023142054A1 (en) Container microservice-oriented performance monitoring and alarm method and alarm system
CN107239383A (en) A kind of failure monitoring method and device of OpenStack virtual machines
US11706080B2 (en) Providing dynamic serviceability for software-defined data centers
CN104252500A (en) Method and device for carrying out fault repairing on database management platform
CN106612312A (en) Virtualized data center scheduling system and method
CN111858176A (en) Remote monitoring fault self-healing system and method
CN107480014A (en) A kind of High Availabitity equipment switching method and device
CN106506215A (en) A kind of automation operational system based on CMDB
CN109189627A (en) A kind of hard disk failure monitor and detection method, apparatus, terminal and storage medium
CN112363865A (en) Database fault recovery method and device and face image search system
CN110098965A (en) A kind of server management system and method
CN109800133A (en) A kind of method, one-stop monitoring alarm platform and the system of unified monitoring alarm
CN106357430A (en) Method and system for service state monitoring of cloud computing cluster
CN108376110A (en) A kind of automatic testing method, system and terminal device
CN111224819A (en) Distributed messaging system
CN109271270A (en) The troubleshooting methodology, system and relevant apparatus of bottom hardware in storage system
CN109857579A (en) A kind of data processing method and relevant apparatus
CN109460311A (en) The management method and device of firmware abnormality
JP2024050522A (en) Server management system that supports multiple vendors
CN105228139B (en) A kind of call processing method, device and equipment based on smart machine
CN109040491A (en) On-hook behavior processing method, device, computer equipment and storage medium
CN106776135A (en) A kind of data back up method and device
CN108154343B (en) Emergency processing method and system for enterprise-level information system

Legal Events

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