CN102541885A - Method and device for detecting database blockage - Google Patents

Method and device for detecting database blockage Download PDF

Info

Publication number
CN102541885A
CN102541885A CN2010105953689A CN201010595368A CN102541885A CN 102541885 A CN102541885 A CN 102541885A CN 2010105953689 A CN2010105953689 A CN 2010105953689A CN 201010595368 A CN201010595368 A CN 201010595368A CN 102541885 A CN102541885 A CN 102541885A
Authority
CN
China
Prior art keywords
database
data
response time
information
storage
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
CN2010105953689A
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.)
China Mobile Group Zhejiang Co Ltd
Original Assignee
China Mobile Group Zhejiang 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 China Mobile Group Zhejiang Co Ltd filed Critical China Mobile Group Zhejiang Co Ltd
Priority to CN2010105953689A priority Critical patent/CN102541885A/en
Publication of CN102541885A publication Critical patent/CN102541885A/en
Pending legal-status Critical Current

Links

Images

Abstract

The invention discloses a method and a device for detecting database blockage. The method includes the steps: receiving database detection commands, reading stored current data acquired from databases according to a preset time period, and acquiring detection and analysis results and detected database response time information from the read current data; determining classified databases of the detection and acquisition results according to pre-stored classified database information, inquiring pre-stored classified database response time information and acquiring the corresponding database response time information of the classified databases; and determining the database blockage if the detected database response time exceeds acquired database response time by means of inquiry. By the aid of the method and the device, the detection efficiency of the databases at the HANG state can be improved.

Description

