Search

CN-121979715-A - Database fault analysis method and device, electronic equipment, storage medium and product

CN121979715ACN 121979715 ACN121979715 ACN 121979715ACN-121979715-A

Abstract

The application relates to a database fault analysis method, a database fault analysis device, electronic equipment, a storage medium and a product. The method comprises the steps of determining core associated information in a current fault scene through a dynamic view, wherein the core associated information comprises identification information of a blocked session, a blocked time window and auxiliary information of the blocked session, obtaining a log file of a database covering the blocked time window, extracting a transaction record of a target session from the log file according to the identification information, extracting link information of the target transaction according to the transaction record, wherein the link information comprises at least one of a blocked structured query language statement, a transaction state of the target transaction and resource competition information, and cross-checking the link information and the auxiliary information to obtain a fault analysis result. Therefore, the efficiency, the accuracy and the traceability of blocking fault investigation are improved, the quick locking of the fault source is ensured, and reliable support is provided for the stable operation of the database in the key business scene.

Inventors

  • QIU FENG
  • LONG JIAJUN
  • LIANG RENYOU

Assignees

  • 赛姆科技(广东)有限公司

Dates

Publication Date
20260505
Application Date
20260327

Claims (10)

  1. 1. A database fault analysis method, the method comprising: Determining core associated information in a current fault scene through a dynamic view, wherein the core associated information comprises identification information of a blocked session, a blocked time window and auxiliary information of the blocked session; acquiring a log file of the database covering the blocking time window; Extracting a transaction record of the target session from the log file according to the identification information; extracting link information of a target transaction according to the transaction record, wherein the link information comprises at least one of a blocking structured query language statement, a transaction state of the target transaction and resource competition information; and cross-checking the link information and the auxiliary information to obtain a fault analysis result.
  2. 2. The method of claim 1, wherein the dynamic view comprises a first view and a second view, wherein the determining core association information in the current fault scenario from the dynamic view comprises: Performing session filtering through the blocking exclusive field in the first view to obtain a session record related to blocking; Extracting session identification, session serial number and transaction information from the session record; and determining the blocking time window and the auxiliary information from the session record by combining the session identifier through the second view.
  3. 3. The method of claim 1, wherein the extracting the transaction record of the target session from the log file according to the identification information comprises: Directionally extracting the transaction record of the target session by using the identification information as a filtering condition through a LogMiner tool; The extracting the link information of the target transaction according to the transaction record comprises the following steps: Positioning a blocking statement actually executed by a user according to the transaction record, and determining a transaction state corresponding to the blocking statement by combining with a system revision number sequence; And determining the resource competition information based on the object information related to the blocking statement.
  4. 4. A method according to claim 3, wherein before said cross-checking said link information with said auxiliary information to obtain a failure analysis result, said method further comprises: determining a blocking duration quantization score according to the blocking time window when a plurality of target sessions exist; Determining a resource occupancy rate quantization score according to the occupancy strength of the target session on the core resource; Determining an influence range quantization score according to the influence degree of the target session on other sessions; determining a comprehensive evaluation score according to the blocking duration quantization score, the resource occupancy quantization score and/or the influence range quantization score; And screening out the key blocking session from the target session according to the comprehensive evaluation score.
  5. 5. The method of claim 4, wherein cross-checking the link information with the auxiliary information to obtain a failure analysis result comprises: And matching the link information corresponding to the key blocked session with the auxiliary information of the blocked session to obtain the fault analysis result.
  6. 6. The method according to any one of claims 1 or 5, wherein cross-checking the link information with the auxiliary information to obtain a failure analysis result includes: extracting a first resource object identifier related to a blocking statement from the link information; Extracting a second resource object identifier related to the blocked session from the auxiliary information; And determining the fault analysis result based on the first resource object identifier, the second resource object identifier and the matching condition of the blocking statement and the lock type of the blocked session.
  7. 7. A database fault analysis apparatus, the apparatus comprising: The system comprises a determining module, a judging module and a judging module, wherein the determining module is used for determining core associated information in a current fault scene through a dynamic view, and the core associated information comprises identification information of a blocked session, a blocked time window and auxiliary information of the blocked session; the acquisition module is used for acquiring a log file of the database covering the blocking time window; the first extraction module is used for extracting the transaction record of the target session from the log file according to the identification information; The second extraction module is used for extracting link information of the target transaction according to the transaction record, wherein the link information comprises at least one of a blocking structured query language statement, a transaction state of the target transaction and resource competition information; and the analysis module is used for cross-checking the link information and the auxiliary information to obtain a fault analysis result.
  8. 8. An electronic device comprising a processor and a memory, wherein the memory is configured to store a computer program, and wherein the processor is configured to implement the method of any of claims 1 to 6 when the computer program is executed.
  9. 9. A computer readable storage medium having stored thereon a computer program, which when executed by a processor realizes the steps performed by the method of any of claims 1 to 6.
  10. 10. A computer program product comprising a computer program, characterized in that the computer program, when being executed by a processor, realizes the steps performed by the method according to any one of claims 1 to 6.

