Database procedural program running state display method and related product

By creating a stack for procedural SQL programs and dynamically updating the subquery fields of the view, the problem of not being able to display nested statements in real time in existing technologies is solved, enabling real-time and accurate display of the running status of procedural programs, and supporting performance analysis and problem localization.

CN121901237APending Publication Date: 2026-04-21CETC JINCANG (BEIJING) TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
CETC JINCANG (BEIJING) TECH CO LTD
Filing Date
2025-12-30
Publication Date
2026-04-21

AI Technical Summary

Technical Problem

The existing real-time status query view cannot display the execution status of nested statements in procedural SQL programs in real time, making it difficult to perform performance analysis and locate problems.

Method used

By creating a stack corresponding to the procedural program, the stack is dynamically updated to record the execution status of nested statements, and the subquery fields are refreshed in real time in the database view to display the currently executing nested statements.

Benefits of technology

It enables real-time visualization of nested statements within procedural programs, ensuring the real-time and accurate display of status, and helping database administrators quickly grasp the execution progress and locate problems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121901237A_ABST
    Figure CN121901237A_ABST
Patent Text Reader

Abstract

The invention relates to a database technology, in particular to a database procedural program running state display method and a related product. The display method comprises the steps of creating a stack corresponding to a procedural program in response to an execution instruction of the procedural program; dynamically updating the stack based on the execution state of the nested statement of the procedural program in the execution process; and according to the updated stack, refreshing a sub-query field in a view of the database so as to display a nested statement which is currently executed in the procedural program. According to the display method, the stack and the view additionally provided with the sub-query fields are utilized, real-time visual display of the currently executed nested statements in the procedural program is achieved, the limitation that a traditional view can only display a top-layer program is broken through, the real-time performance and effectiveness of running state display of the procedural program are guaranteed, and the user experience is improved. And a database administrator can quickly master the execution progress of the procedural program, so that a foundation is laid for subsequent performance analysis and problem positioning.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to database technology, and in particular to a method for displaying the running status of a database procedural program and related products. Background Technology

[0002] Most mainstream databases currently offer real-time status query views to query the real-time status of database processes, effectively helping database administrators (DBAs) analyze the status of running Structured Query Language (SQL) systems.

[0003] However, when executing SQL statements in Procedural Language / SQL (PL / SQL) programs, existing real-time status query views only support displaying top-level SQL statements and cannot query nested statements being executed. Especially when PL / SQL programs have complex business logic or complex call logic, existing views cannot show DBAs in real time whether nested statements are executing correctly, making it difficult to perform further performance analysis and problem localization for PL / SQL programs. Summary of the Invention

[0004] In view of the above problems, a method and related products for displaying the running status of database procedural programs are proposed to overcome or at least partially solve the above problems.

[0005] One objective of this invention is to provide a method for displaying the running status of a database procedural program, so as to display the execution status of nested statements within the procedural program in real time.

[0006] A further objective of this invention is to accurately track currently executing nested statements.

[0007] Another further objective of this invention is to accurately display the complete information of nested statements.

[0008] Specifically, the present invention provides a method for displaying the running status of a database procedural program, comprising: In response to the execution instructions of the procedural program, a stack corresponding to the procedural program is created; The stack is dynamically updated based on the execution status of nested statements in a procedural program. Refresh the subquery fields in the database view based on the updated stack to show the nested statements currently being executed in the procedural process.

[0009] Optionally, the steps for dynamically updating the stack based on the execution state of nested statements in the procedural program include: When nested statements begin execution, statistics for the nested statements are pushed onto the stack. When the nested statement finishes execution, the statistics of the nested statement are popped from the stack so that the top of the stack is used only to record the currently executing nested statement.

[0010] Optionally, the statistics for nested statements include the complete query statement and identifier of the nested statement, and the subquery fields include the first statement field and the first identifier field; and The steps to refresh the subquery fields in the database view based on the updated stack include: Check if the updated stack is empty; If not, retrieve the complete query statement and identifier of the nested statement recorded at the top of the stack; Refresh the first statement field of the view to the complete query statement of the nested statement, and refresh the first identifier field of the view to the identifier of the nested statement.

