CN109684160A - Database method for inspecting, device, equipment and computer readable storage medium - Google Patents

Database method for inspecting, device, equipment and computer readable storage medium Download PDF

Info

Publication number
CN109684160A
CN109684160A CN201811053360.2A CN201811053360A CN109684160A CN 109684160 A CN109684160 A CN 109684160A CN 201811053360 A CN201811053360 A CN 201811053360A CN 109684160 A CN109684160 A CN 109684160A
Authority
CN
China
Prior art keywords
database
inspection
data
target
account
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
CN201811053360.2A
Other languages
Chinese (zh)
Inventor
万伟
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ping An Technology Shenzhen Co Ltd
Original Assignee
Ping An Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ping An Technology Shenzhen Co Ltd filed Critical Ping An Technology Shenzhen Co Ltd
Priority to CN201811053360.2A priority Critical patent/CN109684160A/en
Publication of CN109684160A publication Critical patent/CN109684160A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3003Monitoring arrangements specially adapted to the computing system or computing system component being monitored
    • G06F11/302Monitoring arrangements specially adapted to the computing system or computing system component being monitored where the computing system component is a software system
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3065Monitoring arrangements determined by the means or processing involved in reporting the monitored data
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/32Monitoring with visual or acoustical indication of the functioning of the machine
    • G06F11/324Display of status information
    • G06F11/327Alarm or error message display

Abstract

The present invention provides a kind of database method for inspecting, comprising the following steps: is monitored to the time, when current time is in default monitoring time, logs in database inspection account corresponding with the current time and target database;Inspection operation is executed to the target database by the database inspection account, obtains inspection data;The inspection data are analyzed, judge whether the target database is abnormal;If the target database is abnormal, corresponding Exception Type is determined according to the inspection data, and alerted according to the Exception Type.The present invention also provides a kind of database inspection device, device and computer readable storage mediums.Database automatic detecting can be achieved in the present invention, improves the efficiency of inspection, to improve the Information Security of database.

Description

