查询v$active_session_history
类似这种:
select a.session_id,
a.BLOCKING_SESSION,
a.sql_Id,
to_char(sample_time, 'yyyy-mm-dd hh24:mi:ss'),
a.time_waited
from v$active_session_history a
where a.EVENT = 'enq: TX - row lock contention'
and to_char(sample_time, 'yyyy-mm-dd hh24:mi:ss') between
'2018-01-04 10:00:00' and '2018-01-04 11:00:00'
and a.BLOCKING_SESSION_STATUS = 'VALID'
ORDER BY to_char(sample_time, 'yyyy-mm-dd hh24:mi:ss') DESC