[0011] Optionally, after determining whether the updated stack is empty, the display method may also include: If the updated stack is empty, clear the contents of the subquery fields in the view.

[0012] Optionally, the view also has a status field for displaying the current state of the procedural procedure; and After refreshing the subquery fields in the database view based on the updated stack, the display method also includes: If the updated stack is not empty, refresh the status field in the view to the first identifier indicating that the procedural is in the execution state; If the updated stack is empty and all nested statements have finished executing, refresh the status field in the view to a second identifier indicating that the procedural is in the finished execution state.

[0013] Optionally, the step of pushing statistics from nested statements onto the stack includes: In the case of multi-level nested statements, the statistics of the nested statements are pushed onto the stack in order from the outermost to the innermost, so that the innermost nested statement is above its outermost nested statement.

[0014] Optionally, the view also has a second statement field and a second identifier field, which are used to display the complete query statement and identifier of the top-level statement during the execution of the procedural program; and Following the steps of responding to the execution instructions of the procedural program, the demonstration method also includes: Refresh the second statement field in the view to the complete query statement of the top-level statement, and refresh the second identifier field in the view to the identifier of the top-level statement.

[0015] According to another aspect of the present invention, a computer program product is also provided, comprising a computer program that, when executed by a processor, implements the steps of the method for displaying the running state of a database procedural program as described above.

[0016] According to another aspect of the present invention, a computer-readable storage medium is also provided, on which a computer program is stored, wherein when the computer program is executed by a processor, the steps of the method for displaying the running state of a database procedural program as described above are implemented.

[0017] According to another aspect of the present invention, a computer device is also provided, which includes a memory, a processor, and a computer program stored in the memory, wherein the processor executes the computer program to implement the steps of the method for displaying the running state of a database procedural program as described above.

[0018] The present invention provides a method for displaying the execution status of a database procedural program. This method creates a corresponding stack for the executing procedural program, dynamically updates the stack based on the execution status of its nested statements, and finally refreshes the database view according to the stack's state, thus achieving real-time display of the execution flow within the procedural program. Therefore, this method utilizes a stack and a view with added subquery fields to achieve real-time visualization of the currently executing nested statements within the procedural program. This overcomes the limitation of traditional views that can only display the top-level program, ensuring the real-time and effective display of the procedural program's execution status. This allows DBAs to quickly grasp the execution progress of the procedural program, laying the foundation for subsequent performance analysis and problem localization.

[0019] Furthermore, the method for displaying the execution status of a database procedural program in this invention pushes the statistical information of a nested statement onto a stack when the statement begins execution, placing it at the top of the stack. When the nested statement finishes execution, its statistical information is popped from the stack, ensuring that the top of the stack is used only to record the currently executing nested statement. Thus, by corresponding the top of the stack to the currently executing nested statement, this method ensures that the stack data structure always dynamically and accurately reflects the latest execution position of the procedural program, providing a reliable and unique real-time data source for subsequent status display, thereby guaranteeing the accuracy and timeliness of the view display.

[0020] Furthermore, the database procedural program execution status display method of the present invention, by explicitly stating that the statistical information of nested statements includes complete query statements and identifiers, and that subquery fields are correspondingly divided into first statement fields and first identifier fields, achieves the separate storage and accurate display of complete statement information and identifier information of nested statements, solving the problems of SQL statement truncation and lack of identifier fields in the prior art, which lead to difficulties in subsequent analysis and problem localization. In addition, the database procedural program execution status display method of the present invention, by determining whether the stack is empty, and only obtaining the complete query statement and identifier of the nested statement recorded at the top of the stack when the updated stack is not empty, and refreshing them to the corresponding fields of the view, ensures the effectiveness and relevance of the view's subquery field display. Therefore, the method of the present invention, through the precise correspondence between fields and statistical information and the seamless storage and display mechanism of stack and view integration, not only achieves a clear presentation of the complete information of nested statements, but also establishes the association between identifier information and statement content, providing data support for subsequent analysis in conjunction with other views or tools, thereby improving the practicality and scalability of procedural program execution status display.

