Generally, 10046 events are not recommended, because if the performance of the instance to be processed is poor, 10046 event tracking may make your instance
Generally, 10046 events are not recommended, because if the performance of the instance to be processed is poor, 10046 event tracking may make your instance
Generally, 10046 events are not recommended, because if the performance of the instance to be processed is poor, 10046 event tracking, it may make your instance performance worse. In general, we can obtain AWR reports for a period of time based on actual business conditions to basically solve some common problems, such as which sqls occupy more resources, resource contention, memory problems, locks, and so on.
However, when AWR cannot locate the problem, we can start the 10046 trace. The following is an example of minimizing the 10046 trace. We can execute this 10046 trace on the local machine, the following red font indicates the typed command:
00:17:06 ChenZw> alter session set tracefile_identifier = '000000 ';
The session has been changed.
00:17:09 ChenZw> alter session set events '2017 trace name context forever, level 12 ';
The session has been changed.
00:17:34 ChenZw> select count (1) from all_objects;
COUNT (1)
----------
76791
Select 1 line.
00:17:54 ChenZw> alter session set events '10046 trace name context off ';
The session has been changed.
We can see the above execution. The first sentence is to set the tracing identifier, the second sentence is to enable tracing, the third sentence is to execute, and the last sentence is to disable 10046 tracing. After the preceding statement is executed, when you exit the current session, Oracle will write the tracing result to the trace file directory. The address is as follows on my local machine: d: \ oracle \ diag \ rdbms \ orcl \ trace \ orcl_ora_8732_10046.trc
Here, we can use the tkprof provided by Oracle to format and open the Tracing file for analysis, as shown below:
C: \> tkprof d: \ oracle \ diag \ rdbms \ orcl \ trace \ orcl_ora_8732_10046.trc D: \ 10046.txt sys = no sort = prsela, exeela, fchela
TKPROF: Release 11.1.0.6.0-Production on Wednesday July 10 00:23:18 2013
Copyright (c) 1982,200 7, Oracle. All rights reserved.
After the preceding command is executed, we can find 10046.txt in the d: \ directory. By analyzing 10046.txt, We can optimize the statement we just executed and perform 10046 extension tracking, it is very suitable for tuning software that writes a lot of business logic into the stored procedure.