DB2 - Problembeschreibung
| Problem IC69428 | Status: Geschlossen |
MAKE DB2V97_MONITOR.KSH SCRIPT MORE ROBUST TO REDUCE FALSE NEGATIVES | |
| Produkt: | |
DB2 FOR LUW / DB2FORLUW / 970 - DB2 | |
| Problembeschreibung: | |
** This APAR applies only to integrated HA solutions **
On memory constrained systems or very busy systems ps behavior
is unpredictable where ps may return the process name in square
brackets.
Hence there's a chance that this check:
p_pid=$(ps -u ${DB2INSTANCE?} -o args | grep -v "^db2sysc [0-9]"
| grep -c "^db2sysc")
returns 0, which in turns makes this script return a status of 2
i.e. the instance is down. | |
| Problem-Zusammenfassung: | |
**************************************************************** * USERS AFFECTED: * * All users using integrated HA solution * **************************************************************** * PROBLEM DESCRIPTION: * * The ps command in highly stressed environments can return * * wrong * * values which can throw off the script and cause involuntary * * * * cycling of the instance. The fix will provide a fool proof * * way * * of verification of the instance so that the false negatives * * are * * reduced to almost zero. * **************************************************************** * RECOMMENDATION: * * Fixed in v97fp3. * **************************************************************** The ps command in highly stressed environments can return wrong values which can throw off the script and cause involuntary cycling of the instance. The fix will provide a fool proof way of verification of the instance so that the false negatives are reduced to almost zero. | |
| Local-Fix: | |
To avoid these "false negatives", modify this line to check for
square bracket and return unknown if it is found.
Original:
p_pid=$(ps -u ${DB2INSTANCE?} -o args | grep -c "^db2sysc
${NN?}[ ]*$")
if [[ $p_pid == 0 && $NN -eq 0 ]]; then
p_pid=$(ps -u ${DB2INSTANCE?} -o args | grep -v "^db2sysc
[0-9]" | grep -c "^db2sysc")
fi
New:
p_out=$(ps -u ${DB2INSTANCE?} -o args | egrep "^db2sysc
${NN?}[ ]*$|^db2sysc[ ]*$|^\[db2sysc\]")
p_pid=$(echo $p_out | grep -c "\[db2sysc\]")
if [[ $p_pid != 0 ]]; then
logger -i -p err -t $0 "ps returns [db2sysc]"
echo 0
return 0
fi
p_pid=$(echo $p_out | grep -c "db2sysc ${NN?}")
if [[ $p_pid == 0 && $NN -eq 0 ]]; then
p_pid=$(echo $p_out | grep -c "db2sysc")
fi | |
| verfügbare FixPacks: | |
DB2 Version 9.7 Fix Pack 3 for Linux, UNIX, and Windows | |
| Lösung | |
Fixed in v97fp3.
In the script db2V97_monitor.ksh modify the ps command checks
with the following lines:
# If home dir not accessible, use plain old ps ...
p_out=$(ps -u ${DB2INSTANCE?} -o args | egrep "^db2sysc
${NN?}[ ]*$|^db2sysc[ ]*$|^\[db2sysc\]")
p_pid=$(echo $p_out | grep -c "db2sysc ${NN?}")
if [[ $p_pid == 0 && $NN -eq 0 ]]; then
p_pid=$(echo $p_out | grep -c "db2sysc")
fi
if [[ $p_pid == 0 ]]; then
p_pid=$(echo $p_out | grep -c "\[db2sysc\]")
if [[ $p_pid != 0 ]]; then
logger -i -p err -t $0 "ps returns [db2sysc]: returning
0"
echo 0
return 0
fi
rc=1
else
rc=0
fi
Pls. ratify it with DB2 support before deploying it in
production. | |
| Workaround | |
In the script db2V97_monitor.ksh modify the ps command checks
with the following lines:
#
If home dir not accessible, use plain old ps ...
p_out=$(ps -u ${DB2INSTANCE?} -o args | egrep "^db2sysc
${NN?}[ ]*$|^db2sysc[ ]*$|^\[db2sysc\]")
p_pid=$(echo $p_out | grep -c "db2sysc ${NN?}")
if [[ $p_pid == 0 && $NN -eq 0 ]]; then
p_pid=$(echo $p_out | grep -c "db2sysc")
fi
if [[ $p_pid == 0 ]]; then
p_pid=$(echo $p_out | grep -c "\[db2sysc\]")
if [[ $p_pid != 0 ]]; then
logger -i -p err -t $0 "ps returns [db2sysc]: returning
0"
echo 0
return 0
fi
rc=1
else
rc=0
fi
Pls. ratify it with DB2 support before deploying it in
production. | |
| Bug-Verfolgung | |
Vorgänger : APAR is sysrouted TO one or more of the following: IC69573 Nachfolger : | |
| Weitere Daten | |
Datum - Problem gemeldet : Datum - Problem geschlossen : Datum - der letzten Änderung: | 23.06.2010 13.04.2011 13.04.2011 |
| Problem behoben ab folgender Versionen (IBM BugInfos) | |
9.7.FP3 | |
| Problem behoben lt. FixList in der Version | |
| 9.7.0.3 |
|
| 9.7.0.3 |
|