Execution method and device of database procedural program, medium and product
By obtaining and saving the execution information of operation statements in real time during the execution of PL/SQL program, the problem of time-consuming fault location of PL/SQL program is solved, and rapid fault location and cause analysis are achieved.
Patent Information
- Application Number
- CN202510428959.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-07
- Publication Date
- 2025-08-01
AI Technical Summary
In the prior art, fault location during the execution of PL/SQL programs is time-consuming and difficult to reproduce, resulting in difficulty in finding fault locations.
By establishing communication between the tracking tool and the procedural program executor, the probe function is called at the beginning and end of each operation statement to obtain execution information, and the tracking data is constructed and saved, including the object identification and line number of the operation statement.
It realizes rapid positioning of fault locations during PL/SQL execution, and provides execution sequence analysis of fault causes, improving the efficiency of fault location and analysis.
Smart Images

Figure CN120407248A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of databases, and in particular, to a method, device, medium, and product for executing a database procedural program. Background Art
[0002] Structured Query Language (SQL) is the standard language for databases, and Procedural Language / SQL (PL / SQL) is an extension of the SQL language. Based on the SQL language, PL / SQL supports more complex database operations and services by adding constructs such as variables, conditional statements, and loops. Therefore, a PL / SQL program, that is, a procedural program, is usually very complex.
[0003] Currently, when a PL / SQL program fails during execution, the staff can only find the fault location by re-single-stepping the program. However, due to the complexity of the PL / SQL program, the existing method of finding the fault location is time-consuming, and there may also be a situation where the fault cannot be reproduced, so that the fault location cannot be found. Summary of the Invention
[0004] An object of the present invention is to provide a method, device, medium, and product for executing a database procedural program that can solve any of the above problems.
[0005] In particular, the present invention provides a method for executing a database procedural program, including:
[0006] Establishing communication with a procedural program executor;
[0007] During the execution of each operation statement by the executor, a start probe function and an end probe function are called respectively when the operation statement starts execution and ends execution;
[0008] Obtaining execution information of the executor by using the start probe function and the end probe function, where the execution information at least includes the object identifier of the subprogram to which the executed operation statement belongs and the statement line number;
[0009] Constructing tracking data of the operation statement, where the tracking data includes the execution information;
[0010] Saving the tracking data.
[0011] Optionally, the step of saving the tracking data includes:
[0012] Saving the tracking data to a preset shared memory.
[0013] Optionally, the step of saving the trace data further includes:
[0014] Detecting that the amount of data in the preset shared memory reaches a preset threshold;
[0015] Transferring the data in the preset shared memory to a pre-built database table.
[0016] Optionally, the database is configured with multiple storage methods and a scheme selection interface;
[0017] After the step of establishing communication with the procedural program executor, it includes:
[0018] Obtaining the selected storage method;
[0019] The step of saving the trace data includes:
[0020] Storing the trace data according to the selected storage method.
[0021] Optionally, the execution information further includes the type of the subroutine to which the operation statement belongs, the type of the statement, the current call stack depth, the atomicity of the currently executed transaction, and whether the subroutine to which it belongs is an autonomous transaction subroutine.
[0022] Optionally, the trace data further includes an execution sequence number, the process identifier to which the operation statement belongs, the start time and end time of the operation statement, and the source code of the operation statement, and the execution sequence number is configured for the trace data by an incrementing global variable.
[0023] Optionally, after the step of establishing communication with the procedural program executor, it includes:
[0024] Detecting whether a preset global trace status is in an enabled state, and if so, performing the step of obtaining the execution information of the executor;
[0025] The global trace status is stored in the shared memory, so as to be visible to all processes, so that all processes can modify the global trace status.
[0026] According to another aspect of the present invention, there is also provided a computer device, including a memory, a processor, and a computer executable program stored on the memory and running on the processor, and when the processor executes the computer executable program, it implements the execution method of the database procedural program according to any one of the above.
[0027] According to another aspect of the present invention, there is also provided a computer-readable storage medium, on which a computer-executable program is stored, and when the computer-executable program is executed by a processor, the execution method of the database procedural program according to any one of the above is implemented.
[0028] According to another aspect of the present invention, there is also provided a computer program product, including a computer-executable program, and when the computer-executable program is executed by a processor, the execution method of the database procedural program according to any one of the above is implemented.
[0029] The execution method of the database procedural program of the present invention establishes communication between a tracking tool and a procedural program executor. During the execution of each operation statement by the executor, the start probe function and the end probe function are respectively called when the operation statement starts execution and ends execution. The execution information of the executor is obtained by using the start probe function and the end probe function. The execution information at least includes the object identifier of the subprogram to which the executed operation statement belongs and the statement line number. The tracking data of the operation statement is constructed. The tracking data includes the execution information, and the tracking data is saved. Because the execution information of the operation statement being executed by the executor can be obtained in real time by using the probe function, when a failure occurs during the execution of PL / SQL, the location where the failure occurs can be determined according to the last recorded tracking statement. And because the tracking data is saved, the execution order of the operation statements can be obtained according to browsing the saved tracking data, so as to facilitate analyzing the specific reason for the generation of the failure according to the execution order. Therefore, it not only helps to quickly locate the location where the failure occurs, but also can provide the PL / SQL execution order to help analyze the reason for the generation of the failure, thus making the failure location and analysis of PL / SQL more convenient.
[0030] From the following detailed description of specific embodiments of the present invention in conjunction with the accompanying drawings, those skilled in the art will become more clear about the above and other objects, advantages and features of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] Some specific embodiments of the present invention will be described in detail hereinafter with reference to the accompanying drawings in an exemplary and non-limiting manner. The same reference numerals in the drawings denote the same or similar components or parts. Those skilled in the art should understand that these drawings are not necessarily drawn to scale. In the drawings:
[0032] Figure 1 is a schematic flowchart of an execution method of a database procedural program according to an embodiment of the present invention;
[0033] Figure 2 is a schematic flowchart of an execution method of a database procedural program according to another embodiment of the present invention;
[0034] Figure 3It is a schematic flowchart of an execution method of a database procedural program according to another embodiment of the present invention;
[0035] Figure 4 It is a schematic flowchart of an execution method of a database procedural program according to another embodiment of the present invention;
[0036] Figure 5 It is a schematic flowchart of an execution method of a database procedural program according to another embodiment of the present invention;
[0037] Figure 6 It is a schematic diagram of a computer device according to an embodiment of the present invention;
[0038] Figure 7 It is a schematic diagram of a computer-readable storage medium according to an embodiment of the present invention;
[0039] Figure 8 It is a schematic diagram of a computer program product according to an embodiment of the present invention. Detailed implementation manners
[0040] Those skilled in the art should understand that the embodiments described below are only a part of the embodiments of the present invention, rather than all the embodiments of the present invention. This part of the embodiments is intended to explain the technical principle of the present invention, rather than to limit the protection scope of the present invention. Based on the embodiments provided by the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts should still fall within the protection scope of the present invention.
[0041] It should be noted that the logic and / or steps represented in the flowchart or described in other ways herein, for example, can be considered as a definite sequence list of executable instructions for implementing logical functions, and can be specifically implemented in any computer-readable medium for use by an instruction execution system, apparatus, or device (such as a computer-based system, a system including a processor, or other systems that can fetch instructions from the instruction execution system, apparatus, or device and execute the instructions), or in combination with these instruction execution systems, apparatuses, or devices.
[0042] The flowchart provided by the present invention is not intended to indicate that the operations of the method will be executed in any specific order, or that all the operations of the method are included in every case. In addition, the method may include additional operations. Within the scope of the technical concept provided by the method of this embodiment, additional changes can be made to the above method.
[0043] As Figure 1 shown, in one embodiment, the execution method of the database procedural program generally includes:
[0044] Step S101, establish communication with the procedural program executor. Specifically, it is to establish communication between the tracing tool and the PL / SQL executor.
[0045] Step S102, during the execution of each operation statement by the executor, the start probe function and the end probe function are called respectively when the operation statement starts and ends. Specifically, each PL / SQL program includes one or more subroutines, and each subroutine includes one or more operation statements. For each subroutine, the PL / SQL executor can parse out the specific operation statements and execute them on the database server side. A complete operation statement has a "BEGIN" part indicating the start and an "END" part indicating the end, as well as the part in the middle for executing specific operations. That is, when it is detected that the operation statement starts, the start probe function is called, and when it is detected that the operation statement ends, the end probe function is called.
[0046] Step S103, use the start probe function and the end probe function to obtain the execution information of the executor. The execution information includes at least the object identifier of the subroutine to which the executed operation statement belongs and the statement line number. Specifically, by calling different probe functions respectively when the operation statement starts and ends, the complete execution process of the operation statement by the executor can be traced using the probe functions, so as to obtain the execution information of the executor in real time.
[0047] The object identifier of the subroutine to which the operation statement belongs is the OID (Object Identifier) of the subroutine, and each subroutine is configured with a unique OID. The statement line number indicates which line of the operation statement the executor is currently executing.
[0048] Step S104, construct the tracing data of the operation statement. The tracing data includes the execution information. Specifically, for each operation statement, corresponding tracing data is constructed, and the execution information constitutes a part of the tracing data. At the same time, it includes structuring the information to meet the storage requirements, such as constructing data in the form of key-value pairs.
[0049] Step S105, save the tracing data. Specifically, save the tracing data.
[0050] In the solution of this embodiment, by establishing communication between the tracking tool and the procedural program executor, during the execution of each operation statement by the executor, the start probe function and the end probe function are called respectively when the operation statement starts and ends execution. The execution information of the executor is obtained by using the start probe function and the end probe function. The execution information at least includes the object identifier of the subprogram to which the executed operation statement belongs and the statement line number. The tracking data of the operation statement is constructed. The tracking data includes the execution information, and the tracking data is saved. Because the execution information of the operation statement being executed by the executor can be obtained in real time by using the probe function, when a failure occurs during the execution of PL / SQL, the location where the failure occurs can be determined according to the last recorded tracking statement. And because the tracking data is saved, the execution order of the operation statements can be obtained by browsing the saved tracking data, so as to facilitate analyzing the specific reasons for the failure according to the execution order. Therefore, it not only helps to quickly locate the location where the failure occurs, but also can provide the PL / SQL execution order to help analyze the reasons for the failure, thus making the failure location and analysis of PL / SQL more convenient.
[0051] In addition, by calling the start probe function and the end probe function respectively when the operation statement starts and ends execution, the execution cycle of the operation statement can be accurately identified, and the independence of each piece of tracking data can be better determined.
[0052] It should be noted that in some other embodiments, the execution information further includes the type of the subprogram to which the operation statement belongs, the statement type, the current call stack depth, the atomicity of the current execution transaction, and whether the subprogram is an autonomous transaction subprogram. That is, the above information can also be obtained from the executor. The subprogram type refers to whether the subprogram is a procedure or a function. The statement type refers to what operation the statement implements, such as a data operation statement, a flow control statement, or a transaction control statement, etc. The current call stack depth, that is, the number of times the current subprogram is called. Specifically, for example, if a function is called repeatedly in a loop, the current execution time will be recorded. The atomicity of the current execution transaction, that is, the commit or rollback status of the currently executed subprogram. An autonomous transaction subprogram is a subprogram that can be independently committed or rolled back without affecting the state of the main program.
[0053] In addition, in some other embodiments, the trace data further includes an execution sequence number, the process identifier to which the operation statement belongs, the start time and end time of the operation statement, and the source code of the operation statement. Among them, the execution sequence number is configured for the trace data by an incrementing global variable. For example, for each additional piece of trace data, the value of the global variable is incremented by 1. The process identifier is a unique identifier assigned by the operating system to each process, that is, the PID (Process Identifier) of the process, which is obtained by directly retrieving the PID of the currently running process recorded in the database. The start time and end time of the operation statement are obtained by acquiring the system time at the start and end of the operation statement. For the source code of the execution statement, the system cache is searched according to the subprogram OID, and the corresponding statement source code is obtained based on the retrieved cache content and the statement line number.
[0054] By obtaining execution information such as the type of the subprogram to which the operation statement belongs, the type of the statement, the current call stack depth, the atomicity of the currently executing transaction, and whether the subprogram is an autonomous transaction subprogram, as well as obtaining the execution sequence number, the process identifier to which the operation statement belongs, the start time and end time of the operation statement, and the source code of the operation statement, and recording them into the trace data, the trace data becomes more abundant, which helps to better analyze the cause of the fault.
[0055] As Figure 2 shown, in one embodiment, the step of saving the trace data includes saving the trace data to a preset shared memory. Specifically, the execution method of the database procedural program generally includes:
[0056] Step S201, establish communication with the procedural program executor.
[0057] Step S202, during the execution of each operation statement by the executor, the start probe function and the end probe function are respectively called when the operation statement starts and ends.
[0058] Step S203, use the start probe function and the end probe function to obtain the execution information of the executor.
[0059] Step S204, construct the trace data of the operation statement, and the trace data includes the execution information.
[0060] Step S205, save the trace data to the preset shared memory. Specifically, it means using the shared memory to store the trace data.
[0061] Storing data in the shared memory is convenient and efficient, enabling multi-session sharing and real-time viewing. Moreover, during transaction operations or when the program encounters an exception, it does not affect the already stored data, and even corresponding exception information can be stored.
[0062] Continue to refer toFigure 2 As shown, the steps of saving tracking data further include:
[0063] Step S206, detecting that the amount of data in the preset shared memory reaches the preset threshold.
[0064] Step S207, transferring the data in the preset shared memory to a pre-constructed database table. Specifically, it is to create the required table in the database, and then after obtaining the tracking data, store the tracking data through the logic of SQL statements (INSERT, UPDATE) internally to achieve persistent storage of data and support a large amount of data.
[0065] Specifically, it is to first store the tracking data in the shared memory, and when it reaches the preset threshold set in advance, then transfer the content in the shared memory to the database table to achieve persistent storage. The preset threshold can be flexibly set according to actual needs. In this way, while ensuring relatively efficient data storage, the data can be persistently stored, taking into account performance, data volume, and data persistence, and can flexibly adapt to a variety of application scenarios.
[0066] As Figure 3 shown, in one embodiment, the database is configured with multiple storage methods and a scheme selection interface. After the step of establishing communication with the procedural program executor, it includes obtaining the selected storage method, and the steps of saving tracking data include storing the tracking data according to the selected storage method.
[0067] Specifically, the execution method of the database procedural program generally includes:
[0068] Step S301, establishing communication with the procedural program executor.
[0069] Step S302, obtaining the selected storage method. Specifically, the storage methods can include storing in the shared memory, storing in the database table, storing in the local file, or storing in the shared memory first and then transferring to the database table or local file after reaching the preset threshold, at least two of them.
[0070] Step S303, during the execution of each operation statement by the executor, the start probe function and the end probe function are called respectively when the operation statement starts execution and ends execution.
[0071] Step S304, obtaining the execution information of the executor by using the start probe function and the end probe function.
[0072] Step S305, constructing the tracking data of the operation statement, and the tracking data includes the execution information.
[0073] Step S306, storing the tracking data according to the selected storage method.
[0074] By pre-configuring multiple data storage methods, it enables staff to flexibly select the data storage method according to the usage scenario, improving the flexibility of program applications.
[0075] Such as Figure 4 shown, after the step of establishing communication with the procedural program executor, it includes detecting whether the preset global tracking status is in the enabled state. If so, execute the step of obtaining the execution information of the executor. The global tracking status is stored in the shared memory, making it visible to all processes, so that all processes can modify the global tracking status.
[0076] Specifically, the execution method of the database procedural program generally includes:
[0077] Step S401, establish communication with the procedural program executor.
[0078] Step S402, detect whether the preset global tracking status is in the enabled state. If so, execute step S404. If not, execute step S403. Specifically, the global tracking status is stored in the shared memory and has two state parameters: enabled and disabled. The global tracking status is used to control whether all processes start the tracking data acquisition process. That is, when the global tracking status is enabled, all processes need to start the tracking data acquisition process. When the global tracking status is disabled, all processes do not need to start the tracking data acquisition process.
[0079] Step S403, execute the operation statement normally. Execute the operation statement normally without calling the probe function.
[0080] Step S404, during the execution of each operation statement by the executor, call the start probe function and the end probe function respectively when the operation statement starts execution and ends execution.
[0081] Step S405, use the start probe function and the end probe function to obtain the execution information of the executor.
[0082] Step S406, construct the tracking data of the operation statement, and the tracking data includes the execution information.
[0083] Step S407, save the tracking data.
[0084] By configuring the global tracking status in the shared memory, all processes can modify the global tracking status. Therefore, even if a process is already running when the global tracking status is disabled, other processes can modify the global tracking status to start the process of obtaining tracking data for the running process, realizing the function of being able to start the process of obtaining tracking data for a process midway.
[0085] It should be noted that step S402 is to continuously detect during the entire execution process of PL / SQL, rather than only detecting once after establishing communication.
[0086] As Figure 5 shown, in one embodiment, the method for executing a database procedural program generally includes:
[0087] Step S501, start tracing and select a tracing data storage scheme. Specifically, pre-configure the global tracing status in the shared memory, and pre-configure multiple storage methods. The storage methods can include storing in the shared memory, storing in the database table, storing in the local file, or first storing in the shared memory and then transferring to the database table or local file when a preset threshold is reached. That is, set the global tracing status to on and select a storage method.
[0088] Step S502, the PL / SQL executor executes the PL / SQL subprogram. Specifically, that is, the PL / SQL executor starts to execute a subprogram in PL / SQL.
[0089] Step S503, obtain execution information and construct tracing data. Specifically, the tracing tool establishes communication with the PL / SQL executor, the tracing tool establishes probe functions, and when the PL / SQL executor executes the PL / SQL subprogram, different probe functions are called at the start and end of each operation statement respectively. Thus, for each line of the operation statement executed, the execution information of the operation statement is obtained in real time, and then the tracing data is generated.
[0090] Step S504, store the tracing data according to the selected storage scheme. Specifically, the tracing data generated for each line of the operation statement executed is saved according to the selected tracing data storage scheme. After an operation statement ends, it is recorded as a complete piece of tracing data.
[0091] Step S505, determine whether the PL / SQL program has finished executing. If so, end; if not, the PL / SQL executor continues to execute, the tracing tool continues to obtain execution information, construct tracing data, and save the tracing data.
[0092] By configuring the global tracing status in the shared memory, all processes can modify the global tracing status. Therefore, even if a process is already running when the global tracing status is off, other processes can be used to modify the global tracing status to start the process of obtaining tracing data for the running process, realizing the function of being able to start the process of obtaining tracing data for a process midway.
[0093] By establishing communication between the tracking tool and the procedural program executor, during the execution of each operation statement by the executor, the start probe function and the end probe function are called respectively when the operation statement starts and ends execution. The execution information of the executor is obtained by using the start probe function and the end probe function, the tracking data of the operation statement is constructed, and the tracking data is saved. Since the execution information of the operation statement being executed by the executor can be obtained in real time by using the probe function, when a failure occurs during the execution of PL / SQL, the location where the failure occurs can be determined according to the last recorded tracking statement. And, because the tracking data is saved, the execution order of the operation statements can be obtained according to the browsed saved tracking data, so as to facilitate analyzing the specific reasons for the failure according to the execution order. Therefore, it not only helps to quickly locate the location where the failure occurs, but also can provide the PL / SQL execution order to help analyze the reasons for the failure, thus making the failure location and analysis of PL / SQL more convenient.
[0094] This embodiment also provides a computer device and a computer-readable storage medium. Figure 6 It is a schematic diagram of a computer device 10 according to an embodiment of the present invention. Figure 7 It is a schematic diagram of a computer-readable storage medium 20 according to an embodiment of the present invention.
[0095] The computer device 10 may include a memory 110, a processor 120, and a computer executable program 11 stored on the memory 110 and running on the processor 120, and when the processor 120 executes the computer executable program 11, it implements the execution method of the database procedural program in any of the above embodiments.
[0096] The computer-readable storage medium 20 stores a computer executable program 11 thereon, and when the computer executable program 11 is executed by a processor, it implements the execution method of the database procedural program in any of the above embodiments.
[0097] This embodiment also provides a computer program product. Figure 8 It is a schematic diagram of a computer program product 30 according to an embodiment of the present invention. The computer program product 30 includes a computer executable program 11, and when the computer executable program 11 is executed by the processor 120, it implements the execution method of any of the foregoing database procedural programs.
[0098] Specifically, the computer executable program 11 for executing the operations of the present invention may be assembly instructions, instruction set architecture (ISA) instructions, computer instructions, computer-related instructions, microcode, firmware instructions, status setting data, or source code or object code written in any combination of one or more programming languages.
[0099] For the description of this embodiment, the computer-readable storage medium 20 can be any device that can contain, store, communicate, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. More specific examples (a non-exhaustive list) of the computer-readable medium include the following: an electrical connection part (electronic device) having one or more wirings, a portable computer diskette (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disc read-only memory (CDROM). Additionally, the computer-readable storage medium 20 can even be paper or other suitable media on which the program can be printed, because the program can be obtained electronically, for example, by optically scanning the paper or other media, followed by editing, interpretation, or otherwise processing it in a suitable manner if necessary, and then storing it in a computer memory.
[0100] It should be understood that the various parts of the present invention can be implemented by hardware, software, firmware, or a combination thereof. In the above-described embodiment, multiple steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system.
[0101] The computer device 10 can be, for example, a server, a desktop computer, a laptop computer, a tablet computer, or a smart phone. In some examples, the computer device 10 can be a cloud acquisition node. The computer device 10 can be described in the general context of computer system executable instructions (such as program modules) executed by a computer system. Generally, program modules can include routines, programs, object programs, components, logic, data structures, etc. that perform specific tasks or implement specific abstract data types. The computer device 10 can be implemented in a distributed cloud acquisition environment where tasks are executed by remote processing devices linked through a communication network. In the distributed cloud acquisition environment, program modules can be located on local or remote acquisition system storage media including storage devices.
[0102] The computer device 10 can include a processor 120 adapted to execute stored instructions and a memory 110 that provides temporary storage space for the operation of the instructions during operation. The processor 120 can be a single-core processor, a multi-core processor, an acquisition cluster, or any number of other configurations. The memory 110 can include a random access memory (RAM), a read-only memory, a flash memory, or any other suitable storage system.
[0103] The processor 120 may be connected via a system interconnect (such as PCI, PCI-Express, etc.) to an I / O interface (input / output interface) adapted to connect the computer device 10 to one or more I / O devices (input / output devices). The I / O devices may include, for example, a keyboard and a pointing device, where the pointing device may include a touchpad or a touch screen, etc. The I / O devices may be built-in components of the computer device 10, or may be devices externally connected to the acquisition device.
[0104] The processor 120 may also be linked via a system interconnect to a display interface adapted to connect the computer device 10 to a display device. The display device may include a display screen as a built-in component of the computer device 10. The display device may also include a computer monitor, a television, a projector, etc. externally connected to the computer device 10. In addition, a network interface controller (NIC) may be adapted to connect the computer device 10 to a network via a system interconnect. In some embodiments, the NIC may use any suitable interface or protocol (such as Internet Small Computer System Interface, etc.) to transmit data. The network may be a cellular network, a radio network, a wide area network (WAN), a local area network (LAN), or the Internet, etc. A remote device may be connected to the computer device via the network.
[0105] At this point, 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 consistent with the principles of the present invention can still be directly determined or derived from the disclosure of the present invention without departing from the spirit and scope of the present invention. Therefore, the scope of the present invention should be understood and construed as covering all such other variations or modifications.
Claims
1. An execution method for a database procedural program, comprising: Establishing communication with a procedural program executor; During the execution of each operation statement by the executor, a start probe function and an end probe function are respectively called when the operation statement starts execution and ends execution; Obtaining execution information of the executor by using the start probe function and the end probe function, where the execution information at least includes the object identifier of the subprogram to which the executed operation statement belongs and the statement line number; Constructing tracking data for the operation statement, where the tracking data includes the execution information; Saving the tracking data.
2. The execution method for a database procedural program according to claim 1, wherein The step of saving the tracking data includes: Saving the tracking data to a preset shared memory.
3. The execution method for a database procedural program according to claim 2, wherein The step of saving the tracking data further includes: Detecting that the data volume in the preset shared memory reaches a preset threshold; Transferring the data in the preset shared memory to a pre-built database table.
4. The execution method for a database procedural program according to claim 1, wherein The database is configured with multiple storage methods and a scheme selection interface; After the step of establishing communication with the procedural program executor, it includes: Obtaining the selected storage method; The step of saving the tracking data includes: Storing the tracking data according to the selected storage method.
5. The execution method for a database procedural program according to claim 1, wherein The execution information further includes the type of the subprogram to which the operation statement belongs, the statement type, the current call stack depth, the atomicity of the current execution transaction, and whether the subprogram is an autonomous transaction subprogram.
6. The execution method for a database procedural program according to claim 1, wherein The tracking data further includes an execution sequence number, the process identifier of the operation statement, the start time and end time of the operation statement, and the source code of the operation statement, and the execution sequence number is configured for the tracking data by an incrementing global variable.
7. The execution method for a database procedural program according to claim 1, wherein After the step of establishing communication with the procedural program executor, it includes: Detecting whether a preset global tracking status is in an enabled state, and if so, executing the step of obtaining the execution information of the executor; The global tracking status is stored in the shared memory, so as to be visible to all processes, so that all processes can modify the global tracking status.
8. A computer device, comprising a memory, a processor, and a computer executable program stored on the memory and running on the processor, and when the processor executes the computer executable program, it implements the execution method for a database procedural program according to any one of claims 1 to 7.
9. A computer-readable storage medium, on which a computer executable program is stored, and when the computer executable program is executed by a processor, it implements the execution method for a database procedural program according to any one of claims 1 to 7.
10. A computer program product, comprising a computer-executable program, which when executed by a processor implements the execution method of the database procedural program according to any one of claims 1 to 7.