Query to return all Oracle Deadlocks in 12c

deadlockoracleoracle-12c

Is there an object I can query in 12c to return all ORA-60 Deadlock alerts?

I just want to do a weekly report that outputs the number of deadlocks that have occurred and what schema they occurred on.

My Oracle knowledge is not great, and I have drawn a blank when searching for resources on this online.

Thanks

Best Answer

Sure:

select
  ss.value
from  
  v$sysstat ss 
  join v$statname sn using (statistic#)
where
  sn.name = 'enqueue deadlocks'
;

I did not test it extensively though.