---------------------------------------------10046---------------------------------------------------
--如果要准确的性能指标,需要先清理shared_pool和buffer_cache
alter system flush shared_pool;
alter system flush buffer_cache;
--开启session级10046 event trace
alter session set events '10046 trace name context forever, level 12';
--执行你的SQL
<sql_text>
--关闭session级10046 event trace
alter session set events '10046 trace name context off';
--获取trace文件的路径
select d.value || '/' || lower(rtrim(i.instance, chr(0))) || '_ora_' ||p.spid|| '.trc' trace_file_name
???????? from (select p.spid
????????????? from v$mystat m, v$session s, v$process p
???????????? where m.statistic# = 1