Db2stop Checklist
Db2stop Checklist
(This utility db2fodc (DB2 first occurrence data collection command) captures
data about db2 instance to help in problem determination situations.
The db2fodc tool captures data, to be included in the FODC package, and place
s it inside an FODC_symptom directory created in the current DIAGPATH)
2)Generate a db2support package to collect the data generated by the script.
db2support . -d <Database name> -c s
run db2pd -stack -all
3)Run data collection script
4)db2 force application all
sleep 30
5)db2 terminate
6)db2 deactivate db dbname
7)db2stop
8)ipclean
Sample Data collection script(required input=dbname)
#!/bin/sh
DBNAME=$1;
TIMESTAMP=`date +%Y-%m-%d-%H:%M:%S`
echo "DBNAME = $DBNAME / TIMESTAMP = $TIMESTAMP"
echo ""
echo "executing db2pd command data collection..."
db2pd -db $DBNAME -fmtlock -file db2pd_fmtlock_$TIMESTAMP
db2pd -db $DBNAME -locks showlocks -file db2pd_locks_showlocks_$TIMESTAMP
db2pd -db $DBNAME -locks wait -file db2pd_locks_wait_$TIMESTAMP
db2pd -db $DBNAME -wlocks -file db2pd.wlocks.$TIMESTAMP
db2pd -db $DBNAME -memsets -mempools, db2pd -dbptnmem
db2pd -fmp -file db2pd_fmp_$TIMESTAMP
db2pd -osinfo
db2mtrk -a -v -i -d
ps -auxw | sort r +3 |head 50|tee top_50_cpu_consuming_processess_$TIMESTAMP
db2 list applications show detail>list_applications_$TIMESTAMP
db2 list utilities show detail>list_utilities_$TIMESTAMP
db2pd -db $DBNAME -hadr
db2pd -db $DBNAME -reorgs
db2pd -db $DBNAME -reorgs index
echo ""
echo "executing lock related diagnostcs..."
db2 connect to $DBNAME >> slqoutputs_$TIMESTAMP
db2 get snapshot for database manager >> dbm_snaphot_$TIMESTAMP
db2 get snapshot for all databases >> all_db_snaphots_$TIMESTAMP
echo ""
echo "data collection completed..."