Database method for inspecting, device, equipment and computer readable storage medium
Technical field
The present invention relates to field of computer technology more particularly to a kind of database method for inspecting, device, equipment and computers Readable storage medium storing program for executing.
Background technique
Database (Database) is the warehouse for coming tissue, storage and management data according to data structure, fixed to database Phase carries out the important link that inspection is database daily maintenance.By checking every operating index of database, assessment system Risk is eliminated in cradle in advance, can effectively improve the quality of database service by operation risk.
At present when carrying out inspection to database, it usually needs operation maintenance personnel is logged on in database by way of manual It is operated, the indices of database is checked, judge whether the operation of its database is normal;This routine inspection mode needs A large amount of human cost is spent, and routing inspection efficiency is low, is unfavorable for the long term maintenance of database.
Summary of the invention
The main purpose of the present invention is to provide a kind of database method for inspecting, device, equipment and computer-readable storages Medium, it is intended to realize database automatic detecting, improve routing inspection efficiency.
To achieve the above object, the present invention provides a kind of database method for inspecting, the database method for inspecting include with Lower step:
Time is monitored, when current time is in default monitoring time, is logged in and the current time and target The corresponding database inspection account of database;
Inspection operation is executed to the target database by the database inspection account, obtains inspection data;
The inspection data are analyzed, judge whether the target database is abnormal;
If the target database is abnormal, corresponding Exception Type is determined according to the inspection data, and according to described Exception Type is alerted.
Optionally, described that inspection operation is executed to corresponding target database by the database inspection account, it obtains The step of inspection data includes:
Referred to according to the type of database of the patrol task of the database inspection account and the target database default It enables and obtains corresponding inspection sentence in library;
Corresponding inspection instruction is generated according to the inspection sentence, and inspection instruction is sent to the target data Library;
Receive the inspection data that the target database is returned based on inspection instruction.
Optionally, described to execute inspection operation to the target database by the database inspection account, acquisition is patrolled Examine data the step of include:
The target database is obtained in the database journal of preset time period by the database inspection account;
It is described that the inspection data are analyzed, judge whether Yi Chang step includes: the target database
The database journal is traversed, is judged with the presence or absence of abnormal keyword in the database journal, described in determination Whether target database is abnormal;
If the target database is abnormal, corresponding Exception Type is determined according to the inspection data, and according to The step of Exception Type is alerted include:
If there are the default abnormal keywords in the database journal, it is determined that the target database is abnormal;
Determine Exception Type according to exception keyword present in the database journal, and according to the Exception Type into Row alarm.
Optionally, described to execute inspection operation to the target database by the database inspection account, acquisition is patrolled Examine data the step of include:
The target database is obtained in the business statistics data of preset time period by the database account;
It is described that the inspection data are analyzed, judge whether Yi Chang step includes: the target database
By the business statistics data and corresponding preset standard data comparison, judge whether the business statistics data are different Often, whether abnormal with the determination target database;
If the target database is abnormal, corresponding Exception Type is determined according to the inspection data, and according to The step of Exception Type is alerted include:
If the business statistics data exception, it is determined that the target database is abnormal;
Exception Type is determined according to abnormal business statistics data, and is alerted according to the Exception Type.
Optionally, described to execute inspection operation to the target database by the database inspection account, acquisition is patrolled Examine data the step of include:
The target database is obtained in the high consumption query statement information of preset time period by the database account;
It is described that inspection operation is executed to the target database by the database inspection account, obtain inspection data After step, further includes:
Corresponding target matrix is determined according to the high consumption query statement information, and according to the high consumption inquiry language Sentence information and the target matrix generate corresponding optimization prompt.
Optionally, described to execute inspection operation to the target database by the database inspection account, acquisition is patrolled After the step of examining data, further includes:
Corresponding report template is obtained according to the target database, and the inspection data are filled to the report mould Plate generates inspection report.
Optionally, described that inspection operation is executed to corresponding target database by the database inspection account, it obtains After the step of inspection data, further includes:
Exit the login of the database inspection account.
In addition, to achieve the above object, the present invention also provides a kind of database inspection device, the database inspection device Include:
Account Logon module, for being monitored to the time, when current time is in default monitoring time, login and institute State current time and the corresponding database inspection account of target database;
Data acquisition module, for executing inspection operation to the target database by the database inspection account, Obtain inspection data;
Data analysis module judges whether the target database is abnormal for analyzing the inspection data;
Abnormality alarming module determines corresponding different if abnormal for the target database according to the inspection data Normal type, and alerted according to the Exception Type.
In addition, to achieve the above object, the present invention also provides a kind of database inspection device, the database inspection device Including processor, memory and be stored on the memory and can by the database inspection program that the processor executes, When wherein the database inspection program is executed by the processor, realize such as the step of above-mentioned database method for inspecting.
In addition, to achieve the above object, it is described computer-readable the present invention also provides a kind of computer readable storage medium Database inspection program is stored on storage medium, wherein realizing as above when the database inspection program is executed by processor The step of database method for inspecting stated.
The present invention can be according to automatic log-on data library patrol task of preset time, for each database automatic running Corresponding inspection script, and auto-alarming information when abnormal, thus realize database automatic detecting, it is manual without operation maintenance personnel Inspection is carried out, the efficiency of inspection is improved, to improve the Information Security of database;And inspection can be at any time It is automatic to carry out, so as to find that the abnormal conditions of target database to be safeguarded, improve the quality of database service in time; In addition, being to select corresponding alarm mode to be alerted according to Exception Type when being alerted, so that alarm can be more Closing to reality situation realizes more accurate alarm, is conducive to improve O&M efficiency.
Detailed description of the invention
Fig. 1 is the hardware structural diagram of database inspection device involved in the embodiment of the present invention;
Fig. 2 is the flow diagram of database method for inspecting first embodiment of the present invention;
Fig. 3 is the flow diagram of database method for inspecting second embodiment of the present invention;
Fig. 4 is the flow diagram of database method for inspecting 3rd embodiment of the present invention;
Fig. 5 is the functional block diagram of database inspection device first embodiment of the present invention.
The embodiments will be further described with reference to the accompanying drawings for the realization, the function and the advantages of the object of the present invention.
Specific embodiment
It should be appreciated that the specific embodiments described herein are merely illustrative of the present invention, it is not intended to limit the present invention.
The present embodiments relate to database method for inspecting be mainly used in database inspection device, the database inspection Equipment can be personal computer (personal computer, PC), laptop, server etc. with data processing function The equipment of energy.
Referring to Fig.1, Fig. 1 is the hardware structural diagram of database inspection device involved in the embodiment of the present invention. In the embodiment of the present invention, database inspection device may include (such as the central processing unit Central of processor 1001 Processing Unit, CPU), communication bus 1002, user interface 1003, network interface 1004, memory 1005.Wherein, Communication bus 1002 is for realizing the connection communication between these components;User interface 1003 may include display screen (Display), input unit such as keyboard (Keyboard);Network interface 1004 optionally may include that the wired of standard connects Mouth, wireless interface (such as Wireless Fidelity WIreless-FIdelity, WI-FI interface);Memory 1005 can be high speed and deposit at random Access to memory (random access memory, RAM), is also possible to stable memory (non-volatile memory), Such as magnetic disk storage, memory 1005 optionally can also be the storage device independently of aforementioned processor 1001.This field Technical staff is appreciated that hardware configuration shown in Fig. 1 and does not constitute a limitation of the invention, and may include more than illustrating Or less component, perhaps combine certain components or different component layouts.
With continued reference to Fig. 1, the memory 1005 in Fig. 1 as a kind of computer readable storage medium may include operation system System, network communication module and database inspection program.In Fig. 1, network communication module can be used for connecting database, with data Library carries out data communication;And processor 1001 can call the database inspection program stored in memory 1005, and execute sheet The database method for inspecting that inventive embodiments provide.
The embodiment of the invention provides a kind of database method for inspecting.
It is the flow diagram of database method for inspecting first embodiment of the present invention referring to Fig. 2, Fig. 2.
In the present embodiment, the database method for inspecting the following steps are included:
Step S10, is monitored the time, when current time is in default monitoring time, when logging in and is described current Between database inspection account corresponding with target database;
Database (Database) is the warehouse for coming tissue, storage and management data according to data structure, fixed to database Phase carries out the important link that inspection is database daily maintenance.By checking every operating index of database, assessment system Operation risk, and carry out being correspondingly improved processing, the quality of database service can be effectively improved.It is carried out at present to database When inspection, it usually needs operation maintenance personnel is logged on in database by way of manual to be operated, and is referred to the items of database Mark is checked judge whether the operation of its database is normal;This routine inspection mode needs to spend a large amount of human cost, and Routing inspection efficiency is low, is unfavorable for the long term maintenance of database.In this regard, proposing a kind of database method for inspecting in the present embodiment, press According to automatic log-on data library patrol task of preset time, carried out for the corresponding inspection script of each database automatic running Inspection, and corresponding warning information is issued when noting abnormalities, to realize database automatic detecting, improve routing inspection efficiency.
Database method for inspecting is realized by database inspection device in the present embodiment, which is taken with inspection It is illustrated for business device.Patrol checking server in this case is previously provided with several patrol tasks, wherein each patrol task packet Including monitoring time, (monitoring time can be to be indicated in a manner of designated value, is also possible to the table in a manner of frequency, spacing value Show), the target data library name of inspection or database address (examined in determination), database inspection account information etc..Certainly, it each patrols The content of inspection task can be different, such as the monitoring time of database a can be daily 9 points and 15 points, and used patrols Inspection account is admin_a;Database b be then inspection account primary every inspection in 3 hours, used be admin_b.Inspection clothes Business device the time can be monitored, when detecting that current time belongs to the monitoring time of some patrol task, it will with it is right The target database answered is attached, and carries out logging on to target database according to the inspection account information in patrol task, Carry out the inspection movement of next step.
Further, for the automated log on process of the database inspection account, it can be and realized by way of script , the type of the script can be the type according to database or the mode according to patrol checking server linking objective database (or unfolding mode of database) is specifically arranged.For example, for the target database of oracle type, patrol checking server (or other inquiring client terminals) is usually to be interacted therewith using SQL*PLUS, therefore the logon script of automated log on, can be with It is to be write using the mode of SQL (Structured Query Language, structured query language);In another example target Database can be accessed by inputting relevant database address domain name in a browser, therefore the login foot of automated log on This, can be using JS (JavaScript, a kind of literal translation formula scripting language, its interpreter are referred to as JavaScript engine, For a part of browser) mode write.When being in preset time, patrol checking server will can read corresponding login Script, and select suitable resolution rules (or tool) to parse script according to the type of the logon script, determine its behaviour Make meaning, executes corresponding login movement, realize logging in automatically for database inspection account.
Step S20 executes inspection operation to the target database by the database inspection account, obtains inspection number According to;
In the present embodiment, patrol checking server obtains target database when completing the login of database inspection account Operating right, and carry out corresponding inspection operation by the operating right.Specifically, patrol checking server can according to inspection item Corresponding operational order is sent to target database, so that target database returns to corresponding inspection number according to the operational order According to.
Wherein, since patrol checking server may be to need to carry out multiple and different database inspection, and each database Type and want the item of inspection that there may be difference, that is to say, that the inspection instruction that patrol checking server is sent to each database Format may also can be distinct.Inspection is stored in this regard, can be and each database may be used inspection sentence in advance Server (or in other memory spaces), these inspection sentences may relate to multiple and different type of database and difference Inspection item (task);When carrying out inspection, Patrol Inspection Database according to the patrol task of the inspection account currently logged in and The type of target database obtains corresponding inspection sentence, and generates corresponding inspection according to the inspection sentence and instruct;It is obtaining When inspection instructs, which can be instructed and be sent to target database by patrol checking server, so that target data is according to the inspection Inspection sentence in instruction executes the operation such as corresponding data query, data statistics, and returns to corresponding patrol to patrol checking server Examine data;The patrol checking server inspection data ready to receive returned to target database based on inspection instruction at this time.
It is worth noting that different behaviour can be set for different inspection accounts in the considerations of for Information Security Make permission, patrol checking server can also be instructed according to the operating right of inspection account in inspection while generating inspection instruction It is middle to add corresponding capability identification;Target database first has to according to the capability identification when receiving inspection instruction to patrolling The operating right of inspection server is verified, and judges whether inspection sentence matches with the capability identification;If the two matches, number of targets Relevant operation can be just executed according to library;If the two mismatches, target database can return to corresponding have no right to patrol checking server Limit prompt.In the above manner, to execute the inspection operation under the operating right when using the inspection account, avoid Safety problem caused by inspection account is stolen or other reasons.
Certainly, patrol checking server may also require that database with specified when sending inspection instruction to target database Form returns to corresponding statistical data, to facilitate the processing of subsequent interpretation or storage, such as can specify with xml, json etc. Format returned data, the call format are also that addition is sent to database in inspection instruction together.
Further, for database, generally corresponding data can be generated according to daily business processing situation Library log, record has relevant abnormality processing event in database journal;Therefore, patrol checking server patrols target database Inspection can be and be carried out according to the database journal of target database.Specifically, patrol checking server can pass through database inspection account Corresponding log acquisition instructions are sent to target database, to obtain the database journal of target database.Certainly, due to inspection It is to execute in the period, therefore when obtaining database journal, can be the number obtained in a certain preset time period (polling period) According to library log, to reduce volume of transmitted data and subsequent analysis workload, routing inspection efficiency is improved.
Further, database journal is usually with entry events record traffic disposition, and in practical inspection Cheng Zhong needs to analyze the whole service conditions of database toward contact;Therefore, patrol checking server patrols target database Inspection can also be and be carried out according to the statistical data of target database.Specifically, patrol checking server can pass through database inspection account Send corresponding business statistics instruction to target database, to obtain the business statistics data of object library, as APP applications, certain The inquiry times etc. of one data.Certainly, when obtaining business statistics data, it is also possible to obtain the industry in a certain preset time period Business statistical data.
Step S30 analyzes the inspection data, judges whether the target database is abnormal;
In the present embodiment, patrol checking server is when getting inspection data, it will analyzes inspection data, judges number Whether exception has occurred according to the operation (or business) in library.And for the difference of inspection data type, the method for analysis can Can also have difference.
When needing the database journal to target database to analyze, can be by the method for keyword match into Row analysis.Specifically, database is in record log, for different types of business (event), will use different character or Keyword is marked;In this regard, the corresponding abnormal keyword of all anomalous events can be preset in patrol checking server, when obtaining When getting database journal, it will carry out full text traversal to database journal, judge to close in database journal with the presence or absence of abnormal Key word;If there is abnormal keyword in database journal, record has relevant anomalous event in database of descriptions log, i.e., Determine target database exception;Otherwise determine that target database is normal.
When needing the business statistics data to target database to analyze, then it can be and judge that business statistics data are It is no in normal range (NR), to judge whether target database normal.Specifically, database is in normal use process, business Statistical data generally can be in a certain normal range (NR);In this regard, corresponding preset standard data can be preset in patrol checking server (such as upper limit threshold and/or lower threshold), when getting business statistics data, it will business statistics data are preset with this In the normal range whether normal data is compared, judge business statistics data;If the business statistics data are not in normal model In enclosing, then it is believed that business statistics data exception, can determine target database exception at this time;Otherwise determining target database is Normally.For example, preset standard data of the APP applications in some period are 500 (lower thresholds) and 3000 (upper limit thresholds Value), i.e., normal APP applications should be between 500 to 3000 in the period;And if the APP applications counted on are less than 500 Or it is greater than 3000, then it is assumed that the business statistics data exception, at this time it is believed that target database exception (may be that can not provide number According to or be that single situation is brushed by malice).In addition, for same business statistics data, according to the difference of monitoring time, Different preset standard data (i.e. different time Anomaly standard is different) can be arranged to, for example, for the APP of a database Applications can be 10000-50000 in 9 points to 15 points of normal range (NR)s, and can be in 15 points to 9 points of normal range (NR) 8000-30000, so that the setting of standard is more in line with actual service conditions.
Step S40 determines corresponding Exception Type according to the inspection data if the target database is abnormal, and It is alerted according to the Exception Type.
In the present embodiment, when determining target database exception, patrol checking server will carry out alarm operation, such as to specified It alerts mailbox and sends alarm email, Xiang Zhiding WeChat ID sends a warning message, and sends alarm message etc. to designated mobile phone.
And in practice, since target database Exception Type is more, if all exceptions all use identical alarm side Formula then can be easy to cause visual fatigue to O&M engineer, or miss to making warning information be in a kind of unordered state Crucial, important alarm.In this regard, patrol checking server can also be accused according to the difference of Exception Type using different alarm modes It is alert.Specifically, patrol checking server when determining destination server exception, can also further determine abnormal class according to inspection data Type (type of the exception includes abnormal cause and intensity of anomaly);Then it is carried out according to Exception Type using corresponding alarm mode Alarm.For example, for APP applications, be previously provided in patrol checking server APP applications normal range (NR) (including the upper limit and Lower limit), when getting the APP applications in certain time period, whether patrol checking server will judge the APP applications normal In range;If the APP applications are not in normal range, patrol checking server will will do it alarm;At this time if APP applications It lower than normal limits and overflows within 30%, then alerting grade is warning, and patrol checking server sends alarm to alarm mailbox Mail;And if it is emerg that APP applications, which lower than normal limits and overflowing more than 30%, alert grade, patrol checking server to Designated mobile phone sends alarm message.
Further, the patrol checking server in the present embodiment is when completing an inspection, will also exit currently logging in Database inspection account;It is logged in again again when inspection starts next time, the database inspection account is avoided to log in institute for a long time Caused safety issue, while the resource loss of patrol checking server and target database both sides can also be reduced.
In the present embodiment, the time is monitored, when current time is in default monitoring time, is logged in and described current Time and the corresponding database inspection account of target database;The target database is held by the database inspection account Row inspection operation, obtains inspection data;The inspection data are analyzed, judge whether the target database is abnormal;If The target database is abnormal, then determines corresponding Exception Type according to the inspection data, and according to the Exception Type into Row alarm.In the above manner, the present embodiment can be according to automatic log-on data library patrol task of preset time, for each The corresponding inspection script of database automatic running, and auto-alarming information when abnormal, to realize database automatic detecting, nothing It needs operation maintenance personnel to carry out inspection by hand, the efficiency of inspection is improved, to improve the Information Security of database;And inspection It can carry out automatically at any time, so as to find that the abnormal conditions of target database to be safeguarded, improve number in time The quality serviced according to library;In addition, when being alerted be select corresponding alarm mode to be alerted according to Exception Type, thus So that alarm can realize more accurate alarm, be conducive to improve O&M efficiency closer to actual conditions.
It is the flow diagram of database method for inspecting second embodiment of the present invention referring to Fig. 3, Fig. 3.
Based on above-mentioned embodiment illustrated in fig. 2, in the present embodiment, step S20 includes:
Step S21 obtains the target database in the high consumption inquiry of preset time period by the database account Sentence information;
In the present embodiment, patrol checking server can also be the behavior pattern progress to target database when carrying out inspection Detection and analysis;And when being detected and analyzed to behavior pattern, conclusion whether might not will appear abnormal, but root Further data base optimization is carried out according to behavior pattern.Specifically, patrol checking server is can be by database account to target Database sends high consumption inquiry instruction, so that target database consumes in inquiry instruction statistics preset time period according to the height High consumption query statement information, such as the SQL query statement that preceding ten time-consumings are most is queried the most tables of data of number Deng.Target database can return to these height consumption query statement information after counting on these height consumption query statement information Into Patrol Inspection Database.
After step S20, further includes:
Step S50 determines corresponding target matrix according to the high consumption query statement information, and is disappeared according to the height It consumes query statement information and the target matrix generates corresponding optimization prompt.
In the present embodiment, patrol checking server can disappear when getting these height consumption query statement information according to these height Consumption query statement information determines corresponding target matrix;And there is the case where high consumption, it may be possible to the target matrix Structure design there is a problem, lead to the case where high consumption occur in inquiry;It certainly is also likely to be to be deposited in the target matrix The data of storage are significant data, are often queried use, therefore the case where high consumption occur.In this regard, patrol checking server can root Corresponding optimization prompt is generated according to these height consumption query statement information and target matrix, so that operation maintenance personnel is excellent according to this Change prompt to carry out accordingly target matrix and/or database (can certainly be operation system, the service logic of front end) Optimization, improves the quality of service.
It is the flow diagram of database method for inspecting second embodiment of the present invention referring to Fig. 4, Fig. 4.
Based on above-mentioned embodiment illustrated in fig. 2, in the present embodiment, after step S20, further includes:
Step S60 obtains corresponding report template according to the target database, and the inspection data is filled to institute Report template is stated, inspection report is generated.
In the present embodiment, patrol checking server is checked when getting inspection data in order to facilitate operation maintenance personnel, may be used also Corresponding inspection report is generated, certainly for different databases, is wrapped in the style and report of inspection report generated The content included can be different.Specifically, patrol checking server is when getting inspection data, it will obtained according to target database Take corresponding report template;This report template can be that be customized by operation maintenance personnel and be stored in patrol checking server in advance (or other Memory space) in.When obtaining report template, patrol checking server will be filled inspection data into report template, and generation is patrolled Inspection report.It wherein, may include table, statistical chart (line chart, column diagram, cake chart etc.) in inspection report;For different Analysis demand can be shown with different forms.For example, in some period, the inquiry Thread Count of database with Time change can be to be shown in the form of line chart (or curve), meanwhile, the data broken line of multiple and different types can Being shown in the same figure;In another example and for certain discrete indicators (such as 15 points inquiry Thread Count, CPU makes With rate) it can be then shown with the mode of histogram.Certainly, in order to facilitate operation maintenance personnel by inspection data and historical data into Row compares, and while obtaining report template, searches corresponding history also according to the data content to be shown in report template Data (such as the inspection data obtained when last inspection), then generate jointly according to this inspection data and historical data and patrol Inspection report.
Further, when obtaining inspection report, patrol checking server, which can be, to be sent it in corresponding management terminal, So that operation maintenance personnel is consulted;It is also possible to save it in local, is voluntarily obtained to operation maintenance personnel;It is also possible to first patrol Inspection report is stored to local, when the inspection report being locally stored is more than certain amount or calls time on presetting, then will Inspection report is sent to corresponding management terminal.
In addition, the embodiment of the present invention also provides a kind of database inspection device.
It is the functional block diagram of database inspection device first embodiment of the present invention referring to Fig. 5, Fig. 5.
In the present embodiment, the database inspection device includes:
Account Logon module 10, for being monitored to the time, when current time is in default monitoring time, log in The current time and the corresponding database inspection account of target database;
Data acquisition module 20, for executing inspection behaviour to the target database by the database inspection account Make, obtains inspection data;
Data analysis module 30 judges whether the target database is abnormal for analyzing the inspection data;
Abnormality alarming module 40 determines corresponding if abnormal for the target database according to the inspection data Exception Type, and alerted according to the Exception Type.
Wherein, each virtual functions module of above-mentioned database inspection device is stored in database inspection device shown in Fig. 1 It is functional for realizing the institute of database inspection program in memory 1005;Each module by processor 1001 execute when, it can be achieved that According to automatic log-on data library patrol task of preset time, for the corresponding inspection script of each database automatic running, And the function of auto-alarming information when abnormal.
Further, the data acquisition module 20 includes:
Sentence acquiring unit, for according to the patrol task of the database inspection account and the number of the target database Corresponding inspection sentence is obtained in preset instructions library according to library type;
Instruction sending unit instructs for generating corresponding inspection according to the inspection sentence, and the inspection is instructed It is sent to the target database,
Data receipt unit, the inspection data returned for receiving the target database based on inspection instruction.
Further, the data acquisition module 20 includes:
First acquisition unit, for obtaining the target database in preset time period by the database inspection account Database journal;
The data analysis module 30 includes:
First judging unit judges in the database journal for traversing the database journal with the presence or absence of abnormal Keyword, it is whether abnormal with the determination target database;
The abnormality alarming module 40 includes:
First determination unit, if for there are the default abnormal keywords in the database journal, it is determined that described Target database is abnormal;
First senior unit determines Exception Type for the exception keyword according to present in the database journal, and It is alerted according to the Exception Type.
Further, the data acquisition module 20 includes:
Second acquisition unit, for obtaining the target database in the industry of preset time period by the database account Business statistical data;
The data analysis module 30 includes:
Second judgment unit, for by the business statistics data and corresponding preset standard data comparison, described in judgement Whether whether business statistics data are abnormal, abnormal with the determination target database;
The abnormality alarming module 40 includes:
Second determination unit, if being used for the business statistics data exception, it is determined that the target database is abnormal;
Second Alarm Unit determines Exception Type with according to abnormal business statistics data, and according to the Exception Type It is alerted.
Further, the data acquisition module 20 includes:
Third acquiring unit, for obtaining the target database in the height of preset time period by the database account Consume query statement information;
The database inspection device further include:
Generation module is prompted, for determining corresponding target matrix, and root according to the high consumption query statement information Corresponding optimization prompt is generated according to the high consumption query statement information and the target matrix.
Further, the database inspection device further include:
Report generation module, for obtaining corresponding report template according to the target database, and by the inspection number According to filling to the report template, inspection report is generated.
Further, the database inspection device further include:
Account exits module, for exiting the login of the database inspection account.
Wherein, the function of modules is realized and above-mentioned database method for inspecting embodiment in above-mentioned database inspection device In each step it is corresponding, function and realization process no longer repeat one by one here.
In addition, the embodiment of the present invention also provides a kind of computer readable storage medium.
Database inspection program is stored on computer readable storage medium of the present invention, wherein the database inspection program When being executed by processor, realize such as the step of above-mentioned database method for inspecting.
Wherein, database inspection program, which is performed realized method, can refer to each of database method for inspecting of the present invention A embodiment, details are not described herein again.
It should be noted that, in this document, the terms "include", "comprise" or its any other variant are intended to non-row His property includes, so that the process, method, article or the system that include a series of elements not only include those elements, and And further include other elements that are not explicitly listed, or further include for this process, method, article or system institute it is intrinsic Element.In the absence of more restrictions, the element limited by sentence "including a ...", it is not excluded that including being somebody's turn to do There is also other identical elements in the process, method of element, article or system.
The serial number of the above embodiments of the invention is only for description, does not represent the advantages or disadvantages of the embodiments.
Through the above description of the embodiments, those skilled in the art can be understood that above-described embodiment side Method can be realized by means of software and necessary general hardware platform, naturally it is also possible to by hardware, but in many cases The former is more preferably embodiment.Based on this understanding, technical solution of the present invention substantially in other words does the prior art The part contributed out can be embodied in the form of software products, which is stored in one as described above In storage medium (such as ROM/RAM, magnetic disk, CD), including some instructions are used so that terminal device (it can be mobile phone, Computer, server, air conditioner or network equipment etc.) execute method described in each embodiment of the present invention.
The above is only a preferred embodiment of the present invention, is not intended to limit the scope of the invention, all to utilize this hair Equivalent structure or equivalent flow shift made by bright specification and accompanying drawing content is applied directly or indirectly in other relevant skills Art field, is included within the scope of the present invention.

