Home » RDBMS Server » Server Administration » Deadlock
Deadlock [message #59684] Tue, 16 December 2003 02:37 Go to next message
Raj
Messages: 411
Registered: November 1998
Senior Member
Is the following script ok for dedecting a deadlock and send mail to concerned person

If not please provide solution

###################################################################
## deadlock_alert.sh ##
###################################################################
sqlplus -s INFOTEST1/TEST1@$1 << end
set feed off
set heading off
spool deadlock.alert

SELECT SID, DECODE(BLOCK, 0, 'NO', 'YES' ) BLOCK,
REQUEST
FROM V_DEADLOCK
WHERE REQUEST > 0
ORDER BY block DESC;
spool off
exit
echo filesss
if [[ `cat deadlock.alert&#124wc -l` -gt 0 ]]
then
mailx -s "DEADLOCK ALERT for ${1}" xxx@sss.com < deadlock.alert
fi
exit 0
Re: Deadlock [message #59695 is a reply to message #59684] Tue, 16 December 2003 20:40 Go to previous message
Frank Naude
Messages: 4580
Registered: April 1998
Senior Member
Hi,

This script will not work - unless you've created a view called V_DEADLOCK (should it be v_$lock?), the SELECT statement will fail.

BTW: Why do you want to detect deadlocks? Oracle will automatically detect and resolve deadlocks. It is the blocking locks you should be concerned about!

Best regards.

Frank
Previous Topic: Cross Platform Scheduling
Next Topic: Upgrade from 9.2.0.3 to 9.2.0.4
Goto Forum:
  


Current Time: Fri Sep 20 08:20:36 CDT 2024