CN111367705A - SQL error reporting processing method and device - Google Patents

SQL error reporting processing method and device Download PDF

Info

Publication number
CN111367705A
CN111367705A CN202010242096.8A CN202010242096A CN111367705A CN 111367705 A CN111367705 A CN 111367705A CN 202010242096 A CN202010242096 A CN 202010242096A CN 111367705 A CN111367705 A CN 111367705A
Authority
CN
China
Prior art keywords
sql
error reporting
reporting information
sql error
self
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.)
Granted
Application number
CN202010242096.8A
Other languages
Chinese (zh)
Other versions
CN111367705B (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.)
Industrial and Commercial Bank of China Ltd ICBC
Original Assignee
Industrial and Commercial Bank of China Ltd ICBC
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 Industrial and Commercial Bank of China Ltd ICBC filed Critical Industrial and Commercial Bank of China Ltd ICBC
Priority to CN202010242096.8A priority Critical patent/CN111367705B/en
Publication of CN111367705A publication Critical patent/CN111367705A/en
Application granted granted Critical
Publication of CN111367705B publication Critical patent/CN111367705B/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/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/0703Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation
    • G06F11/0793Remedial or corrective actions
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/0703Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation
    • G06F11/0766Error or fault reporting or storing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/242Query formulation
    • G06F16/2433Query languages

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Quality & Reliability (AREA)
  • Mathematical Physics (AREA)
  • Computational Linguistics (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention provides a processing method and a device for SQL error report, wherein the method comprises the following steps: acquiring SQL error reporting information which comprises an SQL return code; if the SQL return code is judged to be matched with the self-recovery return code, judging whether the SQL error report information has a record; wherein the self-recovery return code is preset; if the SQL error reporting information is judged and known to be not recorded, self-recovery processing is carried out on the SQL error reporting information, the SQL error reporting information is registered to an SQL error reporting information base, and the state of the SQL error reporting information is marked to be in self-recovery. The device is used for executing the method. The processing method and the processing device for the SQL error report improve the processing efficiency of the SQL error report information.

Description

SQL error reporting processing method and device
Technical Field
The invention relates to the technical field of data processing, in particular to a method and a device for processing SQL error report.
Background
Structured Query Language (SQL) is a database Query and programming Language, and is widely used due to its advantages of rich functions, convenient and flexible use, simple Language, and easy learning.
The database used by the online application system of IBM mainframe is usually DB2 database, and IBM mainframe loads SQL information of program when executing SQL statement through DB2 database, which requires that the SQL statement in the execution program is consistent with the structure of SQL statement in DB2 database system table. In the development phase of the host application project, because the program version and the table version of the database system are frequently updated, SQL error reporting caused by asynchronous update of the program version and the table version of the database system often occurs, for example, the IBM mainframe returns return codes such as-805 and-904 when the online transaction executes SQL statements, which indicates that the versions are inconsistent. In the prior art, to solve the problems, a single step of tracking the execution process of the online transaction is required to locate the specific program and report error information in detail, so that not only is a great deal of manpower consumed, but also the processing is time-consuming, and the related machine transaction fails in the period from the occurrence of the problems to the solution.
Disclosure of Invention
For solving the problems in the prior art, embodiments of the present invention provide a method and an apparatus for processing an SQL error report, which can at least partially solve the problems in the prior art.
On one hand, the invention provides a processing method for SQL error reporting, which comprises the following steps:
acquiring SQL error reporting information which comprises an SQL return code;
if the SQL return code is judged to be matched with the self-recovery return code, judging whether the SQL error report information has a record; wherein the self-recovery return code is preset;
if the SQL error reporting information is judged and known to be not recorded, self-recovery processing is carried out on the SQL error reporting information, the SQL error reporting information is registered to an SQL error reporting information base, and the state of the SQL error reporting information is marked to be in self-recovery.
In another aspect, the present invention provides an apparatus for processing SQL error reporting, including:
the error reporting information acquisition unit is used for acquiring SQL error reporting information which comprises an SQL return code;
the judging unit is used for judging whether the SQL error report information has a record or not after judging that the SQL return code is matched with the self-recovery return code; wherein the self-recovery return code is preset;
and the self-recovery processing unit is used for performing self-recovery processing on the SQL error reporting information after judging that no record is recorded in the SQL error reporting information, registering the SQL error reporting information to an SQL error reporting information base and marking the state of the SQL error reporting information as self-recovery.
In another aspect, the present invention provides an electronic device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor implements the steps of the SQL error processing method according to any of the above embodiments when executing the computer program.
In another aspect, the present invention provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the steps of the SQL error processing method according to any of the above embodiments.
The processing method and device for SQL error reporting provided by the embodiment of the invention can acquire SQL error reporting information, judge whether the SQL error reporting information has a record after judging that the SQL return code is matched with the self-recovery return code, perform self-recovery processing on the SQL error reporting information after judging that the SQL error reporting information has no record, register the SQL error reporting information to an SQL error reporting information base and mark the state of the SQL error reporting information as self-recovery, can automatically process the SQL error reporting information, reduce manual participation and improve the processing efficiency of the SQL error reporting information.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts. In the drawings:
fig. 1 is a flowchart illustrating a processing method for SQL error reporting according to an embodiment of the present invention.
Fig. 2 is a flowchart illustrating a processing method for SQL error reporting according to another embodiment of the present invention.
Fig. 3 is a flowchart illustrating a processing method for SQL error reporting according to another embodiment of the present invention.
Fig. 4 is a flowchart illustrating a processing method for SQL error reporting according to still another embodiment of the present invention.
Fig. 5 is a schematic structural diagram of an SQL error reporting processing system according to an embodiment of the present invention.
Fig. 6 is a schematic structural diagram of an SQL error reporting processing apparatus according to an embodiment of the present invention.
Fig. 7 is a schematic structural diagram of an SQL error reporting processing apparatus according to another embodiment of the present invention.
Fig. 8 is a schematic structural diagram of an SQL error reporting processing apparatus according to another embodiment of the present invention.
Fig. 9 is a schematic structural diagram of an SQL error reporting processing apparatus according to yet another embodiment of the present invention.
Fig. 10 is a schematic physical structure diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention more apparent, the embodiments of the present invention are further described in detail below with reference to the accompanying drawings. The exemplary embodiments and descriptions of the present invention are provided to explain the present invention, but not to limit the present invention. It should be noted that the embodiments and features of the embodiments in the present application may be arbitrarily combined with each other without conflict.
Fig. 1 is a schematic flow chart of a processing method for SQL error reporting according to an embodiment of the present invention, and as shown in fig. 1, the processing method for SQL error reporting according to an embodiment of the present invention includes:
s101, acquiring SQL error reporting information, wherein the SQL error reporting information comprises an SQL return code;
specifically, when online transaction is performed, an application on a server executes an SQL statement, and if the SQL statement is executed to generate SQL error reporting information, the server obtains the SQL error reporting information, where the SQL error reporting information may include information such as a middleware name, a program name, program compilation time, an SQL statement sequence number, and an SQL return code. The execution body of the processing method for the SQL error report provided by the embodiment of the present invention includes, but is not limited to, a server.
S102, if the SQL return code is judged to be matched with the self-recovery return code, judging whether the SQL error report information has a record; wherein the self-recovery return code is preset;
specifically, after the server obtains the SQL error reporting information, the server compares an SQL return code included in the SQL error reporting information with a self-recovery return code, if the SQL return code is the same as one of the self-recovery return codes, the SQL return code is matched with the self-recovery return code, which indicates a processing flow that can perform self-recovery on the error reporting information, and the server determines whether the SQL error reporting information is recorded, that is, determines whether the same error reporting information is recorded. The self-recovery return code is preset, and may include multiple return codes, for example, common SQL error reporting codes such as-805 and-904, which are set according to actual needs, and the embodiment of the present invention is not limited. Understandably, if the SQL return code does not match the self-recovery return code, the error information is not subjected to self-recovery processing.
For example, when the server determines whether the SQL error reporting information has a record, the server may compare the current SQL error reporting information with the SQL error reporting information registered in the SQL error reporting information base one by one, if the current SQL error reporting information matches one piece of the registered SQL error reporting information, then the current SQL error reporting information has a record, and if the current SQL error reporting information does not match any piece of the SQL error reporting information registered in the SQL error reporting information base, then the current SQL error reporting information does not have a record. When determining whether the current SQL error report information matches the registered SQL error report information, it may be determined whether the middleware name, the program name, the SQL statement sequence number, and the SQL return code included in the current SQL error report information are the same as the middleware name, the program name, the SQL statement sequence number, and the SQL return code included in the registered SQL error report information, if the middleware name, the program name, the SQL statement sequence number, and the SQL return code included in the current SQL error report information are the same as the corresponding information of the middleware name, the program name, the SQL statement sequence number, and the SQL return code included in the registered SQL error report information, then the current SQL error report information matches the registered SQL error report information, if the middleware name, the program name, the SQL statement sequence number, and the SQL return code included in the current SQL error report information are different from the corresponding information of the middleware name, the program name, the SQL statement sequence number, and the SQL return code included in the registered SQL error report information, then the current SQL error message does not match the registered SQL error message.
S103, if the SQL error reporting information is judged to be not recorded, self-recovery processing is carried out on the SQL error reporting information, the SQL error reporting information is registered to an SQL error reporting information base, and the state of the SQL error reporting information is marked to be in self-recovery.
Specifically, after judging whether the SQL error reporting information is recorded or not, if the SQL error reporting information is judged not to be recorded, the server performs self-recovery processing on the SQL error reporting information, registers the SQL error reporting information in an SQL error reporting information base, and marks the status of the SQL error reporting information as self-recovery.
The processing method for the SQL error report provided by the embodiment of the invention can acquire the SQL error report information, judge whether the SQL error report information is recorded or not after judging and knowing that the SQL return code is matched with the self-recovery return code, perform self-recovery processing on the SQL error report information after judging and knowing that the SQL error report information is not recorded, register the SQL error report information to the SQL error report information base and mark the state of the SQL error report information as self-recovery, can automatically process the SQL error report information, reduce manual participation and improve the processing efficiency of the SQL error report information.
Fig. 2 is a schematic flow chart of a processing method for SQL error reporting according to another embodiment of the present invention, and as shown in fig. 2, on the basis of the foregoing embodiments, the performing self-recovery processing on the SQL error reporting information further includes:
s1031, acquiring a program executable file corresponding to the program name according to the program name included in the SQL error reporting information, and loading the program executable file to the middleware;
specifically, the server may obtain a program name from the SQL error report information, then obtain a program executable file corresponding to the program name according to the program name query, and then load the program executable file into the middleware, so as to ensure that the latest version of the program is executed during the online transaction. The middleware may adopt a client Information Control System (CICS for short).
For example, the server obtains the program executable file corresponding to the program name from the CICS library according to the program name, and then loads the program executable file into the CICS by executing the CICS NEWCOPY command, so that the latest version of the program is executed when the program executable file corresponding to the program name is executed when online transaction is performed.
S1032, acquiring an SQL statement description file corresponding to the program name according to the program name included in the SQL error report information, and importing the SQL statement description file into a database system table;
specifically, the server may obtain a program name from the SQL error reporting information, then query and obtain an SQL statement description file corresponding to the program name according to the program name, and then import the SQL statement included in the SQL statement description file into the database system table, so as to ensure that the program version is consistent with the database system table version. Wherein the database system table may be a database system table of a DB2 database.
For example, the server obtains an SQL statement description file corresponding to the program name according to the program name query included in the SQL error reporting information, and extracts and imports the SQL statement included in the SQL statement description file into a database system table of the DB2 database by executing the DB2 BIND operation.
S1033, re-executing the SQL statement corresponding to the SQL error reporting information and setting the state of the SQL error reporting information to be self-recovery completion.
Specifically, after the server loads the program executable file corresponding to the program name into the middleware, the feedback information of successful loading can be obtained, and after the server imports the SQL statement description file corresponding to the program name into the database system table, the feedback information of successful import can be obtained. After the server obtains the feedback information of successful loading and successful importing, the server executes the SQL statement corresponding to the SQL error reporting information again, if no SQL error reporting information appears, the problem of SQL error reporting information generation is solved, and the subsequent operation of online transaction can be carried out. After the server obtains the feedback information of successful loading and successful importing, the state of the SQL error reporting information is changed from self-recovery to self-recovery completion.
Fig. 3 is a schematic flow chart of a processing method for SQL error reporting according to another embodiment of the present invention, as shown in fig. 3, on the basis of the foregoing embodiments, further, the processing method for SQL error reporting according to the embodiment of the present invention further includes:
s301, if the SQL error reporting information is judged and known to have records, acquiring the state of the SQL error reporting information;
specifically, after judging whether the SQL error reporting information has a record, if the SQL error reporting information has a record, the server may obtain the status of the SQL error reporting information, which indicates that the SQL error reporting information has already been registered in the SQL error reporting information base. The self-recovery error reporting information of the registered SQL has two states of self-recovery in and self-recovery completion.
S302, if the state of the SQL error reporting information is judged to be in self recovery, adding a transaction task number corresponding to the SQL error reporting information in an SQL error reporting information base; the SQL error reporting information comprises a transaction task number;
specifically, after the server obtains the status of the SQL error reporting information, if the status of the SQL error reporting information is in self-recovery, it indicates that one piece of SQL error reporting information matched with the SQL error reporting information is in self-recovery processing, and it may not be necessary to perform self-recovery processing on the SQL error reporting information, the server may add the transaction task number corresponding to the SQL error reporting information library, and after the SQL error reporting information self-recovery processing matched with the SQL error reporting information is completed, all transaction task numbers corresponding to the SQL error reporting information may obtain the processing result of the SQL error reporting information subjected to self-recovery processing.
And S303, if the state of the SQL error reporting information is judged to be self-recovery completion, prompting to carry out error reporting processing.
Specifically, after the server obtains the state of the SQL error reporting information, if the state of the SQL error reporting information is self-recovery completed, it is indicated that the SQL error reporting information has been subjected to self-recovery processing, but the problem of the SQL error reporting information is not solved, manual intervention is required at this time, and the server prompts an operation and maintenance worker to perform error reporting processing.
For example, the server sends a mail to notify an operation and maintenance worker to prompt for error reporting processing, and the mail may include the SQL error reporting information.
Fig. 4 is a schematic flow chart of a processing method for SQL error reporting according to still another embodiment of the present invention, as shown in fig. 4, on the basis of the foregoing embodiments, further, the processing method for SQL error reporting according to the embodiment of the present invention further includes:
s401, when SQL error report information is obtained, on-line transaction waiting corresponding to a transaction task number corresponding to the SQL error report information is triggered;
specifically, in the prior art, when SQL error information occurs, online transaction failure may be caused, and since a part of the problem that SQL error information is caused may be solved after the SQL error information is subjected to self-recovery processing, when the server obtains the SQL error information, the server may trigger waiting of online transaction corresponding to the transaction task number corresponding to the SQL error information.
For example, when the server acquires the SQL error message, the server executes the CICS DELAY command to wait for the online transaction corresponding to the transaction task number corresponding to the SQL error message, and waits for the processing result of the SQL error message.
S402, when the preset condition is reached, the waiting of the online transaction corresponding to the transaction task number corresponding to the SQL error report information is released.
Specifically, in the process of waiting for the online transaction, if a preset condition is reached, the server may release the waiting for the online transaction corresponding to the transaction task number corresponding to the SQL error report message.
The preset conditions are that the SQL error reporting information is recorded and the status of the SQL error reporting information is self-recovery completed, the program executable file corresponding to the SQL error reporting information is successfully loaded to the middleware, and the SQL statement corresponding to the SQL error reporting information is successfully imported to the database system table or the preset time is exceeded after the SQL error reporting information is acquired.
When the server judges that the SQL error reporting information has a record and the status of the SQL error reporting information is self-recovery completion, the problem of SQL error reporting information generation is not solved, and after the waiting of the online transaction corresponding to the transaction task number corresponding to the SQL error reporting information is released, the SQL error reporting information can be returned to the application program executing the SQL statement.
And after the server judges that the program executable file corresponding to the SQL error reporting information is successfully loaded into the middleware and the SQL statement corresponding to the SQL error reporting information is successfully imported into the database system table, the waiting of the online transaction corresponding to the transaction task number corresponding to the SQL error reporting information is relieved, the SQL statement corresponding to the SQL error reporting information is re-executed, and if the SQL error reporting information is not generated any more, the subsequent operation of the online transaction can be carried out. The method comprises the steps of triggering online transaction waiting when SQL error report information is acquired, carrying out self-recovery processing on the SQL error report information, avoiding generating the SQL error report information, avoiding transaction failure while automatically solving the problem of SQL error report information, and improving the reliability of online transaction.
And when the server judges that the processing result of the SQL error reporting information is not received after the SQL error reporting information is acquired for more than the preset time, the server cancels the waiting of the online transaction corresponding to the transaction task number corresponding to the SQL error reporting information and returns the SQL error reporting information to the application program executing the SQL statement. The preset time is set according to actual needs, for example, set to 100 milliseconds, and the embodiment of the present invention is not limited.
Fig. 5 is a schematic structural diagram of an SQL error reporting processing system according to an embodiment of the present invention, and as shown in fig. 5, the SQL error reporting processing system according to an embodiment of the present invention includes an SQL exit module 501, a self-recovery main control module 502, a program loading module 503, a program binding module 504, and a notification module 505, where:
the SQL outlet module 501 is in communication connection with the self-recovery main control module 502, and the self-recovery main control module 502 is in communication connection with the program loading module 503, the program binding module 504 and the notification module 505, respectively.
Specifically, the self-recovery main control module 502 can activate the SQL exit module 501 through the CICS ENABLE command, and after the SQL exit module 501 is activated, the execution of the SQL statement at the CICS system level is associated with the SQL exit module 501.
When the online transaction is running, when the application executes the SQL statement, the SQL exit module 501 is triggered to run, and the SQL exit module 501 obtains the SQL error reporting information, which includes information such as a middleware name, a program name, program compiling time, a sequence number of the SQL statement, an SQL return code, and a transaction task number. The SQL export module 501, when obtaining the SQL error message, may execute CICS DELAY command to trigger waiting of the online transaction corresponding to the transaction task number. Such as withdrawing money, inquiring account balance, etc.
The SQL exit module 501 determines whether the SQL return code matches the self-recovery return code, and if yes, sends the SQL error report message to the self-recovery main control module 502 for processing. If not, the instructions CICS CANCLE DELAY may be executed to unpark the online transaction corresponding to the transaction task number.
The self-recovery main control module 502 determines whether the SQL error reporting information has a record in the SQL error reporting information base, and if no record exists, registers the SQL error reporting information to the SQL error reporting information base and marks the status of the SQL error reporting information as self-recovery. The self-recovery main control module 502 sends the program name included in the SQL error reporting information to the program loading module 503, and the program loading module 503 executes the CICS NEWCOPY instruction to obtain the program executable file corresponding to the program name from the CICS program library and loads the program executable file into the CICS, so as to ensure that the latest version of the program is called when the online transaction executes the SQL statement corresponding to the SQL error reporting information. The self-recovery main control module 502 sends the program name included in the SQL error report information to the program binding module 504, and the program binding module 504 acquires the SQL statement description file corresponding to the program name according to the program name and extracts and guides the SQL statement included in the SQL statement description file to the database system table of the DB2 database by executing the DB2 BIND operation, so as to ensure that the version of the program is consistent with the version of the database system table.
The self-recovery main control module 502 receives the feedback information of successful loading returned by the program loading module 503 and receives the feedback information of successful import returned by the program binding module 504, and the self-recovery main control module 502 sends re-execution information to the SQL exit module 501 and sets the status of SQL error reporting information to be self-recovery complete. The self-recovery main control module 502 may execute CICSCANCLE DELAY instructions to release the waiting of the online transaction corresponding to the transaction task number corresponding to the SQL error report message, that is, notify the online transaction release waiting corresponding to the transaction task number one by one through the SQL exit module 501 according to the transaction task number. The transaction task numbers corresponding to the SQL error reporting information can be multiple.
After receiving the re-execution information, the SQL exit module 501 re-executes the SQL statement corresponding to the SQL error reporting information, and returns the execution result to the application program if the SQL error reporting information does not appear. If the SQL error message still appears, the SQL export module 501 obtains the SQL error message and executes CICS DELAY to trigger waiting of the online transaction corresponding to the transaction task number.
The SQL exit module 501 determines whether the SQL return code matches the self-recovery return code, and if yes, sends the SQL error report message to the self-recovery main control module 502 for processing. The self-recovery main control module 502 determines whether the SQL error reporting information has a record in the SQL error reporting information base, and if so, obtains the status of the SQL error reporting information from the SQL error reporting information base. And if the state of the SQL error reporting information is in self-recovery, adding a transaction task number corresponding to the SQL error reporting information in an SQL error reporting information base. The status of the SQL error reporting information is self-recovery completed, which indicates that the SQL error reporting information is still error-reported after being processed, the self-recovery main control module 502 sends the SQL error reporting information to the notification module 505, the notification module 505 can notify the operation and maintenance personnel of error reporting, and the notification module 505 can send a mail to notify the operation and maintenance personnel through the SMTP protocol.
After determining that the SQL error report information has a record and the status of the SQL error report information is self-recovery completed, the self-recovery main control module 502 may execute CICS CANCLE DELAY to release the waiting of the online transaction corresponding to the transaction task number corresponding to the SQL error report information. The self-recovery main control module 502 sends self-recovery failure information to the SQL exit module 501, and after receiving the self-recovery failure information, the SQL exit module 501 returns SQL error reporting information to the application program.
After the SQL exit module 501 receives the SQL error reporting information more than 100 milliseconds after acquiring the SQL error reporting information, and does not receive the feedback information of the SQL error reporting information sent by the self-recovery main control module 502, the SQL exit module executes CICS CANCLE DELAY to instruct to release the waiting of the online transaction corresponding to the transaction task number corresponding to the SQL error reporting information.
Fig. 6 is a schematic structural diagram of an SQL error reporting processing apparatus according to an embodiment of the present invention, and as shown in fig. 6, the SQL error reporting processing apparatus according to an embodiment of the present invention includes an error reporting information obtaining unit 601, a determining unit 602, and a self-recovery processing unit 603, where:
the error information acquiring unit 601 is configured to acquire SQL error information, where the SQL error information includes an SQL return code; the judging unit 602 is configured to judge whether there is a record in the SQL error reporting information after judging that the SQL return code matches the self-recovery return code; wherein the self-recovery return code is preset; the self-recovery processing unit 603 is configured to perform self-recovery processing on the SQL error reporting information after it is determined that no record is recorded in the SQL error reporting information, register the SQL error reporting information to the SQL error reporting information base, and mark the status of the SQL error reporting information as being in self-recovery.
Specifically, when performing online transaction, the application executes the SQL statement, and if the execution of the SQL statement generates SQL error information, the error information obtaining unit 601 obtains the SQL error information, where the SQL error information may include information such as a middleware name, a program compiling time, a SQL statement sequence number, and an SQL return code.
After the SQL error reporting information is obtained, the determining unit 602 may compare an SQL return code included in the SQL error reporting information with a self-recovery return code, if the SQL return code is the same as one of the self-recovery return codes, the SQL return code is matched with the self-recovery return code, which indicates a processing flow that can perform self-recovery on the error reporting information, and the determining unit 602 may determine whether the SQL error reporting information has been recorded, that is, whether the same error reporting information has been recorded. The self-recovery return code is preset, and may include multiple return codes, for example, common SQL error reporting codes such as-805 and-904, which are set according to actual needs, and the embodiment of the present invention is not limited. Understandably, if the SQL return code does not match the self-recovery return code, the error information is not subjected to self-recovery processing.
After determining whether the SQL error reporting information has a record, if the self-recovery processing unit 603 determines that the SQL error reporting information has no record, the self-recovery processing unit performs self-recovery processing on the SQL error reporting information, registers the SQL error reporting information in an SQL error reporting information base, and marks the status of the SQL error reporting information as self-recovery.
The processing device for the SQL error reporting provided by the embodiment of the invention can acquire the SQL error reporting information, judge whether the SQL error reporting information is recorded or not after judging and knowing that the SQL return code is matched with the self-recovery return code, perform self-recovery processing on the SQL error reporting information after judging and knowing that the SQL error reporting information is not recorded, register the SQL error reporting information to the SQL error reporting information base and mark the state of the SQL error reporting information as self-recovery, can automatically process the SQL error reporting information, reduce manual participation and improve the processing efficiency of the SQL error reporting information.
Fig. 7 is a schematic structural diagram of a processing apparatus for SQL error reporting according to another embodiment of the present invention, and as shown in fig. 7, on the basis of the foregoing embodiments, the self-recovery processing unit 603 further includes a loading subunit 6031, an importing subunit 6032, and an executing subunit 6033, where:
the loading subunit 6031 is configured to obtain, according to the program name included in the SQL error reporting information, a program executable file corresponding to the program name, and load the program executable file into the middleware; the import subunit 6032 is configured to obtain, according to the program name included in the SQL error reporting information, an SQL statement description file corresponding to the program name and import the SQL statement description file into the database system table; the execution subunit 6033 is configured to re-execute the SQL statement corresponding to the SQL error reporting information and set the status of the SQL error reporting information to be self-recovery completed.
Specifically, the loading subunit 6031 may obtain a program name from the SQL error report information, then obtain a program executable file corresponding to the program name according to the program name query, and then load the program executable file into the middleware, so as to ensure that the latest version of the program is executed in the online transaction. Wherein, the middleware can adopt CICS.
The importing subunit 6032 may obtain a program name from the SQL error reporting information, then query and obtain an SQL statement description file corresponding to the program name according to the program name, and import the SQL statement included in the SQL statement description file into the database system table, so as to ensure that the program version is consistent with the database system table version. Wherein the database system table may be a database system table of a DB2 database.
After loading the program executable file corresponding to the program name into the middleware, the execution sub-unit 6033 may obtain feedback information that the loading is successful, and after importing the SQL statement description file corresponding to the program name into the database system table, the execution sub-unit 6033 may obtain feedback information that the importing is successful. After obtaining the feedback information of successful loading and successful importing, the execution subunit 6033 re-executes the SQL statement corresponding to the SQL error reporting information, and if no SQL error reporting information appears any more, it indicates that the problem of generating the SQL error reporting information is solved, and the subsequent operations of online transactions can be performed. After the server obtains the feedback information of successful loading and successful importing, the state of the SQL error reporting information is changed from self-recovery to self-recovery completion.
Fig. 8 is a schematic structural diagram of a processing apparatus for SQL error reporting according to another embodiment of the present invention, as shown in fig. 8, on the basis of the foregoing embodiments, further, the processing apparatus for SQL error reporting according to an embodiment of the present invention further includes a state obtaining unit 604, an adding unit 605, and a prompting unit 606, where:
the state obtaining unit 604 is configured to obtain a state of the SQL error reporting information after it is determined that the SQL error reporting information has a record; the adding unit 605 is configured to add a transaction task number corresponding to the SQL error reporting information library after determining that the status of the SQL error reporting information is in self-recovery; the SQL error reporting information comprises a transaction task number; the prompting unit 606 is configured to prompt to perform error reporting processing after determining that the state of the SQL error reporting information is self-recovery completed.
Specifically, after determining whether the SQL error report information has a record, the state obtaining unit 604 obtains the state of the SQL error report information if it determines that the SQL error report information has a record, which indicates that the SQL error report information has already been registered in the SQL error report information base. The self-recovery error reporting information of the registered SQL has two states of self-recovery in and self-recovery completion.
After the state of the SQL error reporting information is obtained, if the state of the SQL error reporting information is in self-recovery, it indicates that one piece of SQL error reporting information matched with the SQL error reporting information is undergoing self-recovery processing, and it may not be necessary to perform self-recovery processing on the SQL error reporting information, the adding unit 605 may add the transaction task number corresponding to the SQL error reporting information base, and after the SQL error reporting information self-recovery processing matched with the SQL error reporting information is completed, all transaction task numbers corresponding to the SQL error reporting information may obtain the processing result of the SQL error reporting information undergoing self-recovery processing.
After the state of the SQL error reporting information is obtained, if the state of the SQL error reporting information is self-recovery completed, it is indicated that the SQL error reporting information has been subjected to self-recovery processing, but the problem of the SQL error reporting information is not solved, manual intervention is required at this time, and the prompting unit 606 prompts an operation and maintenance worker to perform error reporting processing.
Fig. 9 is a schematic structural diagram of a processing apparatus for SQL error reporting according to yet another embodiment of the present invention, as shown in fig. 9, on the basis of the foregoing embodiments, further, the processing apparatus for SQL error reporting according to an embodiment of the present invention further includes a trigger waiting unit 607 and a release waiting unit 608, where:
the trigger waiting unit 607 is configured to trigger waiting of an online transaction corresponding to a transaction task number corresponding to the SQL error reporting information when acquiring the SQL error reporting information; the wait releasing unit 608 is configured to release the waiting of the online transaction corresponding to the transaction task number corresponding to the SQL error report information when a preset condition is reached.
Specifically, in the prior art, when SQL error information occurs, online transaction failure may be caused, and since a part of the problem that SQL error information is caused may be solved after the SQL error information is subjected to self-recovery processing, the trigger waiting unit 607 may trigger waiting of online transaction corresponding to the transaction task number corresponding to the SQL error information when acquiring the SQL error information.
Specifically, in the process of waiting for the online transaction, if a preset condition is reached, the wait releasing unit 608 releases the waiting for the online transaction corresponding to the transaction task number corresponding to the SQL error report message.
The preset conditions are that the SQL error reporting information is recorded and the status of the SQL error reporting information is self-recovery completed, the program executable file corresponding to the SQL error reporting information is successfully loaded to the middleware, and the SQL statement corresponding to the SQL error reporting information is successfully imported to the database system table or the preset time is exceeded after the SQL error reporting information is acquired.
When the wait releasing unit 608 determines that the SQL error report information has a record and the status of the SQL error report information is self-recovery completed, it indicates that the problem that the SQL error report information generates is not solved, and after the waiting for the online transaction corresponding to the transaction task number corresponding to the SQL error report information is released, the SQL error report information may be returned to the application program executing the SQL statement.
When the wait releasing unit 608 determines that the program executable file corresponding to the SQL error reporting information is successfully loaded into the middleware and the SQL statement corresponding to the SQL error reporting information is successfully imported into the database system table, the wait of the online transaction corresponding to the transaction task number corresponding to the SQL error reporting information is released, the SQL statement corresponding to the SQL error reporting information is re-executed, and if the SQL error reporting information is no longer generated, the subsequent operation of the online transaction can be performed. The method comprises the steps of triggering online transaction waiting when SQL error report information is acquired, carrying out self-recovery processing on the SQL error report information, avoiding generating the SQL error report information, avoiding transaction failure while automatically solving the problem of SQL error report information, and improving the reliability of online transaction.
When the wait releasing unit 608 determines that the processing result of the SQL error reporting information is not received after the SQL error reporting information is acquired for more than the preset time, the wait of the online transaction corresponding to the transaction task number corresponding to the SQL error reporting information is released, and the SQL error reporting information is returned to the application program executing the SQL statement. The preset time is set according to actual needs, for example, set to 100 milliseconds, and the embodiment of the present invention is not limited.
The embodiment of the apparatus provided in the embodiment of the present invention may be specifically configured to execute the processing flows of the above method embodiments, and the functions of the apparatus are not described herein again, and refer to the detailed description of the above method embodiments.
Fig. 10 is a schematic physical structure diagram of an electronic device according to an embodiment of the present invention, and as shown in fig. 10, the electronic device may include: a processor (processor)1001, a communication Interface (communication Interface)1002, a memory (memory)1003 and a communication bus 1004, wherein the processor 1001, the communication Interface 1002 and the memory 1003 complete communication with each other through the communication bus 1004. Processor 1001 may call logic instructions in memory 1003 to perform the following method: acquiring SQL error reporting information which comprises an SQL return code; if the SQL return code is judged to be matched with the self-recovery return code, judging whether the SQL error report information has a record; wherein the self-recovery return code is preset; if the SQL error reporting information is judged and known to be not recorded, self-recovery processing is carried out on the SQL error reporting information, the SQL error reporting information is registered to an SQL error reporting information base, and the state of the SQL error reporting information is marked to be in self-recovery.
In addition, the logic instructions in the memory 1003 may be implemented in the form of software functional units and may be stored in a computer readable storage medium when the logic instructions are sold or used as independent products. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
The present embodiment discloses a computer program product comprising a computer program stored on a non-transitory computer readable storage medium, the computer program comprising program instructions which, when executed by a computer, enable the computer to perform the method provided by the above-mentioned method embodiments, for example, comprising: acquiring SQL error reporting information which comprises an SQL return code; if the SQL return code is judged to be matched with the self-recovery return code, judging whether the SQL error report information has a record; wherein the self-recovery return code is preset; if the SQL error reporting information is judged and known to be not recorded, self-recovery processing is carried out on the SQL error reporting information, the SQL error reporting information is registered to an SQL error reporting information base, and the state of the SQL error reporting information is marked to be in self-recovery.
The present embodiment provides a computer-readable storage medium, which stores a computer program, where the computer program causes the computer to execute the method provided by the above method embodiments, for example, the method includes: acquiring SQL error reporting information which comprises an SQL return code; if the SQL return code is judged to be matched with the self-recovery return code, judging whether the SQL error report information has a record; wherein the self-recovery return code is preset; if the SQL error reporting information is judged and known to be not recorded, self-recovery processing is carried out on the SQL error reporting information, the SQL error reporting information is registered to an SQL error reporting information base, and the state of the SQL error reporting information is marked to be in self-recovery.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In the description herein, reference to the description of the terms "one embodiment," "a particular embodiment," "some embodiments," "for example," "an example," "a particular example," or "some examples," etc., means that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the invention. In this specification, the schematic representations of the terms used above do not necessarily refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.
The above-mentioned embodiments are intended to illustrate the objects, technical solutions and advantages of the present invention in further detail, and it should be understood that the above-mentioned embodiments are only exemplary embodiments of the present invention, and are not intended to limit the scope of the present invention, and any modifications, equivalent substitutions, improvements and the like made within the spirit and principle of the present invention should be included in the scope of the present invention.

Claims (12)

1. A SQL error reporting processing method is characterized by comprising the following steps:
acquiring SQL error reporting information which comprises an SQL return code;
if the SQL return code is judged to be matched with the self-recovery return code, judging whether the SQL error report information has a record; wherein the self-recovery return code is preset;
if the SQL error reporting information is judged and known to be not recorded, self-recovery processing is carried out on the SQL error reporting information, the SQL error reporting information is registered to an SQL error reporting information base, and the state of the SQL error reporting information is marked to be in self-recovery.
2. The method according to claim 1, wherein the self-recovery processing of the SQL error reporting information comprises:
acquiring a program executable file corresponding to the program name according to the program name included in the SQL error reporting information and loading the program executable file to a middleware;
acquiring an SQL statement description file corresponding to the program name according to the program name included in the SQL error report information and importing the SQL statement description file into a database system table;
and re-executing the SQL statement corresponding to the SQL error reporting information and setting the state of the SQL error reporting information to be self-recovery completion.
3. The method of claim 1, further comprising:
if the SQL error reporting information is judged and known to have records, acquiring the state of the SQL error reporting information;
if the state of the SQL error reporting information is judged to be in self recovery, adding a transaction task number corresponding to the SQL error reporting information in an SQL error reporting information base; the SQL error reporting information comprises a transaction task number;
and if the state of the SQL error reporting information is judged to be self-recovery completion, prompting to carry out error reporting processing.
4. The method of any of claims 1 to 3, further comprising:
when SQL error reporting information is acquired, triggering the waiting of online transaction corresponding to the transaction task number corresponding to the SQL error reporting information;
and when the preset condition is reached, the waiting of the online transaction corresponding to the transaction task number corresponding to the SQL error report information is released.
5. The method according to claim 4, wherein the predetermined condition is that the SQL error report information is recorded and the status of the SQL error report information is self-recovery completed, the program executable file corresponding to the SQL error report information is successfully loaded to the middleware and the SQL statement corresponding to the SQL error report information is successfully imported to the database system table or a predetermined time is exceeded after the SQL error report information is obtained.
6. An apparatus for processing SQL error reporting, comprising:
the error reporting information acquisition unit is used for acquiring SQL error reporting information which comprises an SQL return code;
the judging unit is used for judging whether the SQL error report information has a record or not after judging that the SQL return code is matched with the self-recovery return code; wherein the self-recovery return code is preset;
and the self-recovery processing unit is used for performing self-recovery processing on the SQL error reporting information after judging that no record is recorded in the SQL error reporting information, registering the SQL error reporting information to an SQL error reporting information base and marking the state of the SQL error reporting information as self-recovery.
7. The apparatus of claim 6, wherein the self-healing processing unit comprises:
the loading subunit is used for acquiring a program executable file corresponding to the program name according to the program name included in the SQL error reporting information and loading the program executable file to the middleware;
the importing subunit is used for acquiring an SQL statement description file corresponding to the program name according to the program name included in the SQL error reporting information and importing the SQL statement description file into a database system table;
and the execution subunit is used for re-executing the SQL statement corresponding to the SQL error reporting information and setting the state of the SQL error reporting information as self-recovery completion.
8. The apparatus of claim 6, further comprising:
the state acquisition unit is used for acquiring the state of the SQL error reporting information after judging and knowing that the SQL error reporting information has records;
the adding unit is used for adding a transaction task number corresponding to the SQL error reporting information in an SQL error reporting information base after judging that the state of the SQL error reporting information is in self recovery; the SQL error reporting information comprises a transaction task number;
and the prompting unit is used for prompting to carry out error reporting processing after judging that the state of the SQL error reporting information is self-recovery completion.
9. The apparatus of any one of claims 6 to 8, further comprising:
the trigger waiting unit is used for triggering the waiting of the online transaction corresponding to the transaction task number corresponding to the SQL error reporting information when the SQL error reporting information is acquired;
and the waiting releasing unit is used for releasing the waiting of the online transaction corresponding to the transaction task number corresponding to the SQL error report information when a preset condition is reached.
10. The apparatus of claim 9, wherein the predetermined condition is that the SQL error reporting information is recorded and the status of the SQL error reporting information is self-recovery completed, the program executable file corresponding to the SQL error reporting information is successfully loaded into the middleware and the SQL statement corresponding to the SQL error reporting information is successfully imported into the database system table or exceeds a predetermined time after the SQL error reporting information is obtained.
11. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the steps of the method according to any of claims 1 to 5 are implemented when the computer program is executed by the processor.
12. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method of any one of claims 1 to 5.
CN202010242096.8A 2020-03-31 2020-03-31 SQL error reporting processing method and device Active CN111367705B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010242096.8A CN111367705B (en) 2020-03-31 2020-03-31 SQL error reporting processing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010242096.8A CN111367705B (en) 2020-03-31 2020-03-31 SQL error reporting processing method and device

Publications (2)

Publication Number Publication Date
CN111367705A true CN111367705A (en) 2020-07-03
CN111367705B CN111367705B (en) 2023-08-04

Family

ID=71207050

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010242096.8A Active CN111367705B (en) 2020-03-31 2020-03-31 SQL error reporting processing method and device

Country Status (1)

Country Link
CN (1) CN111367705B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112148528A (en) * 2020-09-14 2020-12-29 北京同邦卓益科技有限公司 Method and device for realizing automatic fault tolerance

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040236822A1 (en) * 2003-05-23 2004-11-25 International Business Machines Corporation Recoverable return code tracking and notification for autonomic systems
US20110087637A1 (en) * 2009-10-09 2011-04-14 International Business Machines Corporation Method and System for Database Recovery
CN107566392A (en) * 2017-09-22 2018-01-09 北京知道创宇信息技术有限公司 A kind of detection method and proxy server of the type SQL injection that reports an error
CN110362428A (en) * 2019-06-27 2019-10-22 北京人大金仓信息技术股份有限公司 The on-line automatic method and system for restoring database block
CN110427422A (en) * 2019-05-23 2019-11-08 武汉达梦数据库有限公司 Data consistency verification method, equipment and storage medium when data synchronous abnormality

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040236822A1 (en) * 2003-05-23 2004-11-25 International Business Machines Corporation Recoverable return code tracking and notification for autonomic systems
US20110087637A1 (en) * 2009-10-09 2011-04-14 International Business Machines Corporation Method and System for Database Recovery
CN107566392A (en) * 2017-09-22 2018-01-09 北京知道创宇信息技术有限公司 A kind of detection method and proxy server of the type SQL injection that reports an error
CN110427422A (en) * 2019-05-23 2019-11-08 武汉达梦数据库有限公司 Data consistency verification method, equipment and storage medium when data synchronous abnormality
CN110362428A (en) * 2019-06-27 2019-10-22 北京人大金仓信息技术股份有限公司 The on-line automatic method and system for restoring database block

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112148528A (en) * 2020-09-14 2020-12-29 北京同邦卓益科技有限公司 Method and device for realizing automatic fault tolerance

Also Published As

Publication number Publication date
CN111367705B (en) 2023-08-04

Similar Documents

Publication Publication Date Title
CN1993679B (en) Method, operating system, and computing device for processing a computer program
WO2019140656A1 (en) Firmware upgrade method and apparatus, electronic device and control device
CN107025224B (en) Method and equipment for monitoring task operation
CN107179982B (en) Cross-process debugging method and device
CN113157411A (en) Reliable configurable task system and device based on Celery
CN111367705A (en) SQL error reporting processing method and device
CN113886590A (en) Data summarizing method and device, computer equipment and storage medium
US20120142330A1 (en) System and Method For Transactional Application Lifecycle Management For Mobile Devices
CN111475388A (en) Data push test method and device, computer equipment and storage medium
CN113342512B (en) IO task silencing and driving method and device and related equipment
CA2679021C (en) System and method for transactional application lifecycle management for mobile devices
CN111367936B (en) Offline verification method and device for structured query language grammar
CN115934272A (en) Online batch task processing method and device
CN110765144B (en) Distributed heterogeneous database data processing method and device
CN115248827A (en) Distributed transaction submitting method and device
US20040010500A1 (en) Method, apparatus and article of manufacture to aggregate automated transaction procession
CN113220471A (en) Data processing method and device, computing equipment and storage medium
CN110928798A (en) Code testing method, device and equipment
CN114546629B (en) Task execution system, method, server, and computer-readable storage medium
CN111737036A (en) Service processing method and device based on robot process automation
CN110908821A (en) Method, device, equipment and storage medium for task failure management
CN114510337B (en) Task execution method, system and computer readable storage medium
CN110673942A (en) Asynchronous process ending method and device of cloud platform and cloud platform server
CN113204566B (en) Execution method and device of SQL script
CN116756003A (en) Interface testing method and device, storage medium and electronic equipment

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