[0021] The above and other objects, advantages and features of the present invention will become more apparent to those skilled in the art from the following detailed description of specific embodiments of the invention in conjunction with the accompanying drawings. Attached Figure Description

[0022] The following sections will describe some specific embodiments of the invention in detail by way of example and not limitation, with reference to the accompanying drawings. The same reference numerals in the drawings denote the same or similar parts or portions. Those skilled in the art should understand that these drawings are not necessarily drawn to scale. In the drawings: Figure 1 This is a schematic diagram of a method for displaying the running status of a database procedural program according to an embodiment of the present invention; Figure 2 This is a schematic diagram of the stack structure in a method for displaying the running state of a database procedural program according to an embodiment of the present invention; Figure 3 This is a schematic diagram of the SQL execution sequence of a procedural program in a method for displaying the running status of a database procedural program according to an embodiment of the present invention; Figure 4 This is a schematic diagram of the view at the start of SQL2 execution in a method for displaying the running status of a database procedural program according to an embodiment of the present invention; Figure 5 This is a schematic diagram of the view at the start of SQL3 execution in a method for displaying the running status of a database procedural program according to an embodiment of the present invention. Figure 6This is a schematic diagram of a view in the SQL5 execution completion stage of a method for displaying the running status of a database procedural program according to an embodiment of the present invention. Figure 7 This is a control flowchart of a method for displaying the running status of a database procedural program according to an embodiment of the present invention; Figure 8 This is a schematic diagram of a computer program product according to an embodiment of the present invention; Figure 9 This is a schematic diagram of a computer-readable storage medium according to an embodiment of the present invention; Figure 10 This is a schematic block diagram of a computer device according to an embodiment of the present invention. Detailed Implementation

[0023] Exemplary embodiments of the invention will now be described in more detail with reference to the accompanying drawings. While exemplary embodiments of the invention are shown in the drawings, it should be understood that the invention may be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the invention to those skilled in the art.

[0024] To address the aforementioned issues, this invention proposes a method for displaying the running status of a database procedural program. Figure 1 This is a schematic diagram illustrating a method for displaying the running status of a database procedural program according to an embodiment of the present invention. Figure 1 As shown, the method for displaying the running status of a database procedural program in this embodiment generally includes: Step S102: In response to the execution instructions of the procedural program, a stack corresponding to the procedural program is created. It should be noted that in this embodiment, the procedural program refers to a PL / SQL program or a PL / PGSQL program. The execution instructions of the procedural program can be the execution instructions of the TOP SQL statement (hereinafter referred to as the top-level statement) that calls the PL / SQL program or PL / PGSQL program. Furthermore, the stack is a stack data structure in computer programming that uses a last-in-first-out (LIFO) storage method. In this embodiment, the stack is used to record statistical information of nested SQL statements (hereinafter referred to as nested statements) during the execution of the procedural program in a LIFO storage method.

[0025] Step S104: Dynamically update the stack based on the execution status of nested statements within the procedural program during execution. It should be noted that nested statements within the procedural program can include multiple sub-SQL statements, and nested statements are only validly displayed while the TOP SQL statement is executing. Furthermore, during the execution of the procedural program, in response to the execution events of its internal nested statements, the stack stores the statistical information of each sub-SQL statement sequentially in a last-in-first-out (LIFO) manner to achieve dynamic updates to the stack.

[0026] Step S106: Refresh the subquery fields in the database view based on the updated stack to display the nested statements currently being executed in the procedural program. It should be noted that the view in this embodiment refers to the database's `sys_stat_activity` view, used to query the real-time status provided by the database system. Specifically, in this embodiment, the view adds subquery fields compared to traditional real-time status query views. These subquery fields can be refreshed in real-time as operations are performed. Specifically, after each stack update, the subquery fields in the view are immediately refreshed based on the updated stack to display the nested statements currently being executed in the procedural program in real time.

[0027] It should be noted that each row of information displayed in the sys_stat_activity view originates from a PgBackendStatus structure maintained in shared memory by each database process (including foreground and background auxiliary processes). The PgBackendStatus structure is used to record process activity. Additionally, subquery fields added to the view can also be recorded in the PgBackendStatus structure.

