The following article describes how to use DB2 trc in MySQL 9.7 to obtain the actual operation steps of DB2 tracking, as well as the things worth your attention in their actual operations and descriptions of the actual application code, the following is a detailed description of the main content of the article, I hope you will have a better understanding of it after browsing.
DB2trc Command Control with DB2®Provided tracing tools. The tracing tool records operation information and formats the information in readable format.
Keep in mind that running a trail increases overhead, so enabling a trace tool may affect system performance.
Generally, IBM software support agencies and development teams use DB2 tracking for fault diagnosis. You can run a trail to obtain information about the problem being investigated, but if you do not know the DB2 source code, it will be very useful.
Even if you want to obtain the trace file, you should know how to correctly start the trace and how to dump the trace file.
Note: you need one of the SYSADM, SYSCTRL, or SYSMAINT permissions to use DB2trc.
To get a general idea of available options, run the DB2 trc command without any parameters:
C: \> DB2trc
Usage: DB2trc (chg | clr | dmp | flw | fmt | inf | off | on) options for more information about specific DB2trc command parameters, use the-u option. For example, to view more information about starting a trail, run the following command:
DB2trc on-u this will provide information about all additional options that can be specified when you start a DB2 trace, labeled as "Tools.
The most important option to enable a trail is-L. It specifies the size of the memory buffer used to store tracing information. The buffer size can be specified in bytes or megabytes. To specify the MB, append "M" or "m" to the value ". The Trace Buffer must be a power of 2 MB. If the specified size does not meet this requirement, the buffer size is automatically rounded to the nearest power of 2.
If the buffer is too small, the information may be lost. By default, if the buffer is full, only the latest trace information is retained. If the buffer is too large, it may be difficult to send files to the IBM software support team.
If the tracking time is relatively short, such as database connection), the size of about 8 MB is usually enough:
C: \> DB2trc on-l 8 M
The trail has been started. However, if the trail is a large operation or a large amount of work is performed at the same time, a large Trace Buffer may be required.
On most platforms, tracking can be enabled and work at any time as described above. Note:
In a multi-database partition system, you must track the running of each physical partition relative to the logic.
On HP-UX, Linux®On the Solaris platform, if the trail is disabled after the instance is started, a very small buffer zone will be used for the next Startup trail regardless of the specified size. For example, you started the trace yesterday by using DB2trc on-l 8 m, collected the trace information, and then stopped tracking DB2 trc off ). Today, you want to run the trail and set the memory buffer to 32 MBDB2trc on-l 32 m without shutting down and restarting the instance ). In this case, you will find that the trail only obtains a small buffer. To run the trail effectively on these platforms, you should start the trail with the required size buffer before starting the instance and "clear" the buffer when necessary.
The above content is an introduction to using DB2 trc to obtain DB2 tracking in MySQL 9.7. I hope you will gain some benefits.