Claims (10)

1. a kind of database method for inspecting, which is characterized in that the database method for inspecting the following steps are included:
Time is monitored, when current time is in default monitoring time, is logged in and the current time and target data The corresponding database inspection account in library;
Inspection operation is executed to the target database by the database inspection account, obtains inspection data;
The inspection data are analyzed, judge whether the target database is abnormal;
If the target database is abnormal, corresponding Exception Type is determined according to the inspection data, and according to the exception Type is alerted.
2. database method for inspecting as described in claim 1, which is characterized in that described to pass through the database inspection account pair The step of corresponding target database executes inspection operation, obtains inspection data include:
According to the type of database of the patrol task of the database inspection account and the target database in preset instructions library It is middle to obtain corresponding inspection sentence;
Corresponding inspection instruction is generated according to the inspection sentence, and inspection instruction is sent to the target database;
Receive the inspection data that the target database is returned based on inspection instruction.
3. database method for inspecting as described in claim 1, which is characterized in that described to pass through the database inspection account pair The step of target database executes inspection operation, obtains inspection data include:
The target database is obtained in the database journal of preset time period by the database inspection account;
It is described that the inspection data are analyzed, judge whether Yi Chang step includes: the target database
The database journal is traversed, is judged with the presence or absence of abnormal keyword in the database journal, with the determination target Whether database is abnormal;
If the target database is abnormal, corresponding Exception Type is determined according to the inspection data, and according to described The step of Exception Type is alerted include:
If there are the default abnormal keywords in the database journal, it is determined that the target database is abnormal;
Exception Type is determined according to exception keyword present in the database journal, and is accused according to the Exception Type It is alert.
4. database method for inspecting as described in claim 1, which is characterized in that described to pass through the database inspection account pair The step of target database executes inspection operation, obtains inspection data include:
The target database is obtained in the business statistics data of preset time period by the database account;
It is described that the inspection data are analyzed, judge whether Yi Chang step includes: the target database
By the business statistics data and corresponding preset standard data comparison, judge whether the business statistics data are abnormal, It is whether abnormal with the determination target database;
If the target database is abnormal, corresponding Exception Type is determined according to the inspection data, and according to described The step of Exception Type is alerted include:
If the business statistics data exception, it is determined that the target database is abnormal;
Exception Type is determined according to abnormal business statistics data, and is alerted according to the Exception Type.
5. database method for inspecting as described in claim 1, which is characterized in that described to pass through the database inspection account pair The step of target database executes inspection operation, obtains inspection data include:
The target database is obtained in the high consumption query statement information of preset time period by the database account;
Described the step of is executed by inspection operation, obtains inspection data for the target database by the database inspection account Later, further includes:
Corresponding target matrix is determined according to the high consumption query statement information, and according to the high consumption query statement letter Breath and the target matrix generate corresponding optimization prompt.
6. database method for inspecting as described in claim 1, which is characterized in that described to pass through the database inspection account pair After the step of target database executes inspection operation, obtains inspection data, further includes:
Corresponding report template is obtained according to the target database, and the inspection data are filled to the report template, Generate inspection report.
7. such as database method for inspecting described in any one of claims 1 to 6, which is characterized in that described to pass through the data After the step of inspection account in library executes inspection operation to corresponding target database, obtains inspection data, further includes:
Exit the login of the database inspection account.
8. a kind of database inspection device, which is characterized in that the database inspection device includes:
Account Logon module, for being monitored to the time, when current time is in default monitoring time, login is worked as with described Preceding time and the corresponding database inspection account of target database;
Data acquisition module is obtained for executing inspection operation to the target database by the database inspection account Inspection data;
Data analysis module judges whether the target database is abnormal for analyzing the inspection data;
Abnormality alarming module determines corresponding exception class according to the inspection data if abnormal for the target database Type, and alerted according to the Exception Type.
9. a kind of database inspection device, which is characterized in that the database inspection device include processor, memory and It is stored on the memory and can be by the database inspection program that the processor executes, wherein the database inspection program When being executed by the processor, the step of realizing database method for inspecting as described in any one of claims 1 to 7.
10. a kind of computer readable storage medium, which is characterized in that be stored with database on the computer readable storage medium Inspection program, wherein being realized as described in any one of claims 1 to 7 when the database inspection program is executed by processor Database method for inspecting the step of.
CN201811053360.2A 2018-09-07 2018-09-07 Database method for inspecting, device, equipment and computer readable storage medium Pending CN109684160A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811053360.2A CN109684160A (en) 2018-09-07 2018-09-07 Database method for inspecting, device, equipment and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811053360.2A CN109684160A (en) 2018-09-07 2018-09-07 Database method for inspecting, device, equipment and computer readable storage medium