[0028] The present invention provides a method for displaying the running status of a database procedural program. This method creates a corresponding stack for the executing procedural program, dynamically updates the stack based on the execution status of its nested statements, and finally refreshes the database view based on the stack status, thereby achieving real-time display of the execution flow within the procedural program.

[0029] Therefore, the database procedural program execution status display method of the present invention utilizes a stack and a view with added subquery fields to achieve real-time visualization of the nested statements currently being executed in the procedural program. This breaks through the limitation of traditional views that can only display the top-level program, ensuring the real-time and effective display of the procedural program execution status. This enables DBAs to quickly grasp the execution progress of the procedural program, thus laying the foundation for subsequent performance analysis and problem localization.

[0030] Figure 2 This is a schematic diagram of the stack structure in a method for displaying the running state of a database procedural program according to an embodiment of the present invention. Figure 2 As shown, the stack 1 in step S102 above has a stack bottom 2 and a stack top 3. Specifically, stack 1 includes multiple storage locations arranged sequentially from bottom to top, such as storage location A, storage location B, storage location C, and storage location Z. These multiple storage locations are used to record the statistical information of each sub-SQL statement during the execution of the procedural program in a first-in, last-out (LIFO) storage manner.

[0031] In this embodiment, step S104 may include the following steps: when the nested statement begins execution, push the statistics of the nested statement onto stack 1; when the nested statement finishes execution, pop the statistics of the nested statement from stack 1, so that the top 3 of stack 1 is used only to record the currently executing nested statement. That is, each time a sub-SQL statement is executed, its statistics are pushed onto the stack so that it is located at the top 3 of stack 1, and each time the sub-SQL statement finishes execution, its statistics are popped from the stack, ensuring that regardless of which level of sub-SQL statement is executed, the top 3 of stack 1 is used to store the statistics of the current sub-SQL statement.

[0032] Therefore, the database procedural program execution status display method of the present invention ensures that the stack 1 data structure always dynamically and accurately reflects the latest execution position of the procedural program by corresponding the top 3 of stack 1 to the currently executing nested statement, thus providing a reliable and unique real-time data source for subsequent status display and guaranteeing the accuracy and timeliness of the view display.

[0033] Figure 3 This is a schematic diagram of the SQL execution sequence of a procedural program in a method for displaying the running state of a database procedural program according to an embodiment of the present invention. Figure 3 As shown, in some embodiments, the procedural program may contain multi-level nested statements during execution, which may include multiple sub-SQL statements with hierarchical calling relationships. Accordingly, multiple storage location stacks 1 are used to sequentially record the statistical information of each sub-SQL statement in a last-in-first-out (LIFO) storage manner.

[0034] Accordingly, the step of pushing the statistics of nested statements onto stack 1 may include the following steps: in the case of multiple nested statements, the statistics of multiple nested statements are pushed onto stack 1 in order from the outermost to the innermost, so that the innermost nested statement is above its outermost nested statement.

[0035] Specifically, when the outer nested statement begins execution, its statistics are pushed onto the stack, placing it at the top (3) of stack 1. If the outer nested statement has an inner nested statement that needs to be executed first, then the statistics of the inner nested statement are pushed onto the stack, placing it above the statistics of the outer nested statement and at the top (3) of stack 1. When the inner nested statement finishes execution, its statistics are popped from the stack, and the outer nested statement finishes execution as well. Thus, stack 1 uses a last-in, first-out (LIFO) storage method, ensuring that the top (3) of the stack is used only to record the currently executing nested statement.

[0036] For example, when starting to execute the first-level sub-SQL statement, the statistics of the first-level sub-SQL statement are pushed onto stack 1; it is determined whether there is a second-level sub-SQL statement inside the first-level sub-SQL statement; if not, the first-level sub-SQL statement is executed, and after the execution of the first-level sub-SQL statement is completed, the statistics of the first-level sub-SQL statement are popped from stack 1; if there is, the second-level sub-SQL statement is pushed onto stack 1, and multiple second-level sub-SQL statements are executed; after the execution of the second-level sub-SQL statements is completed, the statistics of the second-level sub-SQL statements are popped from stack 1, and the process returns to the step of executing the first-level sub-SQL statement.

