Oracle 10046 event tracking is generally not recommended for 10046 events, because if the performance of the instance to be processed in front of you 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 '10046 trace name context forever, level 12'; the session has been changed. 00:17:34 ChenZw> select count (1) from all_objects; COUNT (1) ---------- 1 row has been selected in 76791. 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, fchelaTKPROF: release 11.1.0.6.0-Production on Wednesday July 10 00:23:18 2013 Copyright (c) 1982,200 7, Oracle. all rights reserved.
Author Chen text (keen on PM \ ORACLE \ JAVA, etc., welcome to exchange) EMAIL: ziwen@163.com QQ: 409020100 after the execution of the above command, we can in D: \ The Directory is located at 10046.txt. By analyzing 10046.txt, We can optimize the execution statement, with 10046 extension tracking, which is very suitable for tuning software that writes a lot of business logic into the stored procedure.