A kind of method and device that detects the database obstruction
Technical field
(particularly a kind of detection database blocks the method and the device of (HANG) for DB, DataBase) technology to the present invention relates to the ORACLE database.
Background technology
No matter present database is to be used for data warehouse or service data storage, all comprises abundant mass data object information; Thereby, safeguard and ensure database performance, i.e. data bank service processing power; For in time searching and showing that the information of user's needs is great challenge, when database performance decline can't be satisfied the requirement of applied business processing power, will cause the applied business service to be blocked; Make the user perceive obviously that applied business is handled slowly, the processing time is long; Have a strong impact on user experience, in describing below, this phenomenon of database has been referred to as database HANG.
Cause the factor of database HANG more; Mainly comprise: database process is unusual, a large amount of input and output (I/O of database; Input/Output) waiting event and the concurrent waiting event of database etc., wherein, the database abnormal process can consume a large amount of CPU; Internal memory or I/O resource, cause the database response time long, foreground queries is slow; And database I/O waiting event and concurrent waiting event will cause database Whole Response overlong time, thereby influence applied business.
Because the factor that influence database performance is more, thereby, in the prior art, database HANG is detected and there is certain degree of difficulty in judgement, in actual production process, often adopt following dual mode to detect whether HANG of database, make brief description below respectively.
One of which; Adopt the determination methods of professional perception or service impact: database maintenance personnel or developer monitor and find that professional perception or business processing are affected; The monitoring information of will being correlated with reports to data base administrator (DBA; Database Administrator), DBA handles to eliminate database HANG according to the relevant monitoring information of report.
Its two, DBA conducts interviews to database through the call operation system command, obtains the database related data information; For example; Obtain active session historical record (ASH, the ActiveSession History) information and automatic load information bank (AWR, the Auto Workload Repository) information of storing in the database; According to CPU time stamp (CPU TIME) SNAPSHOT INFO, the disk input and output (I/O that comprise in the data message that returns; Whether Input/Output) inspection such as information, analysis operation system performance be unusual, or, come whether HANG of judgment data storehouse according to the related data list item that comprises in the data message that returns.
By above-mentioned visible, the existing method that detects database HANG is for first kind of detection method; Because need database maintenance personnel or developer monitoring and report to DBA, then, DBA handles according to the relevant information of report again; And in reporting process, database has been in and has stopped response or the extremely slow state such as the HANG of grade of response, thereby; Cause large-area applied business to be affected, fast detecting database HANG problem effectively, detection efficiency is low.And for second kind of method that detects through artificial call operation system command, if before database being conducted interviews or login, database has been in the HANG state; The watchdog routine that is connected to database is HANG, and all database related data information also all can't normally be gathered, sent, and make DBA can't visit or sign in to database and go to check relevant Database Dynamic performance parameter; And database is when being in the HANG state, and the related data information of its storage can't be visited; Make DBA can not in time obtain related data information, thereby, can not analyze timely, handle according to related data information; Simultaneously also prolonged the database failure time; It is professional to have had a strong impact on foreground application, fast detecting database HANG problem effectively, and detection efficiency is lower; And because quantity database is huge, if all adopt artificial detection method for all databases, workload is very big, and, can not in time reflect the database current states.In addition, the existing method that detects database HANG has passivity, has only through manual operation, just might obtain the database relevant information.
Summary of the invention
In view of this, fundamental purpose of the present invention is to propose a kind of method that detects database HANG, improves database and is in HANG status detection efficient.
Another object of the present invention is to propose a kind of device that detects database HANG, improve database and be in HANG status detection efficient.
For achieving the above object, the invention provides a kind of method that detects database HANG, this method comprises:
Receive database and detect instruction, read the current data of from database, gathering storage according to the predefined time cycle, and from the current data that reads, obtain the database response temporal information of check and analysis result and detection;
According to the taxonomy database under the grouped data library information check and analysis result that confirms to obtain of storage in advance, inquiry is the database response temporal information of the classification of storage in advance, the database response temporal information that the taxonomy database under obtaining is corresponding;
If the database response time of detecting exceeds the database response time that inquiry is obtained, the specified data storehouse is blocked.
The step of the database response temporal information of the grouped data library information of said storage in advance and the classification of storing in advance specifically comprises:
According to the predefined time cycle, image data and storing from database;
Receive the response time model command, read the data of storage, add up, analyze, obtain the classification analysis result,, and from data, obtain the database response temporal information of classification according to the analysis result taxonomy database;
The database response temporal information of storage grouped data library information and classification.
Data with the collection of extensible language tab file format.
The said data that read storage are added up, are analyzed, and obtain the classification analysis result, specifically comprise according to the analysis result taxonomy database:
CPU time according to image data comprises is stabbed SNAPSHOT INFO and I/O information, adds up respectively, obtains the ratio that takies of corresponding D B CPU time and User I/O stand-by period, and according to the ratio ranges of obtaining that takies database is classified.
Said database is categorized as I/O type Database Systems, CPU type Database Systems and mixed type Database Systems, wherein,
First ratio and DB CPU time that said I/O type Database Systems took more than or equal to setting in advance for the User I/O stand-by period of adding up take the database that is less than or equal to second ratio that is provided with in advance;
Said CPU type Database Systems took and are less than or equal in advance the 3rd ratio and the DB CPU time that are provided with and take the database more than or equal to the 4th ratio that is provided with in advance for User I/O stand-by period of statistics;
Said mixed type Database Systems took and are approximately equal in advance the 5th ratio and the DB CPU time that are provided with and take the database that is approximately equal to the 6th ratio that is provided with in advance for User I/O stand-by period of statistics.
Further comprise: timeout threshold is set in advance,
If in the timeout threshold that is provided with in advance, from database, do not collect data, the specified data storehouse is in blocked state.
After the said current data that reads storage, add up, analyze before, further comprise:
Obtain the corresponding acquisition time of data of current storage, whether the difference of judging acquisition time and current time above the predefined time cycle, if the specified data storehouse is in blocked state, otherwise, carry out the step of said statistics, analysis.
The data of said collection belong to CPU type Database Systems, and the database response time of said detection exceeds inquiry database response time of obtaining and specifically comprises:
ST+AT>δ 1CAnd AT>ε 1C, or,
ST+AT>δ 2CAnd ST>ε 2C,
In the formula,
The database response time that ST obtains for statistics, unit is a millisecond,
The simulation application response time that AT obtains for statistics, unit is a millisecond,
δ 1C, ε 1C, δ 2C, ε 2CCPU type Database Systems database response time threshold for storage.
The data of said collection belong to I/O type Database Systems, and the database response time of said detection exceeds inquiry database response time of obtaining and specifically comprises:
ST+AT>δ 1IAnd AT>ε 1IOr,
ST+AT>δ 2IAnd AT>ε 2I
In the formula,
The database response time that ST obtains for statistics, unit is a millisecond,
The simulation application response time that AT obtains for statistics, unit is a millisecond,
δ 1I, ε 1I, δ 2I, ε 2II/O type Database Systems database response time threshold for storage.
The data of said collection belong to the mixed type Database Systems, and the database response time of said detection exceeds inquiry database response time of obtaining and specifically comprises:
ST+AT>δ 1HAnd AT>ε 1HOr,
ST+AT>δ 2HAnd ST>ε 2H
In the formula,
The database response time that ST obtains for statistics, unit is a millisecond,
The simulation application response time that AT obtains for statistics, unit is a millisecond,
δ 1H, ε 1H, δ 2H, ε 2HMixed type Database Systems database response time threshold for storage.
A kind of device that detects the database obstruction, this device comprises: information acquisition engine modules, data storage engine modules, intellectual analysis engine modules, response time model module and judge module, wherein,
The information acquisition engine modules was used for according to the predefined time cycle, and image data from the database of outside exports the data storage engine modules to;
The data storage engine modules is used to receive the data of collection, stores;
The intellectual analysis engine modules is used to receive database and detects instruction, reads the current data of storage from the data storage engine modules, and from the current data that reads, obtains the database response temporal information of check and analysis result and detection, exports judge module to;
The response time model module is used to store the grouped data library information of setting in advance and the database response temporal information of classification;
Judge module; Taxonomy database under the check and analysis result who is used for confirming to receive according to the grouped data library information of response time model module storage; Obtain the corresponding database response temporal information of affiliated taxonomy database from the response time model module; Compare with the database response temporal information of the detection of intellectual analysis engine modules output, if the database response time of detecting exceeds the database response time of obtaining, the specified data storehouse is blocked.
Said information acquisition engine modules comprises: collecting unit and timer unit, wherein,
Collecting unit is used to receive the trigger pip that timer unit is exported, and begins image data from database, and exports the data of gathering to the data storage engine modules;
Timer unit is used to store predefined time cycle information, the time cycle of setting then, to collecting unit output trigger pip.
Said information acquisition engine modules comprises: collecting unit, timer unit and warning information unit, wherein,
Collecting unit is used to receive the trigger pip that timer unit is exported, and begins image data from database, and after collecting data, exports the data of gathering to the data storage engine modules, gathers completion information to timer unit output;
Timer unit; Be used to store predefined time cycle information, the time cycle of setting then, to collecting unit output trigger pip; If in predefined time threshold, do not receive the completion information of gathering, to warning information unit output trigger pip;
The warning information unit is used to receive trigger pip, generates warning information, sends according to the information that is provided with in advance.
Said intellectual analysis engine modules comprises: statistic of classification unit, classification response time statistic unit and detection data processing, wherein,
The statistic of classification unit is used for reading the data of storage from the data storage engine modules according to the response time model command that receives; Add up, analyze; Obtain analysis result,, export the grouped data library information to the response time model module according to the analysis result taxonomy database;
Classification response time statistic unit is used for reading the grouped data library information from the response time model module, the data of data storage engines module stores is classified, and obtain the database response temporal information of classification, exports the response time model module to;
Detect data processing unit; Be used for detecting instruction, read the data of current storage, add up, analyze from the data storage engine modules according to the database that receives; Obtain the check and analysis result and obtain the database response temporal information of detection, export judge module to.
Further comprise: use the API engine modules, be used for, the database current state information is exported to the data base administrator who is provided with in advance according to the judged result of judge module to database positioning.
Visible by above-mentioned technical scheme; A kind of method and device that detects database HANG provided by the invention; Receive database and detect instruction; Read the current data of from database, gathering storage according to the predefined time cycle, and from the current data that reads, obtain the database response temporal information of check and analysis result and detection; According to the taxonomy database under the grouped data library information check and analysis result that confirms to obtain of storage in advance, inquiry is the database response temporal information of the classification of storage in advance, the database response temporal information that the taxonomy database under obtaining is corresponding; If the database response time of detecting exceeds the database response time that inquiry is obtained, the specified data storehouse is blocked.Like this; Through image data and store, evaded manually-operated and used database as storage medium, when database failure, cause can't reading writing information defective; Setting-up time cycle and response time model are to judge in several ways automatically; Can in time obtain the status information of database, and the real-time warning information that forms is sent to relevant DBA when database is in the HANG state, has improved detection efficiency.
Description of drawings
Fig. 1 detects the method flow synoptic diagram of database HANG for the embodiment of the invention.
Fig. 2 is an embodiment of the invention model structure time response synoptic diagram.
Fig. 3 detects the apparatus structure synoptic diagram of database HANG for the embodiment of the invention.
Embodiment
For making the object of the invention, technical scheme and advantage clearer, will combine accompanying drawing and specific embodiment that the present invention is done to describe in detail further below.
In the prior art; No matter be detection method one or detection method two; All need adopt artificial mode through real-time monitoring, perception or pass through call operation system command accessing database, judge, make detection efficiency lower according to the coherent detection data message that perception or visit obtain; Can not in time obtain the information that database is in the HANG state, thereby fail timely maintenance data base.In the embodiment of the invention,, adopt SQL (SQL through the sampling period is set; Structured Query Language) from database, gathers access data information; And the data message of gathering preserved with extend markup language (XML, Extensible Markup Language) file layout, thereby can't obtain the problem of related data information in the database when avoiding database to be in the HANG state; Simultaneously; Through the data message of preserving is added up, is analyzed, according to analyze, the result of statistics classifies to database, and obtain respectively classification the database response temporal information and application response time information; Generation is used for the response time model (RSM that characterization database blocks; Response Time Model), and be technical indicator, according to the current data information of preserving with the XML document form that obtains through the sampling period sampling with RSM; Under obtaining database and the associated databases response time information of classification and application response time information, relatively detect database automatically with technical indicator RSM and whether be in the HANG state.Like this, through taking all factors into consideration each factor that influences database HANG, and each influence factor being added up, analyzed, is that technical indicator detects database and whether is in the HANG state with RSM.
Fig. 1 detects the method flow synoptic diagram of database HANG for the embodiment of the invention.Referring to Fig. 1, this flow process comprises:
Step 101 is gathered and is obtained the data of storing in the database;
In this step,, can pass through the call operation system command, from database, gather the data of storage in order to make up the response time model of the embodiment of the invention.Certainly, sampling period and total sampling time also can be set, thereby obtain the data of storing in the database in this total sampling time.
The data of storage comprise: ASH data and AWR data, wherein, comprise the information of current each portable terminal (user) accessing database in the ASH data, and comprise the historical information of each mobile terminal accessing database in the AWR data.
In the practical application, when passing through the different operating systems accessing database owing to different mobile terminals, the response time of database is also different; Thereby; The particular content that ASH data that each portable terminal is corresponding and AWR data comprise is also different, depends on CPU time stamp SNAPSHOT INFO and input/output information, in the embodiment of the invention; Through obtaining the data of storing in the database so that when analyzing the different operating systems accessing database to the influence of database response time.
CPU time stabs SNAPSHOT INFO and comprises: the DB CPU time is stabbed information, database CPU usage, user's CPU usage etc., and I/O information is user (User) I/O stand-by period information.These information can directly be obtained from AWR information or ASH information, repeat no more at this.
Step 102, the data that statistics, analysis are obtained are obtained analysis result, according to the analysis result taxonomy database;
In this step,, add up respectively according to CPU time stamp SNAPSHOT INFO and the I/O information that data comprise; Obtain the ratio ranges that takies of corresponding D B CPU time and User I/O stand-by period; And can combine empirical data, and database is classified, stab the detailed description of SNAPSHOT INFO and I/O information about the CPU time; Specifically can repeat no more at this referring to the correlation technique document.In the embodiment of the invention, timestamp SNAPSHOT INFO and I/O information are the information of main frame aspect, are used to judge which kind of type applied business belongs to; AWR data and ASH data are various performance datas of database aspect.
The database of classification comprises: I/O type Database Systems, CPU type Database Systems and mixed type Database Systems, wherein,
If taking to take more than or equal to first ratio that is provided with in advance and DB CPU time, the User I/O stand-by period of statistics is less than or equal to second ratio that is provided with in advance; Then these Database Systems belong to I/O type Database Systems; Preferably, first ratio is that 90%, second ratio is 5%;
If the User I/O stand-by period of statistics takies the 3rd ratio and the DB CPU time that are less than or equal to setting in advance and takies the 4th ratio that is provided with more than or equal in advance; Then these Database Systems belong to CPU type Database Systems; Preferably, the 3rd ratio is that the 87%, the 4th ratio is 10%;
If the User I/O stand-by period of statistics takies and is approximately equal in advance the 5th ratio that is provided with and DB CPU time and takies and be approximately equal to the 6th ratio that is provided with in advance; Then these Database Systems belong to the mixed type Database Systems; Preferably, the 5th ratio is that the 30%, the 6th ratio is 50%.Wherein, approximate being appreciated that in 5% fluctuation range up and down.
Like this,,, can when the subsequent analysis database, have more specific aim, and can be criterion that the database of classification proposes its HANG respectively more accurately to detect the state of database through database is classified according to different accessing operation systems.
Step 103 is obtained the database response temporal information of classification;
In this step, the database according to classification obtains corresponding data, and the response time information that statistics comprises obtains the corresponding taxonomy database response time of current operation system.
In theory, the database response time equal the database user process consumes T.T. and logic read-write number of times and ratio, that is:
T DB R = T DB T L r + L w .
Wherein,
is the database response time;
The T.T. that consumes for the entire database consumer process;
L rFor logic is read number of times;
L wFor logic is write number of times.
Logic is read the process into Oracle read block (block) to disk from database caches (buffer cache), and it is block the number that logical I/O reads that logic is read number of times.
In the practical application, before logic is read, need the block in the database be write among the buffer cache, and then from buffer cache, read block, thereby logic reading amount has comprised physical read quantity.
In existing ASH data and AWR data, comprised the T.T. of above-mentioned database user process consumes and the relevant information of logic read-write number of times, thereby; Through obtaining the data that comprise ASH data and AWR data; Just can therefrom add up, analyze and obtain the database response temporal information, certainly, in the practical application; If be used for the ASH data and the more also binding isotherm computing formula of AWR data sample amount of statistical study, the database response time value that obtains is also just accurate more.
In conjunction with above-mentioned statistics, analysis, it is following that above-mentioned three types of Database Systems response time scopes are set respectively:
I/O type Database Systems, response time scope are 0.1~0.5 (millisecond);
CPU type Database Systems, response time scope are less than 0.01 (millisecond);
Mixed type Database Systems, response time scope are 0.05~0.1 (millisecond).
Certainly, three types of Database Systems response time scopes of above-mentioned setting have comprised response time of each applied business accessing database, are the assembly averages of each applied business accessing database response time; Thereby, in the embodiment of the invention, can also be directed against each applied business; Add up the response time of its accessing database, obtain the simulation application response time, be used to simulate whole service and handle flow process; Completion should the needed time of business, is example to handle the mobile phone set meal, need verify user identity; Check more current states, add set meal, order relations is sent to real-time account according to current state; These treatment schemees show as the operation to some list items in the database aspect, for example, to user's list item inquire about, the modification of order relations table, increase etc.According to temporal information and the empirical analysis that simulation obtains, it is following that three types of Database Systems simulation application response time scopes are set:
CPU type Database Systems, simulation application response time value is: 0.05 millisecond;
I/O type Database Systems, simulation application response time value is: 0.5 millisecond;
The mixed type Database Systems, simulation application response time value is: 0.1 millisecond.
Should explain be, the concrete numerical value that the embodiment of the invention is given an example, preferred embodiment just, its numerical value can be according to actual needs and the sample size of statistics upgrade, revise.
In the practical application; Also can combine the database response time and simulation application response time of obtaining; Generation is used for the response time model that characterization database blocks, and certainly, also can generate the response time model with database response time or simulation application response time separately.
Fig. 2 is an embodiment of the invention model structure time response synoptic diagram.Referring to Fig. 2, this, model comprised time response: database response time model and simulation application response time model, corresponding CPU type Database Systems, I/O type Database Systems and mixed type Database Systems respectively.
Step 104, according to the predefined time cycle, image data and storing from database;
In this step, can be set the acquisition time cycle, the acquisition time cycle that is provided with then, trigger image data from database automatically, and be that forms such as XML, text are stored the data-switching of gathering.Different with step 101 is; This step needs periodically data in the acquisition database, with the monitor database duty, and in the step 101; Possibly only need from database, gather once or a few secondary data, the data of collection are used for statistics and generate the response time model.Certainly, the flow process of its processing is similar.
This step further comprises: if in the timeout threshold that is provided with in advance, do not collect data, the specified data storehouse is in the HANG state.Timeout threshold can combine actual needs to be provided with according to all types of Database Systems response times.
Step 105 is obtained the corresponding acquisition time of data of current storage, judges whether the difference of acquisition time and current time surpasses the predefined time cycle, if, execution in step 107, otherwise, execution in step 106;
In this step, when database is in the HANG state, capture program can't go database to gather ASH and AWR data through normal connection; Thereby, also can't ASH and AWR data be stored, in the embodiment of the invention; From the data of storage, obtain the last snapshot (data) of gathering, judge whether should gather the snapshot time surpasses acquisition interval, the time cycle of promptly setting; For example, it is 09:25:20 that the last time of storage is gathered the snapshot time, and the acquisition interval of setting is 30 seconds; Promptly every at a distance from 30 seconds image data from database, if the current time is 09:26:00, because the mistiming of current time and collection snapshot time is greater than acquisition interval (30 seconds); Thereby, can be in the HANG state in the specified data storehouse.
Step 106 is obtained the affiliated taxonomy database and the corresponding response temporal information of data of current storage, judges whether to satisfy the response time model of classification, if, do not deal with, otherwise, execution in step 107;
In this step; According to the taxonomy database that is provided with in the step 102; Data to current storage are classified, and the treatment scheme of obtaining the database response temporal information of obtaining classification in data corresponding response temporal information and the step 103 of current storage is similar, repeats no more at this.
In the practical application, be not only that capture program can't go database collection ASH and AWR data will cause the unavailable of database through normal connection, and; If database response speed is slow; Perhaps, network blockage all will cause the unavailable of database; In the embodiment of the invention; Can't go database to gather under ASH and the AWR data conditions through normal connection at the monitoring capture program, further the situation of response time process monitored, so that can in time take measures to improve database performance.
Comprise that with the response time model database response time and simulation application response time are example below, respectively to whether satisfied response time model of classifying describes.
For CPU type Database Systems, if:
ST+AT>δ 1CAnd AT>ε 1COr,
ST+AT>δ 2CAnd ST>ε 2C
Then execution in step 107.
In the formula,
The database response time that ST obtains for statistics, unit is a millisecond;
The simulation application response time that AT obtains for statistics, unit is a millisecond;
δ 1C, ε 1C, δ 2C, ε 2CBe the CPU type Database Systems HANG threshold value that is provided with in advance, confirm according to CPU type Database Systems response time scope and actual needs, preferably, δ 1C=0.1, δ 2C=0.1, ε 1C=0.07, ε 2C=0.05.Certainly, also can get other threshold value, the concrete numerical value of the embodiment of the invention is a preferable example.
I/O type Database Systems HANG criterion:
ST+AT>δ 1IAnd AT>ε 1IOr,
ST+AT>δ 2IAnd AT>ε 2I
In the formula,
δ 1I, ε 1I, δ 2I, ε 2IBe the I/O type Database Systems HANG threshold value that is provided with in advance, preferably, δ 1I=1.5, δ 2I=1.5, ε 1I=0.9, ε 2I=0.7.
Mixed type Database Systems HANG criterion:
ST+AT>δ 1HAnd AT>ε 1HOr,
ST+AT>δ 2HAnd ST>ε 2H
In the formula,
δ 1H, ε 1H, δ 2H, ε 2HBe the mixed type Database Systems HANG threshold value that is provided with in advance, preferably, δ 1H=0.5, δ 2H=0.5, ε 1H=0.4, ε 2H=0.1.
In the practical application, as previously mentioned, the response time model also can include only database response time or simulation application response time, judges whether satisfied response time model of classifying and above-mentioned similar, repeats no more at this.
Step 107, the specified data storehouse is in the HANG state.
In this step, when the specified data storehouse is in the HANG state, can generate warning information automatically, and send to the DBA that is provided with in advance.
Further, if be provided with backup database, can also current database be switched to backup database.
So far, detect instruction, read the current data of from database, gathering storage according to the predefined time cycle, and from the current data that reads, obtain the database response temporal information of check and analysis result and detection through receiving database; According to the taxonomy database under the grouped data library information check and analysis result that confirms to obtain of storage in advance, inquiry is the database response temporal information of the classification of storage in advance, the database response temporal information that the taxonomy database under obtaining is corresponding; If the database response time of detecting exceeds the database response time that inquiry is obtained, the specified data storehouse is blocked, and this method flow that detects database HANG finishes.
By above-mentioned visible, the method for the detection database HANG of the embodiment of the invention is gathered and is obtained the data of storing in the database; The data that statistics, analysis are obtained are obtained analysis result, according to the analysis result taxonomy database; Obtain the database response temporal information of classification; According to the predefined time cycle, image data and storing from database; Obtain the corresponding acquisition time of data of current storage, judge whether the difference of acquisition time and current time surpasses the predefined time cycle, if the specified data storehouse is in the HANG state; Otherwise, obtain the affiliated taxonomy database and the corresponding response temporal information of data of current storage, judge whether to satisfy the response time model of classification, if do not satisfy, the specified data storehouse is in the HANG state.Like this, through adding up in advance, analyzing, data are classified; And obtain and be used for the response time model that characterization database blocks, according to image data and storing from database of predefined time cycle, evaded manually-operated and used database as storage medium; When database failure, cause can't reading writing information defective; Simultaneously, time cycle and response time model in conjunction with practical application operation flow, setting make it the application that more gears to actual circumstances; Can judge automatically in several ways; Can in time obtain the status information of database, and the real-time warning information that forms is sent to relevant DBA when database is in the HANG state, has improved detection efficiency.
Fig. 3 detects the apparatus structure synoptic diagram of database HANG for the embodiment of the invention.Referring to Fig. 3; This device comprises: information acquisition engine modules, data storage engine (DSE, Data Storage Engine) module, intellectual analysis engine (IAE, Intelligent Analysis Engine) module, response time model module and judge module; Wherein
The information acquisition engine modules was used for according to the predefined time cycle, and image data from the database of outside exports the data storage engine modules to;
In the embodiment of the invention, the information acquisition engine modules comprises: collecting unit and timer unit (not shown), wherein,
Collecting unit is used to receive the trigger pip that timer unit is exported, and begins image data from database, and exports the data of gathering to the data storage engine modules;
Timer unit is used to store predefined time cycle information, the time cycle of setting then, to collecting unit output trigger pip.
Further, the information acquisition engine modules also comprises the warning information unit,
Collecting unit is used to receive the trigger pip that timer unit is exported, and begins image data from database, and after collecting data, exports the data of gathering to the data storage engine modules, gathers completion information to timer unit output;
Timer unit; Be used to store predefined time cycle information, the time cycle of setting then, to collecting unit output trigger pip; If in predefined time threshold, do not receive the completion information of gathering, to warning information unit output trigger pip;
In the embodiment of the invention, time threshold is not more than the time cycle, specifically can be provided with according to actual needs.
The warning information unit is used to receive trigger pip, generates warning information, sends according to the information that is provided with in advance.
The data storage engine modules is used to receive the data of collection, stores;
In the embodiment of the invention, with the data of XML stored in file format collection.
The intellectual analysis engine modules; Be used for reading the data of storage from the data storage engine modules, add up, analyze according to the response time model command that receives; Obtain analysis result; According to the analysis result taxonomy database, obtain the database response temporal information of classification, export grouped data library information and database response temporal information to the response time model module; Receive database and detect instruction, read the current data of storage, add up, analyze, obtain analysis result and obtain the database response temporal information, export judge module to from the data storage engine modules;
In the embodiment of the invention; The intellectual analysis engine modules receives database and detects instruction; Read the current data of storage from the data storage engine modules, and from the current data that reads, obtain the database response temporal information of check and analysis result and detection, export judge module to.The response time model command can be provided with in advance, for example, triggers after can being arranged on 10 time cycles, also can import the corresponding command or calls related function and trigger through the testing staff.It can be after time cycle timing starting point is delayed Preset Time, to trigger automatically to generate that database detects instruction.
The intellectual analysis engine modules comprises: statistic of classification unit, classification response time statistic unit and detection data processing (not shown), wherein,
The statistic of classification unit is used for the response time model command that basis is provided with in advance, reads the data of storage from the data storage engine modules; Add up, analyze; Obtain analysis result,, export the grouped data library information to the response time model module according to the analysis result taxonomy database;
Classification response time statistic unit is used for reading the grouped data library information from the response time model module, the data of data storage engines module stores is classified, and obtain the database response temporal information of classification, exports the response time model module to;
Detect data processing unit, be used for detecting instruction, read the data of current storage, add up, analyze, obtain analysis result and obtain the database response temporal information, export judge module to from the data storage engine modules according to the database that is provided with in advance;
The response time model module is used to store grouped data library information and database response temporal information;
Judge module; Taxonomy database under the analysis result that is used for confirming to receive according to the grouped data library information of response time model module storage; Obtain the corresponding database response temporal information of affiliated taxonomy database from the response time model module; Compare with the database response temporal information of intellectual analysis engine modules output, whether be in the HANG state with the specified data storehouse.
This device further comprises: use API engine (IAE, Application API Engine) module, be used for according to the judged result of judge module to database positioning, the database current state information is exported to the DBA that is provided with in advance.
The above is merely preferred embodiment of the present invention, is not to be used to limit protection scope of the present invention.All within spirit of the present invention and principle, any modification of being done, be equal to replacement and improvement etc., all should be included within protection scope of the present invention.