[0037] Therefore, the database procedural program execution status display method of the present invention, by pushing statistical information onto stack 1 in the order from the outermost layer to the innermost layer when there are multi-level nested statements, clarifies the stack pushing rules of stack 1 in multi-level nested scenarios, ensuring that the statistical information of the inner nested statements is always at the top of stack 3, so as to use the first-in-last-out characteristic of stack 1 to record the complete call hierarchy relationship, ensuring the traceability of the execution path of complex nested logic, and providing a guarantee for the view to accurately display the statement currently being executed in the innermost layer.

[0038] In some embodiments, the statistics of nested statements may include the complete query statement (which may be denoted as query statement) and identifier (which may be denoted as queryid) of the nested statement. Accordingly, the subquery field includes a first statement field (which may be denoted as sub_query field) and a first identifier field (which may be denoted as sub_queryid field). In this embodiment, the above step S106 may include the following steps: refreshing the sub_query field and sub_queryid field in the database view based on the data recorded in the top 3 of the updated stack 1.

[0039] Specifically, step S106 can be executed as follows: determine whether the updated stack 1 is empty; if not, obtain the query statement and queryid of the nested statement recorded in the top 3 of stack 1; refresh the sub_query field of the view to the query statement of the nested statement, and refresh the sub_queryid field of the view to the queryid of the nested statement.

[0040] In other words, the database procedural program execution status display method of the present invention, by explicitly stating that the statistical information of nested statements includes query statements and queryids, and that the subquery fields are correspondingly divided into sub_query fields and sub_queryid fields, realizes the separate storage and accurate display of complete statement information and identification information of nested statements, and solves the problem of SQL statement truncation and lack of identification fields in the prior art, which leads to difficulties in subsequent analysis and problem location.

[0041] In addition, the method for displaying the running status of a database procedural program in this invention determines whether stack 1 is empty, and only obtains the query statement and queryid of the nested statement recorded at the top 3 of the stack if the updated stack 1 is not empty, and refreshes them to the corresponding fields of the view, thereby ensuring the effectiveness and relevance of the display of subquery fields in the view.

[0042] Therefore, the method of the present invention, through the precise correspondence between fields and statistical information and the storage and display mechanism that seamlessly connects stack 1 and view, not only achieves a clear presentation of the complete information of nested statements, but also establishes the association between identification information and statement content, providing data support for subsequent linkage analysis with other views or tools, thereby improving the practicality and scalability of the procedural program running status display.

[0043] In some embodiments, after the step of determining whether the updated stack 1 is empty, the method for displaying the running status of a database procedural program according to the present invention may further include the following step: if the updated stack 1 is empty, clear the content of the subquery field in the view. That is, after the nested statement finishes execution, stack 1 has no data, and at this time the content of the subquery field in the view is cleared accordingly.

[0044] Therefore, the database procedural program execution status display method of the present invention improves the dynamic update logic of view fields by clearing the content of view subquery fields when stack 1 is empty, and avoids the situation where the view still retains invalid nested statement information when stack 1 is empty. This helps DBAs to quickly determine whether the procedural program is in the nested statement execution stage through the view's subquery fields.

[0045] In some embodiments, the view further has a state field (which may be denoted as the state field) for displaying the current state of the procedural program. Accordingly, after step S106 above, the method for displaying the running state of a database procedural program of the present invention may further include the following steps: if the updated stack 1 is not empty, refresh the state field in the view to a first identifier (which may be denoted as active) indicating that the procedural program is in an execution state; if the updated stack 1 is empty and all nested statements have finished executing, refresh the state field in the view to a second identifier (which may be denoted as idle) indicating that the procedural program is in an execution completed state.

[0046] Therefore, for TOP SQL, the current state of the connection can be determined through the `state` field. When the `state` field is "active", it indicates that there is an SQL statement being executed on the connection, and the currently executing SQL statement can be obtained through the `query` field; while when the `state` field is "idle", it indicates that the connection is in an idle state, and the last executed statement can be obtained through the `query` field.

