Notification email when deadlock is encountered in Oracle alert log
You might try using ADRCI.

ADRCI&gt;
ADRCI&gt; show alert -p "message_text like '%Global Enqueue Services Deadlock detected%' and originating_timestamp &gt; systimestamp + INTERVAL '-5' MINUTE"


This will show your error within the past 5-minutes. You could put this into a shell script and add a cron job that runs it every 5-minutes.

#!/bin/bash
LOG = /home/oracle/log.txt
adrci_homes=( $(adrci exec="show homes" | grep -e rdbms ))

for adrci_home in ${adrci_homes[@]}
do
   echo $adrci_home' Alert Log' &gt;&gt; $LOG
   adrci exec="set home ${adrci_home}; show alert -p \\\"%Global Enqueue Services Deadlock detected%' and originating_timestamp &gt; systimestamp + INTERVAL '-5' MINUTE\\\"" -term &gt;&gt; $LOG
done

num_errors=`grep -c -e 'Global Enqueue Services Deadlock detected' $LOG`

if [ $num_errors != 0 ]
then
     mutt -a $LOG -s "Deadlock Detected" admin@mydomain.com 
fi