AIX - DB2 v9
I have inherited a script that does online backups to TSM for our DB2 databases.
Code:
db2 backup db ${DB} online use TSM
ret=$?
if [ ${ret} != 0 ]; then
exit 2
fi
Which sometimes returns this:
Code:
db2_online_maint[28] db2 backup db dp2 online use TSM
Backup successful. The timestamp for this backup image is : 20101111233051
SQL2425W The log file for the online backup was not truncated.
db2_online_maint[29] ret=2
db2_online_maint[30] [ 2 != 0 ]
db2_online_maint[31] exit 2
According to
SQL2425W explanation I don't have to do anything.
The script however currently sees this as an error, and I would like to catch this particular message and not let the script exit 2 in the if statement.
This line, db2_online_maint[29] ret=2 is catching 2 from the db2 online backup (it would be 0 if there were no messages) but I don't know if it is returning 2 just for SQL2425W or it returns 2 for a number of different messages of a similar nature / warning level, some of which I may want to act upon and some I don't.
So, I'm not sure I want to change the script to ignore any messages that return the value 2. It would help if I knew what messages that get returned from db2 backup command map to what numeric values.
E.g.
no message - 0
SQL2425W - 2
etc.
Thank you for taking the time to have a look.