Claims (15)

1. one kind is detected the method that database blocks, and it is characterized in that this method comprises:
Receive database and detect instruction, read the current data of from database, gathering storage according to the predefined time cycle, and from the current data that reads, obtain the database response temporal information of check and analysis result and detection;
According to the taxonomy database under the grouped data library information check and analysis result that confirms to obtain of storage in advance, inquiry is the database response temporal information of the classification of storage in advance, the database response temporal information that the taxonomy database under obtaining is corresponding;
If the database response time of detecting exceeds the database response time that inquiry is obtained, the specified data storehouse is blocked.
2. the method for claim 1 is characterized in that, said step of storing the database response temporal information of grouped data library information and storage classification in advance in advance specifically comprises:
According to the predefined time cycle, image data and storing from database;
Receive the response time model command, read the data of storage, add up, analyze, obtain the classification analysis result,, and from data, obtain the database response temporal information of classification according to the analysis result taxonomy database;
The database response temporal information of storage grouped data library information and classification.
3. method as claimed in claim 2 is characterized in that, with the data of extensible language tab file format collection.
4. method as claimed in claim 3 is characterized in that, the said data that read storage are added up, analyzed, and obtain the classification analysis result, specifically comprise according to the analysis result taxonomy database:
CPU time according to image data comprises is stabbed SNAPSHOT INFO and I/O information, adds up respectively, obtains the ratio that takies of corresponding D B CPU time and User I/O stand-by period, and according to the ratio ranges of obtaining that takies database is classified.
5. method as claimed in claim 4 is characterized in that, said database is categorized as I/O type Database Systems, CPU type Database Systems and mixed type Database Systems, wherein,
First ratio and DB CPU time that said I/O type Database Systems took more than or equal to setting in advance for the User I/O stand-by period of adding up take the database that is less than or equal to second ratio that is provided with in advance;
Said CPU type Database Systems took and are less than or equal in advance the 3rd ratio and the DB CPU time that are provided with and take the database more than or equal to the 4th ratio that is provided with in advance for User I/O stand-by period of statistics;
Said mixed type Database Systems took and are approximately equal in advance the 5th ratio and the DB CPU time that are provided with and take the database that is approximately equal to the 6th ratio that is provided with in advance for User I/O stand-by period of statistics.
6. like each described method of claim 2 to 5, it is characterized in that, further comprise: timeout threshold is set in advance,
If in the timeout threshold that is provided with in advance, from database, do not collect data, the specified data storehouse is in blocked state.
7. like each described method of claim 2 to 5, it is characterized in that, after the said data that read storage, add up, analyze before, further comprise:
Obtain the corresponding acquisition time of data of current storage, whether the difference of judging acquisition time and current time above the predefined time cycle, if the specified data storehouse is in blocked state, otherwise, carry out the step of said statistics, analysis.
8. method as claimed in claim 7 is characterized in that, the data of said collection belong to CPU type Database Systems, and the database response time of said detection exceeds inquiry database response time of obtaining and specifically comprises:
ST+AT>δ 1CAnd AT>ε 1C, or,
ST+AT>δ 2CAnd ST>ε 2C,
In the formula,
The database response time that ST obtains for statistics, unit is a millisecond,
The simulation application response time that AT obtains for statistics, unit is a millisecond,
δ 1C, ε 1C, δ 2C, ε 2CCPU type Database Systems database response time threshold for storage.
9. method as claimed in claim 7 is characterized in that, the data of said collection belong to I/O type Database Systems, and the database response time of said detection exceeds inquiry database response time of obtaining and specifically comprises:
ST+AT>δ 1IAnd AT>ε 1IOr,
ST+AT>δ 2IAnd AT>ε 2I
In the formula,
The database response time that ST obtains for statistics, unit is a millisecond,
The simulation application response time that AT obtains for statistics, unit is a millisecond,
δ 1I, ε 1I, δ 2I, ε 2II/O type Database Systems database response time threshold for storage.
10. method as claimed in claim 7 is characterized in that the data of said collection belong to the mixed type Database Systems, and the database response time of said detection exceeds inquiry database response time of obtaining and specifically comprises:
ST+AT>δ 1HAnd AT>ε 1HOr,
ST+AT>δ 2HAnd ST>ε 2H
In the formula,
The database response time that ST obtains for statistics, unit is a millisecond,
The simulation application response time that AT obtains for statistics, unit is a millisecond,
δ 1H, ε 1H, δ 2H, ε 2HMixed type Database Systems database response time threshold for storage.
11. one kind is detected the device that database blocks, it is characterized in that this device comprises: information acquisition engine modules, data storage engine modules, intellectual analysis engine modules, response time model module and judge module, wherein,
The information acquisition engine modules was used for according to the predefined time cycle, and image data from the database of outside exports the data storage engine modules to;
The data storage engine modules is used to receive the data of collection, stores;
The intellectual analysis engine modules is used to receive database and detects instruction, reads the current data of storage from the data storage engine modules, and from the current data that reads, obtains the database response temporal information of check and analysis result and detection, exports judge module to;
The response time model module is used to store the grouped data library information of setting in advance and the database response temporal information of classification;
Judge module; Taxonomy database under the check and analysis result who is used for confirming to receive according to the grouped data library information of response time model module storage; Obtain the corresponding database response temporal information of affiliated taxonomy database from the response time model module; Compare with the database response temporal information of the detection of intellectual analysis engine modules output, if the database response time of detecting exceeds the database response time of obtaining, the specified data storehouse is blocked.
12. device as claimed in claim 11 is characterized in that, said information acquisition engine modules comprises: collecting unit and timer unit, wherein,
Collecting unit is used to receive the trigger pip that timer unit is exported, and begins image data from database, and exports the data of gathering to the data storage engine modules;
Timer unit is used to store predefined time cycle information, the time cycle of setting then, to collecting unit output trigger pip.
13. device as claimed in claim 11 is characterized in that, said information acquisition engine modules comprises: collecting unit, timer unit and warning information unit, wherein,
Collecting unit is used to receive the trigger pip that timer unit is exported, and begins image data from database, and after collecting data, exports the data of gathering to the data storage engine modules, gathers completion information to timer unit output;
Timer unit; Be used to store predefined time cycle information, the time cycle of setting then, to collecting unit output trigger pip; If in predefined time threshold, do not receive the completion information of gathering, to warning information unit output trigger pip;
The warning information unit is used to receive trigger pip, generates warning information, sends according to the information that is provided with in advance.
14. device as claimed in claim 11 is characterized in that, said intellectual analysis engine modules comprises: statistic of classification unit, classification response time statistic unit and detection data processing, wherein,
The statistic of classification unit is used for reading the data of storage from the data storage engine modules according to the response time model command that receives; Add up, analyze; Obtain analysis result,, export the grouped data library information to the response time model module according to the analysis result taxonomy database;
Classification response time statistic unit is used for reading the grouped data library information from the response time model module, the data of data storage engines module stores is classified, and obtain the database response temporal information of classification, exports the response time model module to;
Detect data processing unit; Be used for detecting instruction, read the data of current storage, add up, analyze from the data storage engine modules according to the database that receives; Obtain the check and analysis result and obtain the database response temporal information of detection, export judge module to.
15. like each described device of claim 11 to 14; It is characterized in that; Further comprise: use the API engine modules, be used for, the database current state information is exported to the data base administrator who is provided with in advance according to the judged result of judge module to database positioning.
CN2010105953689A 2010-12-10 2010-12-10 Method and device for detecting database blockage Pending CN102541885A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN2010105953689A CN102541885A (en) 2010-12-10 2010-12-10 Method and device for detecting database blockage

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN2010105953689A CN102541885A (en) 2010-12-10 2010-12-10 Method and device for detecting database blockage

