CN109508285B - Method for quickly positioning fault code through Oracle database and Weblogic middleware - Google Patents

Method for quickly positioning fault code through Oracle database and Weblogic middleware Download PDF

Info

Publication number
CN109508285B
CN109508285B CN201810857648.9A CN201810857648A CN109508285B CN 109508285 B CN109508285 B CN 109508285B CN 201810857648 A CN201810857648 A CN 201810857648A CN 109508285 B CN109508285 B CN 109508285B
Authority
CN
China
Prior art keywords
thread number
weblogic
oracle database
code
database
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
CN201810857648.9A
Other languages
Chinese (zh)
Other versions
CN109508285A (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.)
Shanghai New Torch Network Information Technology Ltd By Share Ltd
Original Assignee
Shanghai New Torch Network Information Technology Ltd By Share 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 Shanghai New Torch Network Information Technology Ltd By Share Ltd filed Critical Shanghai New Torch Network Information Technology Ltd By Share Ltd
Priority to CN201810857648.9A priority Critical patent/CN109508285B/en
Publication of CN109508285A publication Critical patent/CN109508285A/en
Application granted granted Critical
Publication of CN109508285B publication Critical patent/CN109508285B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/362Software debugging
    • G06F11/3644Software debugging by instrumenting at runtime
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/362Software debugging
    • G06F11/3636Software debugging by tracing the execution of the program

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Debugging And Monitoring (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses a method for quickly positioning fault codes through an Oracle database and Weblogic middleware, which comprises the following steps of S1: operating the Weblogic middleware, and capturing a thread number; s2: monitoring the Weblogic middleware in real time, and associating the captured thread number with the code of the corresponding Weblogic middleware; s3: calling a Java database connection module, and receiving a thread number and a corresponding node name; s4: the Java database connection module is connected with the Oracle database and sends the thread number and the corresponding node name to the Oracle database; s5: and monitoring the Oracle database session in real time, associating the session with the node name and the thread number, and determining the code causing the failure SQL according to the association relationship between the thread number and the code of the Weblogic middleware. The invention can quickly find the codes generating the faults.

Description

Method for quickly positioning fault code through Oracle database and Weblogic middleware
Technical Field
The invention relates to a code positioning method, in particular to a method for quickly positioning fault codes through an Oracle database and Weblogic middleware.
Background
And the application programs running on multiple nodes of the Weblogic middleware are connected to the Oracle database through the Java database connection module. Usually, a query is performed, Weblogic first establishes a thread, then the thread calls a Java database connection module to connect a database, and a database query returns, which is a complete link. Currently, Weblogic can send a node name to a session table v $ session of a database by using system parameter setting, and the database can inquire a connection created by a corresponding ServerName through the v $ session. When the database is subjected to TX lock waiting or high-consumption SQL (similar to the failure of SQL execution of the database), how to quickly locate what application code is currently generally the following method is adopted:
1. and submitting the query SQL statement to a developer for confirmation, and finding a corresponding program module for analysis.
2. When SQL failure occurs, such as TX lock wait or deadlock, if the data personnel locates the TX lock source, the session can only be ended for release.
3. After TX lock waiting or deadlock or failure SQL occurs, backing up a Weblogic Java virtual machine thread by a file system, and analyzing the running condition of the thread.
The current mode has the following disadvantages:
1. the database administrator cannot locate the application code to the Weblogic middleware at the Oracle database level.
2. The problem that the database session is not directly linked with the Weblogic middleware application layer thread cannot be solved.
3. The method is characterized in that the threads are analyzed under the conditions of no correlation and weak database personnel service knowledge (Weblogic has the automatic optimization of the number of the threads and also has the maximum threshold value which is hundreds of thousands of threads and is set according to the system requirement), and the specific codes are relatively difficult to position.
4. And the timeliness guarantees that if TX lock waiting or deadlock occurs, the source is generally directly ended in order that the system can run continuously in time, and SQL is submitted to developers rather than being analyzed. If the source is analyzed, the long TX lock wait or deadlock creates a risk to the system.
Disclosure of Invention
The invention aims to solve the technical problem of providing a method for quickly positioning fault codes through an Oracle database and a Weblogic middleware, and solving the problem of complicated operation of accurately providing positioning codes by the Oracle database.
The technical scheme adopted by the invention for solving the technical problems is to provide a method for quickly positioning fault codes through an Oracle database and a Weblogic middleware, which comprises the following steps: s1: respectively operating a Java virtual machine and Weblogic middleware on each Weblogic node, and capturing thread numbers of all start threads on each Weblogic node; s2: monitoring the thread operated by the Java virtual machine on each Weblogic node in real time, and associating the captured thread number with the code of the corresponding Weblogic middleware; s3: calling a Java database connection module, wherein the Java database connection module receives the thread number and the corresponding node name sent by each Weblogic node; s4: the Java database connection module is connected with the Oracle database and sends the thread number and the corresponding node name received in the step S3 to the Oracle database; s5: monitoring the Oracle database session in real time, associating the session with the node name and the thread number, acquiring the node name and the thread number of the failed SQL session when the failed SQL is monitored, and determining the code causing the failed SQL on the corresponding node according to the association relationship between the thread number and the code of the Weblogic middleware.
Further, the step S1 further includes: and modifying the starting code of the Weblogic middleware to enable the Weblogic middleware to generate a thread number when responding to the operation of the application program, and then grabbing the thread number.
Further, in step S4, a connection including a thread number and a node name is created in the Java database connection module, the Oracle database session table obtains the thread number and the corresponding node name from the connection, and stores the thread number and the corresponding node name in the session table.
Further, the step S2 further includes: and acquiring a thread number and a corresponding code by acquiring the Weblogic node Java virtual machine through a backup file system.
Further, the step S5 further includes: and searching the thread number and the corresponding node name in the Oracle database session table, acquiring the node name and the thread number of the fault SQL session, and comparing the thread number of the fault SQL session with the thread number in the step S2 to determine the code of the fault SQL.
Compared with the prior art, the invention has the following beneficial effects: the method for quickly positioning the fault codes through the Oracle database and the Weblogic middleware, provided by the invention, is used for reversely positioning the codes, quickly finding the codes generating faults through the fault SQL according to the session table of the Oracle database, and then finishing the removal of the fault SQL, so that the codes can be reserved, and the timeliness of the database can be ensured; the relevance of the Oracle database and the Weblogic middleware is improved; the time for analyzing the Weblogic Java virtual machine to generate fault codes is saved.
Drawings
FIG. 1 is a flowchart of a method for fast locating a fault code through an Oracle database and Weblogic middleware according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of system connections and signal flow for fast locating fault codes through an Oracle database and Weblogic middleware according to an embodiment of the present invention;
fig. 3 is a data link forward flow diagram of a method for rapidly locating a fault code through an Oracle database and Weblogic middleware according to an embodiment of the present invention.
Detailed Description
The invention is further described below with reference to the figures and examples.
FIG. 1 is a flowchart of a method for quickly locating a fault code through an Oracle database and Weblogic middleware according to an embodiment of the present invention.
Referring to fig. 1, the method for quickly locating a fault code through an Oracle database and Weblogic middleware in the embodiment of the present invention includes the following steps:
s1: respectively operating a Java virtual machine and Weblogic middleware on each Weblogic node, and capturing thread numbers of all start threads on each Weblogic node;
s2: monitoring the thread operated by the Java virtual machine on each Weblogic node in real time, and associating the captured thread number with the code of the corresponding Weblogic middleware;
s3: calling a Java database connection module, wherein the Java database connection module receives the thread number and the corresponding node name sent by each Weblogic node;
s4: the Java database connection module is connected with the Oracle database and sends the thread number and the corresponding node name received in the step S3 to the Oracle database;
s5: monitoring the Oracle database session in real time, associating the session with the node name and the thread number, acquiring the node name and the thread number of the failed SQL session when the failed SQL is monitored, and determining the code causing the failed SQL on the corresponding node according to the association relationship between the thread number and the code of the Weblogic middleware.
Preferably, step S1 further includes: and modifying the starting code of the Weblogic middleware to enable the Weblogic middleware to generate a thread number when responding to the operation of the application program, and then grabbing the thread number. .
Specifically, in step S4, a connection including a thread number and a node name is created in the Java database connection module, the Oracle database session table obtains the thread number and the corresponding node name from the connection, and stores the thread number and the corresponding node name in the session table.
In the method for quickly locating the fault code through the Oracle database and the Weblogic middleware in the embodiment of the present invention, step S2 further includes: and acquiring a thread number and a corresponding code by acquiring the Weblogic node Java virtual machine through a backup file system. Step S5 further includes: and searching the thread number and the corresponding node name in the Oracle database session table, acquiring the node name and the thread number of the fault SQL session, and comparing the thread number of the fault SQL session with the thread number in the step S2 to determine the code of the fault SQL.
Fig. 2 is a schematic diagram of system connection and signal flow for fast locating fault codes through an Oracle database and Weblogic middleware according to an embodiment of the present invention.
Referring to fig. 2, a Java virtual machine and a Weblogic middleware are respectively run on a Weblogic node, and thread numbers of all start threads are captured on the Weblogic node; simultaneously monitoring the running condition of each Weblogic node Java virtual machine thread in real time, and monitoring the thread number and the corresponding code; the Weblogic node sends the thread number and the corresponding node name to a Java database connection module in real time, then the Java database connection module is connected with an Oracle database, the thread number and the corresponding node name are sent to the Oracle database, and when the failure SQL is monitored, the node name and the thread number in the failure SQL session are obtained; and comparing the label of the fault SQL thread, so as to locate the thread code.
Fig. 3 is a data link forward flow diagram of a method for rapidly locating a fault code through an Oracle database and Weblogic middleware according to an embodiment of the present invention.
Referring to fig. 3, it can be seen that the data link flows are different when SQL is executed normally and abnormally, when SQL is executed abnormally, the code causing the fault is located, and when SQL is executed normally, the data source of the Jave database connection module is released, the Weblogic thread is released, and the operation is completed.
In summary, the method for quickly locating the fault code through the Oracle database and the Weblogic middleware provided by the invention performs reverse code location, quickly finds the code generating the fault through the fault SQL through the session table of the Oracle database, and then finishes dropping the fault SQL, so that the code can be retained, and the timeliness of the database can be ensured; the relevance of the Oracle database and the Weblogic middleware is improved; the time for analyzing the Weblogic Java virtual machine to generate fault codes is saved.
Although the present invention has been described with respect to the preferred embodiments, it will be understood by those skilled in the art that various changes in form and details may be made therein without departing from the spirit and scope of the invention as defined by the appended claims.

Claims (3)

1. A method for rapidly positioning fault codes through an Oracle database and Weblogic middleware is characterized by comprising the following steps:
s1: respectively operating a Java virtual machine and Weblogic middleware on each Weblogic node, and capturing thread numbers of all start threads on each Weblogic node;
s2: monitoring the thread operated by the Java virtual machine on each Weblogic node in real time, and associating the captured thread number with the code of the corresponding Weblogic middleware;
s3: calling a Java database connection module, wherein the Java database connection module receives the thread number and the corresponding node name sent by each Weblogic node;
s4: the Java database connection module is connected with the Oracle database and sends the thread number and the corresponding node name received in the step S3 to the Oracle database;
s5: monitoring an Oracle database session in real time, associating the session with a node name and a thread number, acquiring the node name and the thread number of the failed SQL session when the failed SQL is monitored, and determining a code causing the failed SQL on a corresponding node according to the association relationship between the thread number and a code of a Weblogic middleware;
the step S2 further includes: acquiring a thread number and a corresponding code by a Weblogic node Java virtual machine through a backup file system;
the step S5 further includes: and searching the thread number and the corresponding node name in the Oracle database session table, acquiring the node name and the thread number of the fault SQL session, and then comparing the thread number of the fault SQL session with the thread number in the step S2 to determine the code of the fault SQL.
2. The method for fast fault code location through Oracle database and Weblogic middleware of claim 1, wherein said step S1 further comprises: and modifying the starting code of the Weblogic middleware to enable the Weblogic middleware to generate a thread number when responding to the operation of the application program, and then grabbing the thread number.
3. The method for fast locating fault codes throughout the Oracle database and Weblogic middleware of claim 1, wherein in step S4, a connection containing a thread number and a node name is created in the Java database connection module, the Oracle database session table obtains the thread number and the corresponding node name from the connection, and stores the thread number and the corresponding node name in the session table.
CN201810857648.9A 2018-07-31 2018-07-31 Method for quickly positioning fault code through Oracle database and Weblogic middleware Active CN109508285B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810857648.9A CN109508285B (en) 2018-07-31 2018-07-31 Method for quickly positioning fault code through Oracle database and Weblogic middleware

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810857648.9A CN109508285B (en) 2018-07-31 2018-07-31 Method for quickly positioning fault code through Oracle database and Weblogic middleware

Publications (2)

Publication Number Publication Date
CN109508285A CN109508285A (en) 2019-03-22
CN109508285B true CN109508285B (en) 2021-07-27

Family

ID=65745546

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810857648.9A Active CN109508285B (en) 2018-07-31 2018-07-31 Method for quickly positioning fault code through Oracle database and Weblogic middleware

Country Status (1)

Country Link
CN (1) CN109508285B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8881171B1 (en) * 2008-12-15 2014-11-04 Open Invention Network, Llc Method and computer readable medium for providing checkpointing to windows application groups
CN106201826A (en) * 2016-07-13 2016-12-07 焦点科技股份有限公司 A kind of diagnose the big affairs of oracle database and the method for focus affairs
CN106372135A (en) * 2016-08-26 2017-02-01 深圳市卓讯信息技术有限公司 Structured query language SQL execution efficiency tracking method and device

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8881171B1 (en) * 2008-12-15 2014-11-04 Open Invention Network, Llc Method and computer readable medium for providing checkpointing to windows application groups
CN106201826A (en) * 2016-07-13 2016-12-07 焦点科技股份有限公司 A kind of diagnose the big affairs of oracle database and the method for focus affairs
CN106372135A (en) * 2016-08-26 2017-02-01 深圳市卓讯信息技术有限公司 Structured query language SQL execution efficiency tracking method and device

Also Published As

Publication number Publication date
CN109508285A (en) 2019-03-22

Similar Documents

Publication Publication Date Title
CN106970880B (en) Distributed automatic software testing method and system
US7020797B2 (en) Automated software testing management system
CN110716842B (en) Cluster fault detection method and device
US20080155350A1 (en) Enabling tracing operations in clusters of servers
CN112506799B (en) Business abnormality positioning method and device, electronic equipment, medium and product
CN111181767A (en) Monitoring and fault self-healing system and method for complex system
US20170132063A1 (en) Information system fault scenario information collecting method and system
CN106991046B (en) Application testing method and device
CN111552556B (en) GPU cluster service management system and method
US20160132377A1 (en) Automated defect diagnosis from machine diagnostic data
CN110275992B (en) Emergency processing method, device, server and computer readable storage medium
CN111930589A (en) Streaming task automatic monitoring system and method
CN113986669A (en) Call chain tracking and business analysis method based on AOP annotation
CN107204868B (en) Task operation monitoring information acquisition method and device
CN106055703B (en) Log real-time analysis method and system
CN111694734A (en) Software interface checking method and device and computer equipment
US20210266238A1 (en) Operation device and operation method
CN110875853B (en) Automatic quality monitoring method and terminal based on metadata
CN108228417B (en) Internet of vehicles log processing method and device
CN109508285B (en) Method for quickly positioning fault code through Oracle database and Weblogic middleware
CN110569140A (en) operation and maintenance method and device
CN109525436B (en) Method and system for switching main application program and standby application program
CN111767164B (en) Method and system for positioning component to which crash stack belongs in assembled product
CN111930561A (en) Streaming task automatic monitoring alarm restarting system and method
CN111752741A (en) System performance detection method and device

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