Example:
Session 2:
Sql> Connect Test/test
Connected.
SELECT * from V$mystat where rownum=1;
143
Select b.spid,a.sid,a.serial# from v$session a,v$process b where a.paddr =b.addr and a.sid = 143;
?
Session 1: Open the 10046 event for the corresponding session.
Alter session Set timed_statistics = true;
Alter session set Statistics_level=all;
Alter session Set max_dump_file_size = unlimited;
Execute Sys.dbms_system.set_ev (143,99,10046,12, "); /* Open Level 12 10046 event, do not open 12, cannot see wait event */
?
Session 2: Execute the SQL statement you want to troubleshoot
Update t_table01 set name= ' Niko ' where no=4;
Commit
?
Session 1:
Execute Sys.dbms_system.set_ev (143,99,10046,0, "); /* Close 10046 Events */
Show parameter user
Enter the corresponding directory:
To generate a format file:
Tkprof ORACLE03_ORA_20052.TRC Oracle03_ora_20052.sql
?
?
View the generated files to find the corresponding SQL:
More Oracle03_ora_20052.sql
?
Oracle Database 1046 Events