2
我試圖做腳本,將檢查自上次腳本運行以來是否創建新的死鎖,如果自上次運行以來沒有新的死鎖,它應該打印0如果新的死鎖被創建,那麼它應該打印號碼腳本來檢測db2死鎖
#DB profile
. /db2/tdb_inst/archinst/sqllib/db2profile;
#variable to get current deadlock count
a=`db2 get snapshot for all on archprd |grep Deadlock|head -1|awk '{print $4}'`
#variable to get last deadlock count
b=`cat /home/dbmon/script/darch`
#need your help to do below math in script
# if a$-b$ = 0 print 0 if a$-b$ > 0 print number
#after print export current deadlock count to darch file
echo $a > /home/dbmon/script/darch
TIA tnt5273
THX devnull容易,當你知道它,以及時間的啤酒你被邀請... :) – tnt5273