[0047] The method for displaying the running status of a database procedural program in this invention accurately defines the running stage of the procedural program by refreshing the state field in the view based on whether stack 1 is empty and whether all nested statements have finished executing. This provides an intuitive display of the overall status of the procedural program and helps DBAs quickly locate the direct cause of excessively long execution time of the procedural program.

[0048] In some embodiments, the view further includes a second statement field (which may be referred to as the query field) and a second identifier field (which may be referred to as the queryid field) for displaying the query statement and queryid of the top-level statement during the execution of the procedural program. Accordingly, after the step of responding to the execution instruction of the procedural program in step S102 above, the method for displaying the running status of the database procedural program of the present invention may further include the following steps: refreshing the query field in the view to the query statement of the top-level statement, and refreshing the queryid field in the view to the queryid of the top-level statement.

[0049] Therefore, the method for displaying the running status of a database procedural program in this invention, by setting query and queryid fields in the view specifically for displaying the query statement and queryid of the top-level statement of the procedural program, ensures the complete display of the top-level statement information, improves the information display dimensions of the view, and provides data support for subsequent linkage analysis with other views or tools, thereby further enhancing the practicality and scalability of the procedural program running status display.

[0050] In one specific embodiment, such as Figure 3 As shown, the SQL execution sequence of a procedural program can include: SQL1 as TOPSQL, SQL2 and SQL5 which belong to the first level LEVEL1, and SQL3 and SQL4 which are located inside SQL2 (i.e., in the second level LEVEL2).

[0051] Figure 4 This is a schematic diagram of the view at the start of SQL2 execution in a method for displaying the running status of a database procedural program according to an embodiment of the present invention. Figure 5 This is a schematic diagram of the view at the start of SQL3 execution in a method for displaying the running status of a database procedural program according to an embodiment of the present invention. Figure 6 This is a schematic diagram of a view in the SQL5 execution completion stage of a method for displaying the running status of a database procedural program according to an embodiment of the present invention. The following is in conjunction with... Figures 3-6 ,by Figure 3 Taking the SQL execution sequence of the procedural program shown as an example, the process of displaying the running status of the database procedural program of the present invention will be explained.

[0052] (1) Initial state: Execute TOP SQL. At this time, stack 1 is empty, and the sub_query field and sub_queryid field in the view are 0.

[0053] (2) Start executing SQL2. Since SQL2 contains sub-SQL, the execution of the sub-SQL must be completed before SQL2 can continue. At this time, push the query statement and queryid of SQL2 onto stack 1, as follows. Figure 4 As shown, the sub_query and sub_queryid fields in the view are refreshed to SQL2 statistics.

[0054] (3) Start executing SQL3, pushing the SQL3 query statement and queryid onto stack 1, such as... Figure 5 As shown, the sub_query and sub_queryid fields in the view are refreshed to SQL3 statistics.

[0055] (4) After SQL3 is executed, stack 1 pops out the statistics of SQL3 and returns to SQL2 execution.

[0056] (5) Start executing SQL4, push the SQL4 query statement and queryid onto stack 1, and refresh the sub_query and sub_queryid fields in the view to the SQL4 statistics.

[0057] (6) After SQL4 is executed, the statistics of SQL4 are popped from stack 1, and SQL2 is returned to be executed until it ends. At this time, there is no data in stack 1, and the sub_query and sub_queryid fields in the view are empty.

[0058] (7) Start executing SQL5. Since SQL5 has no sub-SQL, push the SQL5 query statement and queryid onto stack 1 and execute it directly.

[0059] (8) After SQL5 is executed, there is no data in stack 1, and the sub_query and sub_queryid fields in the view are empty.

[0060] (9) Continue executing other SQL statements, such as Figure 6 As shown, the sub_query and sub_queryid fields in the view are empty.

[0061] Using the above method, real-time visualization of nested statements currently being executed in a procedural program is achieved, breaking through the limitation of traditional views that can only display the top-level program. This ensures the real-time and effective display of the procedural program's running status, enabling DBAs to quickly grasp the execution progress of the procedural program, thus laying the foundation for subsequent performance analysis and problem localization.