Publications (1)

Publication Number Publication Date
CN109684160A true CN109684160A (en) 2019-04-26

Family

ID=66185199

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811053360.2A Pending CN109684160A (en) 2018-09-07 2018-09-07 Database method for inspecting, device, equipment and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN109684160A (en)

Cited By (18)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110298666A (en) * 2019-06-21 2019-10-01 网联清算有限公司 Abnormality eliminating method and device during trading processing
CN110502400A (en) * 2019-08-23 2019-11-26 北京市燃气集团有限责任公司 Database method for inspecting and device
CN110851324A (en) * 2019-10-25 2020-02-28 泰康保险集团股份有限公司 Log-based routing inspection processing method and device, electronic equipment and storage medium
CN111047417A (en) * 2019-12-24 2020-04-21 北京每日优鲜电子商务有限公司 Service monitoring method, device, equipment and storage medium
CN111522717A (en) * 2020-04-23 2020-08-11 深圳市快付通金融网络科技服务有限公司 Resource inspection method, system and computer readable storage medium
CN111966573A (en) * 2020-04-14 2020-11-20 北京中交兴路信息科技有限公司 Automatic inspection method, device, storage medium and terminal
CN112017323A (en) * 2019-05-30 2020-12-01 深圳市优必选科技有限公司 Patrol alarm method and device, readable storage medium and terminal equipment
CN113129469A (en) * 2021-04-08 2021-07-16 深圳市国汇计量质量检测有限公司 Inspection monitoring method and system and computer readable storage medium
CN113590432A (en) * 2021-09-28 2021-11-02 云和恩墨(北京)信息技术有限公司 Database inspection method and device
CN113641567A (en) * 2021-10-13 2021-11-12 北京易真学思教育科技有限公司 Database inspection method and device, electronic equipment and storage medium
CN114842568A (en) * 2022-05-06 2022-08-02 北京华夏运通科技有限公司 Intelligent inspection method, device, equipment and storage medium
CN115083030A (en) * 2022-05-18 2022-09-20 中诚信征信有限公司 Service inspection method and device and electronic equipment
CN115270110A (en) * 2022-09-27 2022-11-01 北京圣博润高新技术股份有限公司 Account inspection method and device, electronic equipment and storage medium
CN115480995A (en) * 2022-11-01 2022-12-16 杭州沃趣科技股份有限公司 Database inspection method, device, equipment and medium
CN115499290A (en) * 2022-08-24 2022-12-20 浪潮云信息技术股份公司 Method and system for realizing automatic monitoring and routing inspection of operation and maintenance system
WO2023109079A1 (en) * 2021-12-14 2023-06-22 深圳前海微众银行股份有限公司 Table structure inspection method, table structure inspection apparatus, electronic device, and storage medium
CN116842000A (en) * 2023-07-19 2023-10-03 北京亿宇嘉隆科技有限公司 Operation and maintenance management method and system for database
CN111522717B (en) * 2020-04-23 2024-04-30 深圳市快付通金融网络科技服务有限公司 Resource inspection method, system and computer readable storage medium