Publications (1)

Publication Number Publication Date
CN102541885A true CN102541885A (en) 2012-07-04

Family

ID=46348805

Family Applications (1)

Application Number Title Priority Date Filing Date
CN2010105953689A Pending CN102541885A (en) 2010-12-10 2010-12-10 Method and device for detecting database blockage

Country Status (1)

Country Link
CN (1) CN102541885A (en)

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103678020A (en) * 2012-09-18 2014-03-26 中国银联股份有限公司 Timeout processing method and timeout processing device for database operation during transaction processing
CN104216943A (en) * 2014-06-24 2014-12-17 用友优普信息技术有限公司 Method and device for automatically collecting blockage information to facilitate post analysis on database blockage
CN105183608A (en) * 2015-08-14 2015-12-23 广东能龙教育股份有限公司 Monitoring and early warning method for multiple databases
CN105955865A (en) * 2016-04-29 2016-09-21 浪潮(北京)电子信息产业有限公司 Monitoring method and system aiming at K-DB database
CN108259259A (en) * 2016-12-29 2018-07-06 北京国双科技有限公司 Cluster stability diagnostic method and device
CN109308239A (en) * 2018-09-26 2019-02-05 北京百度网讯科技有限公司 Method and apparatus for output information
WO2021082484A1 (en) * 2019-11-01 2021-05-06 平安科技(深圳)有限公司 Awr report automatic acquisition method and apparatus, electronic device, and storage medium
CN112988435A (en) * 2019-12-16 2021-06-18 中国电信股份有限公司 Database overload protection processing method and device and storage medium
CN113641736A (en) * 2021-10-13 2021-11-12 云和恩墨(北京)信息技术有限公司 Method and device for displaying session blocking source

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020184363A1 (en) * 2001-04-20 2002-12-05 Steven Viavant Techniques for server-controlled measurement of client-side performance
CN1997983A (en) * 2004-05-21 2007-07-11 Bea系统公司 Service oriented architecture
CN101446914A (en) * 2007-11-26 2009-06-03 阿里巴巴集团控股有限公司 Database monitoring method and device
CN101876924A (en) * 2009-04-30 2010-11-03 升东网络科技发展(上海)有限公司 Database fault automatic detection and transfer method

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020184363A1 (en) * 2001-04-20 2002-12-05 Steven Viavant Techniques for server-controlled measurement of client-side performance
CN1997983A (en) * 2004-05-21 2007-07-11 Bea系统公司 Service oriented architecture
CN101446914A (en) * 2007-11-26 2009-06-03 阿里巴巴集团控股有限公司 Database monitoring method and device
CN101876924A (en) * 2009-04-30 2010-11-03 升东网络科技发展(上海)有限公司 Database fault automatic detection and transfer method

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103678020A (en) * 2012-09-18 2014-03-26 中国银联股份有限公司 Timeout processing method and timeout processing device for database operation during transaction processing
CN104216943A (en) * 2014-06-24 2014-12-17 用友优普信息技术有限公司 Method and device for automatically collecting blockage information to facilitate post analysis on database blockage
CN105183608A (en) * 2015-08-14 2015-12-23 广东能龙教育股份有限公司 Monitoring and early warning method for multiple databases
CN105955865A (en) * 2016-04-29 2016-09-21 浪潮(北京)电子信息产业有限公司 Monitoring method and system aiming at K-DB database
CN108259259A (en) * 2016-12-29 2018-07-06 北京国双科技有限公司 Cluster stability diagnostic method and device
CN109308239A (en) * 2018-09-26 2019-02-05 北京百度网讯科技有限公司 Method and apparatus for output information
WO2021082484A1 (en) * 2019-11-01 2021-05-06 平安科技(深圳)有限公司 Awr report automatic acquisition method and apparatus, electronic device, and storage medium
CN112988435A (en) * 2019-12-16 2021-06-18 中国电信股份有限公司 Database overload protection processing method and device and storage medium
CN113641736A (en) * 2021-10-13 2021-11-12 云和恩墨(北京)信息技术有限公司 Method and device for displaying session blocking source
CN113641736B (en) * 2021-10-13 2022-01-25 云和恩墨(北京)信息技术有限公司 Method and device for displaying session blocking source

