Script to check the health of a database

need a script to check the health of a session server database. It must read the data base and send an alert if the database is unavailable. If its unavailable, we will want to bring down the database listener to force failover.

can u guyz help me in doing this. what information do i need regarding the server and give a brief idea abouth the script if possible?

---------- Post updated at 02:35 PM ---------- Previous update was at 01:58 PM ----------

need help guyz

Please refer this link. It might help.