Citations (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2005121953A1 (en) * 2004-06-04 2005-12-22 Fortify Software, Inc. Apparatus and method for developing, testing and monitoring secure software
CN103034802A (en) * 2012-11-29 2013-04-10 广东全通教育股份有限公司 Automatic routing inspection system and method based on intelligent rule matching
CN103079219A (en) * 2011-10-26 2013-05-01 艾默生网络能源有限公司 Base station automatic inspection digital management system and method
GB201308653D0 (en) * 2013-05-14 2013-06-26 Aims Innovation As Integration platform monitoring
CN103903312A (en) * 2012-12-27 2014-07-02 中国移动通信集团河南有限公司 Method and device for executing automatic inspection
CN104021212A (en) * 2014-06-20 2014-09-03 国家电网公司 Automatic routing inspection device for database
CN105467907A (en) * 2015-11-12 2016-04-06 浪潮集团有限公司 Automatic inspection system and method
CN105701244A (en) * 2016-02-26 2016-06-22 北京元心科技有限公司 Patrolling data processing method and patrolling server
CN105843904A (en) * 2016-03-23 2016-08-10 江苏太湖云计算信息技术股份有限公司 Monitoring alarm system for database operation performance
CN106161088A (en) * 2016-07-01 2016-11-23 成都视达科信息技术有限公司 A kind of server automatic detecting method and system based on multithreading
CN107195013A (en) * 2017-05-11 2017-09-22 国网山东省电力公司信息通信公司 The O&M automation method for inspecting and its system of a kind of fine granularity control
CN107491375A (en) * 2017-08-18 2017-12-19 国网山东省电力公司信息通信公司 Equipment detection and fault early warning system and method under a kind of cloud computing environment
CN107977467A (en) * 2017-12-21 2018-05-01 广东金赋科技股份有限公司 Database monitoring device
CN109783315A (en) * 2018-12-27 2019-05-21 远光软件股份有限公司 A kind of database platform automation method for inspecting and system
CN110502400A (en) * 2019-08-23 2019-11-26 北京市燃气集团有限责任公司 Database method for inspecting and device
CN110868313A (en) * 2018-08-28 2020-03-06 网宿科技股份有限公司 Inspection method, related device and readable storage medium

Patent Citations (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2005121953A1 (en) * 2004-06-04 2005-12-22 Fortify Software, Inc. Apparatus and method for developing, testing and monitoring secure software
CN103079219A (en) * 2011-10-26 2013-05-01 艾默生网络能源有限公司 Base station automatic inspection digital management system and method
CN103034802A (en) * 2012-11-29 2013-04-10 广东全通教育股份有限公司 Automatic routing inspection system and method based on intelligent rule matching
CN103903312A (en) * 2012-12-27 2014-07-02 中国移动通信集团河南有限公司 Method and device for executing automatic inspection
GB201308653D0 (en) * 2013-05-14 2013-06-26 Aims Innovation As Integration platform monitoring
CN104021212A (en) * 2014-06-20 2014-09-03 国家电网公司 Automatic routing inspection device for database
CN105467907A (en) * 2015-11-12 2016-04-06 浪潮集团有限公司 Automatic inspection system and method
CN105701244A (en) * 2016-02-26 2016-06-22 北京元心科技有限公司 Patrolling data processing method and patrolling server
CN105843904A (en) * 2016-03-23 2016-08-10 江苏太湖云计算信息技术股份有限公司 Monitoring alarm system for database operation performance
CN106161088A (en) * 2016-07-01 2016-11-23 成都视达科信息技术有限公司 A kind of server automatic detecting method and system based on multithreading
CN107195013A (en) * 2017-05-11 2017-09-22 国网山东省电力公司信息通信公司 The O&M automation method for inspecting and its system of a kind of fine granularity control
CN107491375A (en) * 2017-08-18 2017-12-19 国网山东省电力公司信息通信公司 Equipment detection and fault early warning system and method under a kind of cloud computing environment
CN107977467A (en) * 2017-12-21 2018-05-01 广东金赋科技股份有限公司 Database monitoring device
CN110868313A (en) * 2018-08-28 2020-03-06 网宿科技股份有限公司 Inspection method, related device and readable storage medium
CN109783315A (en) * 2018-12-27 2019-05-21 远光软件股份有限公司 A kind of database platform automation method for inspecting and system
CN110502400A (en) * 2019-08-23 2019-11-26 北京市燃气集团有限责任公司 Database method for inspecting and device

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
牛少彰等: "《大学计算机基础实验指导》", 31 August 2013 *

Cited By (25)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112017323A (en) * 2019-05-30 2020-12-01 深圳市优必选科技有限公司 Patrol alarm method and device, readable storage medium and terminal equipment
CN110298666B (en) * 2019-06-21 2022-08-30 网联清算有限公司 Exception handling method and device in transaction processing process
CN110298666A (en) * 2019-06-21 2019-10-01 网联清算有限公司 Abnormality eliminating method and device during trading processing
CN110502400A (en) * 2019-08-23 2019-11-26 北京市燃气集团有限责任公司 Database method for inspecting and device
CN110851324A (en) * 2019-10-25 2020-02-28 泰康保险集团股份有限公司 Log-based routing inspection processing method and device, electronic equipment and storage medium
CN110851324B (en) * 2019-10-25 2023-03-21 泰康保险集团股份有限公司 Log-based routing inspection processing method and device, electronic equipment and storage medium
CN111047417A (en) * 2019-12-24 2020-04-21 北京每日优鲜电子商务有限公司 Service monitoring method, device, equipment and storage medium
CN111966573A (en) * 2020-04-14 2020-11-20 北京中交兴路信息科技有限公司 Automatic inspection method, device, storage medium and terminal
CN111966573B (en) * 2020-04-14 2023-11-24 北京中交兴路信息科技有限公司 Automatic inspection method, device, storage medium and terminal
CN111522717B (en) * 2020-04-23 2024-04-30 深圳市快付通金融网络科技服务有限公司 Resource inspection method, system and computer readable storage medium
CN111522717A (en) * 2020-04-23 2020-08-11 深圳市快付通金融网络科技服务有限公司 Resource inspection method, system and computer readable storage medium
CN113129469A (en) * 2021-04-08 2021-07-16 深圳市国汇计量质量检测有限公司 Inspection monitoring method and system and computer readable storage medium
CN113590432A (en) * 2021-09-28 2021-11-02 云和恩墨(北京)信息技术有限公司 Database inspection method and device
CN113641567B (en) * 2021-10-13 2022-03-25 北京易真学思教育科技有限公司 Database inspection method and device, electronic equipment and storage medium
CN113641567A (en) * 2021-10-13 2021-11-12 北京易真学思教育科技有限公司 Database inspection method and device, electronic equipment and storage medium
WO2023109079A1 (en) * 2021-12-14 2023-06-22 深圳前海微众银行股份有限公司 Table structure inspection method, table structure inspection apparatus, electronic device, and storage medium
CN114842568A (en) * 2022-05-06 2022-08-02 北京华夏运通科技有限公司 Intelligent inspection method, device, equipment and storage medium
CN115083030A (en) * 2022-05-18 2022-09-20 中诚信征信有限公司 Service inspection method and device and electronic equipment
CN115499290A (en) * 2022-08-24 2022-12-20 浪潮云信息技术股份公司 Method and system for realizing automatic monitoring and routing inspection of operation and maintenance system
CN115270110A (en) * 2022-09-27 2022-11-01 北京圣博润高新技术股份有限公司 Account inspection method and device, electronic equipment and storage medium
CN115270110B (en) * 2022-09-27 2023-01-03 北京圣博润高新技术股份有限公司 Account inspection method and device, electronic equipment and storage medium
CN115480995B (en) * 2022-11-01 2023-02-28 杭州沃趣科技股份有限公司 Database inspection method, device, equipment and medium
CN115480995A (en) * 2022-11-01 2022-12-16 杭州沃趣科技股份有限公司 Database inspection method, device, equipment and medium
CN116842000A (en) * 2023-07-19 2023-10-03 北京亿宇嘉隆科技有限公司 Operation and maintenance management method and system for database
CN116842000B (en) * 2023-07-19 2024-01-02 北京亿宇嘉隆科技有限公司 Operation and maintenance management method and system for database

Similar Documents

Publication Publication Date Title
CN109684160A (en) Database method for inspecting, device, equipment and computer readable storage medium
CN109688188A (en) Monitoring alarm method, apparatus, equipment and computer readable storage medium
CN101902366A (en) Method and system for detecting abnormal service behaviors
CN112162878A (en) Database fault discovery method and device, electronic equipment and storage medium
CN109471845A (en) Blog management method, server and computer readable storage medium
CN110765189A (en) Exception management method and system for Internet products
CN111581104A (en) DevOps research and development operation integration-based measurement method
CN109347665A (en) A kind of Website Usability alarm method and its system based on web log
CN112987696A (en) Regional power distribution network equipment management platform and operation method thereof
US7617313B1 (en) Metric transport and database load
CN113505044A (en) Database warning method, device, equipment and storage medium
CN116366374A (en) Security assessment method, system and medium for power grid network management based on big data
CN109656894A (en) Log standardization storage method, device, equipment and readable storage medium storing program for executing
CN112463432A (en) Inspection method, device and system based on index data
CN112052134A (en) Service data monitoring method and device
CN116089250A (en) Man-machine interaction optimization management system and management method
CN113835918A (en) Server fault analysis method and device
CN116955071A (en) Fault classification method, device, equipment and storage medium
CN116380228A (en) Method, system, terminal and storage medium for monitoring operation of weighing apparatus
CN108337100A (en) A kind of method and apparatus of cloud platform monitoring
CN115834172A (en) Database risk warning method, device, equipment and storage medium
CN115509854A (en) Inspection processing method, inspection server and inspection system
CN114531338A (en) Monitoring alarm and tracing method and system based on call chain data
CN113837408A (en) Traffic facility operation and maintenance management system based on equipment full-life-cycle supervision
CN112346938B (en) Operation auditing method and device, server and computer readable storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20190426

RJ01 Rejection of invention patent application after publication