Similar Documents

Publication Publication Date Title
CN102541885A (en) Method and device for detecting database blockage
CN101964997B (en) Method and device for carrying out early warning on network performance
EP2741211B1 (en) Method and device for monitoring power consumption of android terminal application
CN102724059B (en) Website operation state monitoring and abnormal detection based on MapReduce
CN101620562B (en) Method and system for estimating property of embedded type system
CN100589418C (en) The generation method and the generation system of alarm correlation rule
CN104966172A (en) Large data visualization analysis and processing system for enterprise operation data analysis
CN103729361A (en) Method and device for testing performance of database
CN103186603B (en) Determine that SQL statement is on the method for the impact of the performance of key business, system and equipment
KR100982034B1 (en) Monitoring method and system for database performance
CN101989283A (en) Monitoring method and device of performance of database
CN103902442A (en) Method and system for evaluating cloud software health degree
CN103150250B (en) Application program capacity detection system and application program capacity detection method
CN104714984A (en) Database optimization method and device
CN109462490B (en) Video monitoring system and fault analysis method
CN102541884B (en) Method and device for database optimization
CN104574219A (en) System and method for monitoring and early warning of operation conditions of power grid service information system
CN111259073A (en) Intelligent business system running state studying and judging system based on logs, flow and business access
CN112884452A (en) Intelligent operation and maintenance multi-source data acquisition visualization analysis system
CN102801548B (en) A kind of method of intelligent early-warning, device and information system
CN102761429B (en) A kind of abnormal call bill processing method and system
CN111460027A (en) Intelligent dynamic monitoring method and system suitable for energy Internet
CN114664494B (en) Distributed temperature measurement intelligent cable
CN115840656A (en) Automatic operation and maintenance method and system for application program based on fault self-healing
KR102418892B1 (en) Method of saving energy based on confidence interval and apparatus using the same

Legal Events

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

Application publication date: 20120704