Method and device for realizing monitoring on SQL (structured query language) database

A database and configuration file technology, applied in the computer field, can solve problems such as low execution efficiency and unsuitability for monitoring, and achieve the effects of reducing impact, facilitating maintenance of business programs, and improving execution efficiency

Active Publication Date: 2011-06-29
STATE GRID CORP OF CHINA +1
View PDF3 Cites 13 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

Since the proxy class needs to use reflection to call the original execution method, the execution effic

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Method and device for realizing monitoring on SQL (structured query language) database
  • Method and device for realizing monitoring on SQL (structured query language) database
  • Method and device for realizing monitoring on SQL (structured query language) database

Examples

Experimental program
Comparison scheme
Effect test

Embodiment 1

[0026] see figure 2 , which is a flowchart of an embodiment of a method for implementing SQL database monitoring in the present application, the method includes the following steps:

[0027] Step 201: When the virtual machine loads the driver class for obtaining database operations, replace the method name of the original method in the driver class;

[0028] For example, in a business application system using the Spring framework, when the virtual machine loads the driver class DriverManagerDataSource that performs database operations, all methods for obtaining connections are modified by bytecode injection, such as changing the method name getConnectionFromDriverManager to getConnectionFromDriverManager_$Monitor .

[0029] Step 202: Regenerate a method with the same name as the original method in the driver class, and call the original method in the driver class with the method name replaced in the regenerated method;

[0030] Still taking getConnectionFromDriver-Manager i...

Embodiment 2

[0040]This embodiment also provides a method for realizing SQL database monitoring. The difference between this embodiment and Embodiment 1 is: before the virtual machine loads and obtains the driver class for database connection, the monitoring configuration file is read, because the monitoring configuration file indicates Therefore, according to the instructions of the monitoring configuration file, the virtual machine modifies the driver class to the agent driver class only when monitoring needs to be performed. see image 3 , which is a flow chart of another embodiment of a method for implementing SQL database monitoring in the present application, the method includes the following steps:

[0041] Step 301: the virtual machine reads the monitoring configuration file;

[0042] Step 302: When the monitoring configuration file indicates to perform monitoring, when the virtual machine loads the driver class for obtaining the database connection, replace the method name of the...

Embodiment 3

[0052] This embodiment provides a method for completing SQL monitoring by proxying the driver class of the database. see Figure 4 , which is a flow chart of another embodiment of a method for implementing SQL database monitoring in the present application, the method includes the following steps:

[0053] Step 401: Obtain the proxy connection class through the modified database driver class;

[0054] Step 402: The proxy connection class records monitoring information while completing the original connection function, and the execution object obtained through the proxy connection class is a proxy Statement object (eg, ProxyStatement);

[0055] Step 403: the proxy execution object ProxyStatement records monitoring information while executing SQL;

[0056] Step 404: The proxy result set object ProxyResultSet records the result set information.

[0057] It can be seen from the above embodiments that, unlike the prior art, the embodiment of the present application modifies the ...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

PUM

No PUM Login to view more

Abstract

The embodiment of the invention discloses a method and device for realizing monitoring on an SQL (structured query language) database. The method comprises the following steps of: when a virtual machine loads a database driver used for acquiring database links, changing the name of the original method in the driver; regenerating a method with the same name of the original method in the driver andcalling the original method the name of which is changed in the driver in the regenerated method; and modifying the return value of the method, and modifying the acquired database link into a proxy server to complete monitoring on access to a database by a service system. By applying the embodiment of the invention, database operation can be monitored in an operating period, the execution efficiency is increased by adopting a bytecode injection mode, and the driver of service application is not required to be modified.

Description

technical field [0001] The present application relates to the field of computer technology, in particular to a method and device for realizing SQL database monitoring. Background technique [0002] With the development of society and the progress of science and technology, the information construction of various industries is in full swing. The projects developed by integrating various technologies are mixed. How to monitor the performance of various systems, especially the monitoring of the execution of SQL (Structured Query Language, structured query language) database, further discover system bottlenecks and improve System performance and stability have become urgent technical issues to be solved. [0003] At present, the ways to implement SQL database monitoring can be divided into the following types: The first is to monitor the execution of SQL database from the database level. For example, Oracle10g database itself provides some monitoring functions. However, the fi...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

Application Information

Patent Timeline
no application Login to view more
IPC IPC(8): G06F17/30
Inventor 杨宁王能张晶李莹张敏杰
Owner STATE GRID CORP OF CHINA
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Try Eureka
PatSnap group products