等待事件
select sql_id,event,count(*) from gv$session where wait_class<>'Idele' group by event,sql_id order by count(*);
select prev_sql_id, event,count(*) from gv$session where wait_class<>'Idele' group by event,prev_sql_id order by count(*);
SQL语句
select sql_id, sql_text from v$sql where sql_id='&sql_id';
V$SQL列出了共享SQL区域的统计信息,没有GROUP BY子句,并且为输入的原始SQL文本的每个子级包含一行。
V$SQL中显示的统计信息通常在查询执行结束时更新。
但是,对于长时间运行的查询,它们每5秒更新一次。
这使得在长时间运行的SQL语句仍在运行时,很容易看到它们的影响。