Description

Database fault analysis method and device, electronic equipment, storage medium and product Technical Field The present application relates to the field of data processing technologies, and in particular, to a database fault analysis method, a database fault analysis device, an electronic device, a storage medium, and a product. Background In the field of operation and maintenance management of Oracle (Oracle) databases, blocking faults are one of core pain points affecting service continuity and system stability, and particularly in scenes with severe requirements on database availability such as financial transactions, e-commerce payments and the like, the faults easily cause serious consequences such as service jamming, transaction overtime and the like, so that an efficient and accurate fault checking technology is very important. In the prior art, the Oracle database is operated and maintained by taking real-time capture priority and history trace-back dependence prior configuration or sampling as core logic, and the technical scheme is around Oracle native tools, so that on one hand, specific operation sentences and transaction states of a blocking source are difficult to directly locate, on the other hand, key transaction records are easy to lose, the overall log analysis efficiency is low, and the information redundancy is high. Disclosure of Invention In view of the foregoing, it is desirable to provide a database fault analysis method, apparatus, electronic device, storage medium, and product. In a first aspect, the present application provides a database fault analysis method, the method comprising: Determining core associated information in a current fault scene through a dynamic view, wherein the core associated information comprises identification information of a blocked session, a blocked time window and auxiliary information of the blocked session; acquiring a log file of the database covering the blocking time window; Extracting a transaction record of the target session from the log file according to the identification information; extracting link information of a target transaction according to the transaction record, wherein the link information comprises at least one of a blocking structured query language statement, a transaction state of the target transaction and resource competition information; and cross-checking the link information and the auxiliary information to obtain a fault analysis result. In one embodiment, the dynamic view comprises a first view and a second view, and the determining the core association information in the current fault scene through the dynamic view comprises the following steps: Performing session filtering through the blocking exclusive field in the first view to obtain a session record related to blocking; Extracting session identification, session serial number and transaction information from the session record; and determining the blocking time window and the auxiliary information from the session record by combining the session identifier through the second view. In one embodiment, the extracting, according to the identification information, the transaction record of the target session from the log file includes: Directionally extracting the transaction record of the target session by using the identification information as a filtering condition through a LogMiner tool; The extracting the link information of the target transaction according to the transaction record comprises the following steps: Positioning a blocking statement actually executed by a user according to the transaction record, and determining a transaction state corresponding to the blocking statement by combining with a system revision number sequence; And determining the resource competition information based on the object information related to the blocking statement. In one embodiment, before the cross-checking the link information with the auxiliary information to obtain the fault analysis result, the method further includes: determining a blocking duration quantization score according to the blocking time window when a plurality of target sessions exist; Determining a resource occupancy rate quantization score according to the occupancy strength of the target session on the core resource; Determining an influence range quantization score according to the influence degree of the target session on other sessions; determining a comprehensive evaluation score according to the blocking duration quantization score, the resource occupancy quantization score and/or the influence range quantization score; And screening out the key blocking session from the target session according to the comprehensive evaluation score. In one embodiment, the cross-checking the link information with the auxiliary information to obtain a fault analysis result includes: And matching the link information corresponding to the key blocked session with the auxiliary information of the blocked session to obt