查询最多的用户:
select vs.USERNAME , action,count(1) from v$session vs
group by vs.USERNAME , action;
查询该用户下用的最多的sql:
select vs.SQL_ID,count(1)
from v$session vs
where vs.USERNAME = 'XXX'
and vs.ACTION = 'XXX'
group by vs.SQL_ID
order by 2 desc;
查出对应的sql:
select * from v$sqlarea vs
where vs.SQL_ID = '5v5c5v7k7svzs';
查看最多的等待:
select vs.ROW_WAIT_OBJ#,count(1)
from v$session vs
where vs.USERNAME = 'IES'
and vs.ACTION = 'DZ'
group by vs.ROW_WAIT_OBJ#
;
查看等待的对象
select * from dba_objects t
where t.OBJECT_ID = 449585836;
很可能是sql太慢的原因。