某个 sample_time 时间点查看该 sample_time 时间点的等待事件和相关 SQL_ID、p1、p2 等参数
set linesize 260 pagesize 10000
select sql_id, nvl(event,'on cpu') event,count(*),p1||'',p2||''
from v$active_session_history a
where sample_id=&sample_id
group by sql_id, nvl(event,'on cpu'),p1||'',p2||''
order by count(*) desc;
某个 sample_time 时间点查看该 sample_time 时间点的等待事件和 SQL_PLAN_HASH_VALUE、p1、p2
等参数
set linesize 260 pagesize 10000
select SQL_PLAN_HASH_VALUE, nvl(event,'on cpu') event, count(*),p1||'',p2||''
from v$active_session_history a
where sample_id=&sample_id
group by SQL_PLAN_HASH_VALUE, nvl(event,'on cpu'),p1||'',p2||''
order by count(*) desc;
3.2.采样某时间段内 SAMPLE_TIME 的 SQL_ID||SQL_PLAN_HASH_VALUE、EVENT 的活动会话的分组
某时间段内等待事件和相关 SQL_ID、p1、p2 等参数
set linesize 260 pagesize 10000
col nvl(event,'ON CPU') for a40
select *
from (select sql_id, nvl(event,'ON CPU'), count(*)
from gv$active_session_history
where sample_time between
to_date('&date1', 'yyyy-mm-dd hh24:mi:ss') and
to_date('&date2', 'yyyy-mm-dd hh24:mi:ss')
and inst_id in (select instance_number from v$instance)
group by sql_id, event
order by count(*) desc)
where rownum <=10;
某时间段内的等待事件和相关 SQL_PLAN_HASH_VALUE、p1、p2 等参数
set linesize 260 pagesize 10000
col nvl(event,'ON CPU') for a40
select *
from (select SQL_PLAN_HASH_VALUE, nvl(event,'ON CPU'), count(*)
from gv$active_session_history
where sample_time between
to_date('&date1', 'yyyy-mm-dd hh24:mi:ss') and
to_date('&date2', 'yyyy-mm-dd hh24:mi:ss')
and inst_id in (select instance_number from v$instance)
group by SQL_PLAN_HASH_VALUE, event
order by count(*) desc)
where rownum <=10;
4、获取某时间段内的 top session_id+session_serial#和堵塞其他会话的 top
session_id+session_serial#
获取某时间段内的 top session_id+session_serial#
set linesize 260 pagesize 10000
col nvl(event,'ON CPU') for a40
select *
from (select session_id,session_serial#,sql_id,nvl(event,'ON CPU'),count(*)
from gv$active_session_history
where sample_time between
评论