If this is your first visit, be sure to check out the FAQ by clicking the link above.
You may have to register before you can post: click the register link above to proceed.
To start viewing messages, select the forum that you want to visit from the selection below.
I am composing small script to find an agentid of the Runstats job.
DB2_DATABASE is an environment variable, so the snapshot part work fine. but am not getting agent which is active from Runstats point of view.
Please help me.
rm -f /tmp/.d_agent
db2 get snapshot for applications on $DB2_DATABASE | egrep 'Application handle|Most recent operation|Statement' | while read AGENT
do
read OPERATION
AGENTI_ID=$(echo ${AGENT} | awk -F\= '{print $2}')
TYPE=$(echo ${OPERATION} | awk -F\= '{print $2}'
if [[ "${TYPE}" = "Run statistics" ]]; then
if [[ $? = 0 ]]; then
if echo ${AGENTI_ID} | grep "^[0-9]*$" ; then
if [[ $? = 0 ]]; then
echo ${AGENTI_ID} >> /tmp/.d_agent
else
print "It is not an agent"
fi
fi
fi
fi
done
if you are on DB2 V9.1, 9.5,9.7 you can simply write a sql query on sysibmadm view for applications for the required fields, say application_name & agentid where you don't need to do any further filtering or formatting.
__________________
Jayanta Datta
DB2 UDB DBA
IBM India, Global Delivery
New Delhi