[0062] Figure 7 This is a control flow diagram of a method for displaying the running status of a database procedural program according to an embodiment of the present invention. The following is in conjunction with... Figure 7 Taking a PL / SQL program as an example, the process steps of this embodiment will be explained in detail.

[0063] In step S702, in response to the execution instructions of the PL / SQL program, stack 1 corresponding to the PL / SQL program is created.

[0064] Step S704: Refresh the query field in the view to the query statement of the top-level statement, and refresh the queryid field in the view to the queryid of the top-level statement.

[0065] Step S706: When the nested statement begins execution, the statistics of the nested statement are pushed onto stack 1. Specifically, in the case of multiple levels of nested statements, the statistics of the multiple levels of nested statements are pushed onto stack 1 in order from the outermost to the innermost, so that the innermost nested statement is above its outermost nested statement.

[0066] Step S708: Refresh the sub_query and sub_queryid fields in the database view based on the data recorded in the top 3 of the updated stack 1.

[0067] Step S710: Refresh the state field in the view to active.

[0068] Step S712: When the nested statement finishes execution, pop the statistics of the nested statement from stack 1.

[0069] Step S714: Refresh the sub_query and sub_queryid fields in the database view based on the data recorded in the top 3 of the updated stack 1.

[0070] Step S716: With the updated stack 1 empty and all nested statements having finished executing, refresh the `state` field in the view to `idle`. This completes the process of displaying the PL / SQL program's running status, and this workflow ends.

[0071] Therefore, the database procedural program execution status display method of the present invention utilizes stack 1 and a view with added subquery fields to achieve real-time visualization of the nested statements currently being executed in the procedural program. This breaks through the limitation of traditional views that can only display the top-level program, ensuring the real-time and effective display of the procedural program execution status, enabling DBAs to quickly grasp the execution progress of the procedural program, thus laying the foundation for subsequent performance analysis and problem localization.

[0072] Furthermore, the method for displaying the running status of a database procedural program in this invention ensures that the stack 1 data structure always dynamically and accurately reflects the latest execution position of the procedural program by corresponding the top 3 of stack 1 to the currently executing nested statement. This provides a reliable and unique real-time data source for subsequent status display, thereby guaranteeing the accuracy and timeliness of the view display.

[0073] Furthermore, the method of the present invention, through the precise correspondence between fields and statistical information and the storage and display mechanism that seamlessly connects stack 1 with the view, not only achieves a clear presentation of the complete information of nested statements, but also establishes the association between identification information and statement content, providing data support for subsequent linkage analysis with other views or tools, thereby improving the practicality and scalability of the procedural program running status display.

[0074] This embodiment also provides a computer program product 10, a computer-readable storage medium 20, and a computer device 30. Figure 8 This is a schematic diagram of a computer program product 10 according to an embodiment of the present invention. Figure 9 This is a schematic diagram of a computer-readable storage medium 20 according to an embodiment of the present invention. Figure 10 This is a schematic block diagram of a computer device 30 according to an embodiment of the present invention.

[0075] Computer program product 10 includes computer program 11, which, when executed by processor 32, implements the steps of the method for displaying the running state of a database procedural program as described above. Computer-readable storage medium 20 stores the computer program 11 thereon, which, when executed by processor 32, implements the steps of the method for displaying the running state of a database procedural program as described above. Computer device 30 may include memory 31, processor 32, and computer program 11 stored on memory 31 and running on processor 32.

[0076] The computer program 11 used to perform the operations of the present invention may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-related instructions, microcode, firmware instructions, status setting data, integrated circuit configuration data, or source code or object code written in any combination of one or more programming languages ​​and procedural programming languages.

[0077] Computer program 11 may execute entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the latter case, the remote computer may be connected to the user's computer via any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider). In some embodiments, to perform aspects of the invention, electronic circuitry including, for example, programmable logic circuitry, a Field-Programmable Gate Array (FPGA), or a Programmable Logic Array (PLA) may execute computer-readable program instructions to personalize the electronic circuitry by utilizing state information of the computer-readable program instructions.

