KST tracing is an in-memory tracing feature for Oracle RDBMS Database Server, this is similar to on-disk (KSD) tracing except it is stored in SGA. For on-disk tracing, we have many events like 10046 (sql_trace), 10053 (sql_optimizer), etc. Different to these on-disk tracing, KST tracing use a cyclic buffer in the SGA and we won’t create a large trace file and thus avoid filling customer disk, as well as avoid expensive disk IO to write the trace file. When a problem happens, the in-memory KST trace buffer is written to a trace file and is available for support and development to diagnose a problem.

KST tracing feature is enabled by default, and some trace events are always enabled. Several RDBMS components use this feature, and most of them can be set by an event syntax using an event number.
Please note the KST trace event is different from on-disk tracing, and some of them require a different form to set the event. Mostly we don’t have the same event as available for on-disk tracing.

Each process has a cyclic buffer for itself in the SGA. Recent KST trace record is kept in the buffer and other processes can see the buffer also. Even when a process is dead, its KST trace record can be dumped by another process.

When is the KST trace buffer written to disk ? 

The KST trace buffer is usually dumped in following cases:

When an ORA-600 or ORA-7445 error happens
If the diag process is available, the victim process dumps its own KST trace to a trace file, and the diag process tries to dump the KST trace of all processes into the cdmp directory.
On 10.2 non-RAC environment, the diag process is not used. In this case, the victim process dumps the KST trace of all processes to the victim process trace file

Note: 
this KST trace dump is invoked by the “errorstack” event with level >= 3, which is automatically raised by a fatal error like ORA-600 or ORA-7445.

When instance aborted on one RAC node
In this case, diag process on all node tries to dump KST trace of all processes into cdmp directory.

To change the enable the KST Tracing, we need to modify below hidden parameter

alter system set “_trace_dump_cur_proc_only”=TRUE scope=both; 

Conclusion

KST tracing feature is enabled by default, and some trace events are always enabled. Several RDBMS components use this feature, and most of them can be set by an event syntax using an event number.

After changing the parameter value, this will prevent the tracing to be done for all processes and just allow it to happen only when error occurs.

This will not impact database behavior but hopefully it will reduce the number of cdmp trace files generated and prevent your disk group from filling up.

Thank you for giving your valuable time to read the above information.

If you want to be updated with all our articles send us the Invitation or Follow us:

Skant Gupta’s LinkedIn: www.linkedin.com/in/skantali/

Joel Perez’s LinkedIn: www.linkedin.com/in/SirDBaaSJoelPerez

Anuradha’s LinkedIn: https://www.linkedin.com/in/dbaanuradhamudgal/

or Join our LinkedIn group: Oracle Cloud DBaaS

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.