CN108549691B - Database session tracking and analyzing method and device - Google Patents

Database session tracking and analyzing method and device Download PDF

Info

Publication number
CN108549691B
CN108549691B CN201810330655.3A CN201810330655A CN108549691B CN 108549691 B CN108549691 B CN 108549691B CN 201810330655 A CN201810330655 A CN 201810330655A CN 108549691 B CN108549691 B CN 108549691B
Authority
CN
China
Prior art keywords
function
session
fault
information
preset
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.)
Active
Application number
CN201810330655.3A
Other languages
Chinese (zh)
Other versions
CN108549691A (en
Inventor
魏本帅
杜彦魁
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhengzhou Yunhai Information Technology Co Ltd
Original Assignee
Zhengzhou Yunhai Information Technology 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 Zhengzhou Yunhai Information Technology Co Ltd filed Critical Zhengzhou Yunhai Information Technology Co Ltd
Priority to CN201810330655.3A priority Critical patent/CN108549691B/en
Publication of CN108549691A publication Critical patent/CN108549691A/en
Application granted granted Critical
Publication of CN108549691B publication Critical patent/CN108549691B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

The invention discloses a database session tracking and analyzing method, which comprises the steps of obtaining an identity code and a serial interface code of a fault session; calling a preset first function, tracking the fault conversation in real time according to the identity code by the first function, and returning the tracking and captured conversation information in real time through the serial interface code; calling a preset second function, analyzing and screening the session information returned by the first function by the second function to obtain useful information, and storing the useful information into a preset information base; after the fault conversation is finished, the first function stops running; and the second function stops running after the second function analyzes and screens all the session information received by the second function and the first function stops running. The invention can automatically track, analyze and screen the fault conversation, and has high working efficiency and accuracy and good continuity; the invention also discloses a device, equipment and a computer readable storage medium based on the method.

Description

Database session tracking and analyzing method and device
Technical Field
The invention relates to the technical field of database monitoring, in particular to a database session tracking and analyzing method. The invention also relates to a database session tracking and analyzing device, equipment and a computer readable storage medium.
Background
The database session refers to a process generated in a database after a user establishes connection with the database through a user process, and performance analysis and optimization of the database session are always hot topics.
At present, all relational databases can only track sessions, but there is no forming method or device for automatically analyzing database sessions, generally, after the tracking is finished, the tracked information is manually analyzed, screened and analyzed, the efficiency of performance analysis is low, artificial misjudgment may be generated, the accuracy is low, and the continuity of session tracking and analysis is poor.
Therefore, how to provide an efficient and consistent database session tracking and analyzing method, apparatus, device and computer-readable storage medium is a problem that needs to be solved by those skilled in the art.
Disclosure of Invention
The invention aims to provide a database session tracking and analyzing method, which can automatically track, analyze and screen fault sessions, and has high working efficiency and accuracy and good continuity; another object of the present invention is to provide an apparatus, a device and a computer readable storage medium based on the above method.
In order to solve the technical problem, the invention provides a database session tracking and analyzing method, which comprises the following steps:
acquiring an identity code and a serial interface code of a fault session;
calling a preset first function, wherein the first function tracks the fault conversation in real time according to the identity code and returns the conversation information tracked and captured in real time through the serial interface code;
calling a preset second function, and analyzing and screening the session information returned by the first function by the second function to obtain useful information and storing the useful information in a preset information base;
after the fault conversation is finished, the first function stops running; and the second function stops running after the second function analyzes and screens all the session information received by the second function and the first function stops running.
Preferably, the condition for calling the second function is specifically:
and receiving the session information returned by the first function, namely calling the second function.
Preferably, the condition for calling the second function is specifically:
and the first function stops running and calls the second function after receiving all session information returned by the first function.
Preferably, the method further comprises the following steps:
and after the second function stops working, calling a third function, determining a tuning scheme by the third function according to the useful information in the preset information base and a preset tuning rule, and adjusting the fault conversation according to the tuning scheme.
Preferably, before obtaining the identity code of the failed session and the serial interface code, the method further includes:
and detecting the state of each currently running session, comparing the detected state with a normal standard, analyzing a comparison result, if a fault session is found, acquiring the identity code and the serial interface code of the fault session, and inputting the identity code and the serial interface code of the fault session into a storage process in which the first function is positioned.
Preferably, the useful information includes SQL execution plans, wait events, and statistics.
In order to solve the above technical problem, the present invention further provides a database session tracking and analyzing apparatus, including:
the trigger module is used for acquiring the identity code and the serial interface code of the fault session; triggering a tracking module;
the tracking module is used for calling a preset first function, the first function tracks the fault conversation in real time according to the identity code, and returns the tracked and captured conversation information in real time through the serial interface code; after the fault conversation is finished, the first function stops running; triggering an analysis screening module;
the analysis screening module is used for calling a preset second function, and the second function analyzes and screens the session information returned by the first function to obtain useful information and stores the useful information into a preset information base; and the second function stops running after the second function analyzes and screens all the session information received by the second function and the first function stops running.
Preferably, the method further comprises the following steps:
and the tuning module is used for calling a third function after the second function stops working, determining a tuning scheme by the third function according to the useful information in the preset information base and a preset tuning rule, and tuning the fault conversation according to the tuning scheme.
In order to solve the above technical problem, the present invention further provides a database session tracking and analyzing device, including:
a memory for storing a computer program;
a processor for implementing the steps of the database session tracking and analysis method according to any one of the above when executing the computer program.
To solve the above technical problem, the present invention further provides a computer-readable storage medium, having a computer program stored thereon, where the computer program is executed by a processor to implement the steps of the database session tracking and analyzing method according to any one of the above items.
The invention provides a database session tracking and analyzing method, which comprises the steps of obtaining an identity code representing a fault session and a serial interface code used for transmitting session information of the fault session after the fault session is found, calling a first function to track the fault session to obtain the session information, and calling a second function to analyze and screen the session information to obtain useful information. Therefore, the invention can automatically track, analyze and screen the fault conversation, has high working efficiency, less misjudgment conditions and high accuracy; and the continuity of the sequence of the work of session tracking and screening analysis is good. The invention also provides a device, equipment and a computer readable storage medium based on the method.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed in the prior art and the embodiments will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings without creative efforts.
FIG. 1 is a flow chart of a process of a database session tracking and analysis method provided by the present invention;
fig. 2 is a schematic structural diagram of a database session tracking and analyzing device according to the present invention.
Detailed Description
The core of the invention is to provide a database session tracking and analyzing method, which can automatically track, analyze and screen fault sessions, and has high working efficiency and accuracy and good continuity; the other core of the invention is to provide a device, equipment and a computer readable storage medium based on the method.
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The invention provides a database session tracking and analyzing method, and referring to fig. 1, fig. 1 is a flow chart of a process of the database session tracking and analyzing method provided by the invention; the method comprises the following steps:
step s 1: acquiring an identity code SID and a SERIAL interface code SERIAL of a fault session;
step s 2: calling a preset first function, tracking the fault conversation in real time according to the identity code by the first function, and returning the tracking and captured conversation information in real time through the serial interface code;
step s 3: calling a preset second function, analyzing and screening the session information returned by the first function by the second function to obtain useful information, and storing the useful information into a preset information base;
after the fault conversation is finished, the first function stops running; and the second function stops running after the second function analyzes and screens all the session information received by the second function and the first function stops running.
It can be understood that the purpose of the first function and the second function is to track and screen the faulty session, and therefore, after the faulty session is over (i.e. the session is changed from active to inactive), the first function and the second function do not need to be run any more.
In a preferred embodiment, the condition for calling the second function is specifically:
and receiving the session information returned by the first function, namely calling the second function.
It can be understood that, in this embodiment, once the session information returned by the first function is received, the second function is called immediately for screening, so that the first function and the second function run simultaneously. By the method, the total time of session tracking and screening can be reduced to the greatest extent, and the working efficiency is improved.
In another preferred embodiment, the condition for calling the second function is specifically:
and the first function stops running and calls the second function after receiving all the session information returned by the first function.
It can be understood that, in this embodiment, the second function needs to wait for the first function to start running after running is finished, and in this way, the second function can perform unified screening analysis on the session information of the whole session, and compared with a way of receiving the session information and screening, the integrity of this embodiment is better, and the second function can set the condition of the whole screening.
Preferably, the method further comprises:
step s 4: and after the second function stops working, calling a third function, determining a tuning scheme by the third function according to the useful information in the preset information base and the preset tuning rule, and adjusting the fault conversation according to the tuning scheme.
It can be understood that the useful information in the preset information base can be manually analyzed by the staff to determine the tuning scheme, and the scheme in the above embodiment can also be adopted to implement the tuning scheme. For the embodiment, after the second function stops working, the third function is called to perform tuning, so that the session tracking, screening analysis and tuning can be performed sequentially, the continuity is improved, the process of manual tuning is reduced, the workload is further reduced, and the working efficiency is improved.
Preferably, obtaining the identity code of the failed session and the serial interface code further includes:
and detecting the state of each currently running session, comparing the detected state with a normal standard, analyzing a comparison result, if a fault session is found, acquiring the identity code and the serial interface code of the fault session, and inputting the identity code and the serial interface code into a storage process in which the first function is positioned.
It can be understood that, currently, the method for determining the fault session is generally manual, so that the fault session is easily missed, and by the method, even if a problematic session is found, and after the SID and the SERIAL are automatically acquired, session tracking and subsequent processes are triggered, so that the reliability is high, and the timeliness is good.
Specifically, useful information includes SQL execution plans, wait events, and statistics.
Of course, the useful information may also include other contents, and the contents included therein may be determined according to actual needs, and the present invention is not particularly limited.
It should be noted that the method of the present invention is performed based on a preset storage procedure (the storage procedure is a set of SQL statements for completing a specific function), where the storage procedure is provided with a first function, a second function, and a third function (for some embodiments, the third function may not be included), the storage procedure calls the first function after receiving the SID and the SERIAL, the storage procedure calls the second function after receiving the session information returned by the first function, and the storage procedure calls the third function after the second function stops working.
The invention provides a database session tracking and analyzing method, which comprises the steps of obtaining an identity code representing a fault session and a serial interface code used for transmitting session information of the fault session after the fault session is found, calling a first function to track the fault session to obtain the session information, and calling a second function to analyze and screen the session information to obtain useful information. Therefore, the invention can automatically track, analyze and screen the fault conversation, has high working efficiency, less misjudgment conditions and high accuracy; and the continuity of the sequence of the work of session tracking and screening analysis is good.
The invention also provides a database session tracking and analyzing device, as shown in fig. 2, fig. 2 is a schematic structural diagram of the database session tracking and analyzing device provided by the invention. The device includes:
the trigger module 1 is used for acquiring an identity code and a serial interface code of a fault session; triggering the tracking module 2;
the tracking module 2 is used for calling a preset first function, the first function tracks the fault conversation in real time according to the identity code, and returns the conversation information which is tracked and captured in real time through the serial interface code; after the fault conversation is finished, the first function stops running; triggering an analysis screening module 3;
the analysis screening module 3 is used for calling a preset second function, and the second function analyzes and screens the session information returned by the first function to obtain useful information and stores the useful information into a preset information base; and the second function stops running after the second function analyzes and screens all the session information received by the second function and the first function stops running.
Preferably, the apparatus further comprises:
and the tuning module 4 is used for calling a third function after the second function stops working, determining a tuning scheme by the third function according to the useful information in the preset information base and the preset tuning rule, and adjusting the fault conversation according to the tuning scheme.
The invention provides a database session tracking and analyzing device, which is characterized in that after a fault session is found, an identity code representing the fault session and a serial interface code used for transmitting session information of the fault session are obtained, then a first function is called to track the fault session to obtain the session information, and then a second function is called to analyze and screen the session information to obtain useful information. Therefore, the invention can automatically track, analyze and screen the fault conversation, has high working efficiency, less misjudgment conditions and high accuracy; and the continuity of the sequence of the work of session tracking and screening analysis is good.
The invention also provides a database session tracking and analyzing device, which comprises:
a memory for storing a computer program;
a processor for implementing the steps of the database session tracking and analysis method as any one of the above when executing the computer program.
The present invention also provides a computer readable storage medium having stored thereon a computer program which, when executed by a processor, performs the steps of the database session tracking and analysis method as in any one of the above.
The above embodiments are only preferred embodiments of the present invention, and the above embodiments can be combined arbitrarily, and the combined embodiments are also within the scope of the present invention. It should be noted that other modifications and variations that may suggest themselves to persons skilled in the art without departing from the spirit and scope of the invention are intended to be included within the scope of the invention as defined by the appended claims.
The embodiments in the present description are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other. The device disclosed by the embodiment corresponds to the method disclosed by the embodiment, so that the description is simple, and the relevant points can be referred to the method part for description.
It is further noted that, in the present specification, relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the invention. Thus, the present invention is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (8)

1. A database session tracking and analyzing method is characterized by comprising the following steps:
acquiring an identity code and a serial interface code of a fault session;
calling a preset first function, wherein the first function tracks the fault conversation in real time according to the identity code and returns the conversation information tracked and captured in real time through the serial interface code;
calling a preset second function, and analyzing and screening the session information returned by the first function by the second function to obtain useful information and storing the useful information in a preset information base;
after the fault conversation is finished, the first function stops running; the second function stops running after all session information received by the second function is analyzed and screened and the first function stops running;
further comprising:
and after the second function stops working, calling a third function, determining a tuning scheme by the third function according to the useful information in the preset information base and a preset tuning rule, and adjusting the fault conversation according to the tuning scheme.
2. The method according to claim 1, wherein the condition for invoking the second function is specifically:
and receiving the session information returned by the first function, namely calling the second function.
3. The method according to claim 1, wherein the condition for invoking the second function is specifically:
and the first function stops running and calls the second function after receiving all session information returned by the first function.
4. The method of claim 1, wherein obtaining the identity code and serial interface code of the failed session is preceded by:
and detecting the state of each currently running session, comparing the detected state with a normal standard, analyzing a comparison result, if a fault session is found, acquiring the identity code and the serial interface code of the fault session, and inputting the identity code and the serial interface code of the fault session into a storage process in which the first function is positioned.
5. The method of claim 4, wherein the useful information includes SQL execution plans, wait events, and statistics.
6. A database session tracking and analysis device, comprising:
the trigger module is used for acquiring the identity code and the serial interface code of the fault session; triggering a tracking module;
the tracking module is used for calling a preset first function, the first function tracks the fault conversation in real time according to the identity code, and returns the tracked and captured conversation information in real time through the serial interface code; after the fault conversation is finished, the first function stops running; triggering an analysis screening module;
the analysis screening module is used for calling a preset second function, and the second function analyzes and screens the session information returned by the first function to obtain useful information and stores the useful information into a preset information base; the second function stops running after all session information received by the second function is analyzed and screened and the first function stops running;
further comprising:
and the tuning module is used for calling a third function after the second function stops working, determining a tuning scheme by the third function according to the useful information in the preset information base and a preset tuning rule, and tuning the fault conversation according to the tuning scheme.
7. A database session tracking and analysis device, comprising:
a memory for storing a computer program;
a processor for implementing the steps of the database session tracking and analysis method according to any one of claims 1 to 5 when executing the computer program.
8. A computer-readable storage medium, having stored thereon a computer program which, when executed by a processor, carries out the steps of the database session tracking and analysis method according to any one of claims 1 to 5.
CN201810330655.3A 2018-04-13 2018-04-13 Database session tracking and analyzing method and device Active CN108549691B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810330655.3A CN108549691B (en) 2018-04-13 2018-04-13 Database session tracking and analyzing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810330655.3A CN108549691B (en) 2018-04-13 2018-04-13 Database session tracking and analyzing method and device

Publications (2)

Publication Number Publication Date
CN108549691A CN108549691A (en) 2018-09-18
CN108549691B true CN108549691B (en) 2021-09-17

Family

ID=63515090

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810330655.3A Active CN108549691B (en) 2018-04-13 2018-04-13 Database session tracking and analyzing method and device

Country Status (1)

Country Link
CN (1) CN108549691B (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101989283A (en) * 2009-08-04 2011-03-23 中兴通讯股份有限公司 Monitoring method and device of performance of database
CN101997925A (en) * 2010-11-22 2011-03-30 北京亮点时间科技有限公司 Server monitoring method with early warning function and system thereof
US7953756B1 (en) * 2002-08-09 2011-05-31 Cisco Technology, Inc. Unified high-performance database connectivity system and method
CN104360939A (en) * 2014-10-29 2015-02-18 中国建设银行股份有限公司 Method, equipment and system for positioning fault
CN105446855A (en) * 2015-11-10 2016-03-30 广州西麦科技股份有限公司 APA application tracking and analyzing system
CN107895011A (en) * 2017-11-03 2018-04-10 携程旅游网络技术(上海)有限公司 Processing method, system, storage medium and the electronic equipment of session information

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6223215B1 (en) * 1998-09-22 2001-04-24 Sony Corporation Tracking a user's purchases on the internet by associating the user with an inbound source and a session identifier
US20080098359A1 (en) * 2006-09-29 2008-04-24 Ventsislav Ivanov Manipulation of trace sessions based on address parameters
CN106126403B (en) * 2016-06-16 2018-10-12 北京中亦安图科技股份有限公司 Oracle database failure analysis methods and device

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7953756B1 (en) * 2002-08-09 2011-05-31 Cisco Technology, Inc. Unified high-performance database connectivity system and method
CN101989283A (en) * 2009-08-04 2011-03-23 中兴通讯股份有限公司 Monitoring method and device of performance of database
CN101997925A (en) * 2010-11-22 2011-03-30 北京亮点时间科技有限公司 Server monitoring method with early warning function and system thereof
CN104360939A (en) * 2014-10-29 2015-02-18 中国建设银行股份有限公司 Method, equipment and system for positioning fault
CN105446855A (en) * 2015-11-10 2016-03-30 广州西麦科技股份有限公司 APA application tracking and analyzing system
CN107895011A (en) * 2017-11-03 2018-04-10 携程旅游网络技术(上海)有限公司 Processing method, system, storage medium and the electronic equipment of session information

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
面向企业级数据库的故障分析及运维研究:以Oracle数据库为例;金鑫;《软件》;20171231;第38卷(第10期);第178-181页 *

Also Published As

Publication number Publication date
CN108549691A (en) 2018-09-18

Similar Documents

Publication Publication Date Title
CN107341098B (en) Software performance testing method, platform, equipment and storage medium
CN107038107B (en) Method and device for acquiring application blocking information
CN111177165B (en) Method, device and equipment for detecting data consistency
US20040078691A1 (en) Transaction tracer
KR101797185B1 (en) Efficiently collecting transaction-separated metrics in a distributed environment
CN109633351B (en) Intelligent IT operation and maintenance fault positioning method, device, equipment and readable storage medium
CN110096437A (en) The test method and Related product of micro services framework
CN109885496B (en) Test log management method and system
US9372776B2 (en) Monitoring user activity and performance of computerized devices
US7913233B2 (en) Performance analyzer
CN107861876A (en) Method of testing, device, computer equipment and readable storage medium storing program for executing
US20100031252A1 (en) Method And System For Monitoring The Performance Of An Application And At Least One Storage Device For Storing Code Which Performs The Method
WO2021008029A1 (en) Case execution method, apparatus and device, and computer readable storage medium
CN103248511B (en) A kind of analysis methods, devices and systems of single-point service feature
CN111970151A (en) Flow fault positioning method and system for virtual and container network
CN106055703B (en) Log real-time analysis method and system
CN108039956A (en) Using monitoring method, system and computer-readable recording medium
CN104182348A (en) Software test method and device
CN111124791A (en) System testing method and device
CN114661551A (en) Method and device for monitoring software running state and computer readable storage medium
CN108549691B (en) Database session tracking and analyzing method and device
CN111026637B (en) Method and device for positioning problem code
CN109542850B (en) Method, device, equipment and medium for updating WORM attribute of file
CN111240981A (en) Interface testing method, system and platform
CN110311806A (en) A kind of mobile applications interface operating lag diagnostic method, system and terminal

Legal Events

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