[0078] For the purposes of this embodiment, computer program product 10 is a related product that includes computer program 11.

[0079] For the purposes of this embodiment, computer-readable storage medium 20 is a tangible device capable of holding and storing computer program 11. It can be any device capable of containing, storing, communicating, propagating, or transmitting program 811 for use by or in conjunction with an instruction execution system, apparatus, or device. More specific examples (a non-exhaustive list) of computer-readable storage medium 20 include: portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), static random access memory (SRAM), portable optical disc read-only memory (CD-ROM), digital versatile disc (DVD), memory stick, floppy disk, mechanical encoding device, and any suitable combination thereof.

[0080] Therefore, those skilled in the art should recognize that although numerous exemplary embodiments of the present invention have been shown and described in detail herein, many other variations or modifications conforming to the principles of the present invention can be directly determined or derived from the disclosure of the present invention without departing from the spirit and scope of the invention. Thus, the scope of the present invention should be understood and construed as covering all such other variations or modifications.

Claims

1. A method for displaying the running status of a database procedural program, comprising: In response to the execution instructions of the procedural program, a stack corresponding to the procedural program is created; The stack is dynamically updated based on the execution status of nested statements in the procedural program during execution. The subquery fields in the database view are refreshed based on the updated stack to display the nested statements currently being executed in the procedural procedure.

2. The method for displaying the running status of a database procedural program according to claim 1, wherein, The step of dynamically updating the stack based on the execution state of nested statements during the execution of the procedural program includes: When the nested statement begins execution, the statistics of the nested statement are pushed onto the stack; When the nested statement finishes execution, the statistics of the nested statement are popped from the stack so that the top of the stack is used only to record the currently executing nested statement.

3. The method for displaying the running status of a database procedural program according to claim 2, wherein, The statistical information of the nested statement includes the complete query statement and identifier of the nested statement, and the subquery field includes the first statement field and the first identifier field; and The step of refreshing the subquery fields in the database view based on the updated stack includes: Determine if the updated stack is empty; If not, then obtain the complete query statement and identifier of the nested statement recorded at the top of the stack; Refresh the first statement field of the view to the complete query statement of the nested statement, and refresh the first identifier field of the view to the identifier of the nested statement.

4. The method for displaying the running status of a database procedural program according to claim 3, wherein, After the step of determining whether the updated stack is empty, the display method further includes: If the updated stack is empty, clear the contents of the subquery fields in the view.

5. The method for displaying the running status of a database procedural program according to claim 4, wherein, The view also has a status field for displaying the current status of the procedural program; and After the step of refreshing the subquery fields in the view of the database according to the updated stack, the display method further includes: If the updated stack is not empty, refresh the status field in the view to a first identifier indicating that the procedural program is in the execution state; If the updated stack is empty and all nested statements have finished executing, the status field in the view is refreshed to a second identifier indicating that the procedural program is in the execution completed state.

6. The method for displaying the running status of a database procedural program according to claim 2, wherein, The step of pushing the statistics of the nested statements onto the stack includes: In the case of multiple nested statements, the statistics of the multiple nested statements are pushed onto the stack in order from the outermost to the innermost, so that the innermost nested statement is above its outermost nested statement.

7. The method for displaying the running status of a database procedural program according to claim 1, wherein, The view also has a second statement field and a second identifier field, which are used to display the complete query statement and identifier of the top-level statement of the procedural program during execution. and Following the step of responding to the execution instructions of the procedural program, the demonstration method further includes: Refresh the second statement field in the view to the complete query statement of the top-level statement, and refresh the second identifier field in the view to the identifier of the top-level statement.

8. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method for displaying the running status of a database procedural program as described in any one of claims 1 to 7.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that... When the computer program is executed by the processor, it implements the steps of the method for displaying the running status of a database procedural program as described in any one of claims 1 to 7.

10. A computer device, comprising a memory, a processor, and a computer program stored in the memory, characterized in that, The processor executes the computer program to implement the steps of the method for displaying the running status of a database procedural program as described in any one of claims 1 to 7.