You didn't mention OS or DB2 version (these always help). Are you sure
you're not more interested in instance status than database status?
You just want to know if DB2 is up and working, yes?
This kind of stuff is much easier in a scripting language rather than java.
In *nix, this (check_db2sysc.sh) will tell you if the instance is up:
if [ `ps aux | grep db2sysc | grep <INSTANCE> | grep -v grep | grep -v
check_db2sysc | wc -l` -eq 0 ]
then
echo "DB2:<INSTANCE> instance down" | /bin/mail page_whoever
fi
Stick 'er in a cron and away you go.
HTH
aj
Santhosh wrote:
Hi All
Thanks in advance
Can you guys please help me in providing an SQL script that display the
database names and its status in a db2 instance..
I need to write a java program that displays this details
Pl help me
Regards
Santhosh