Check Database availability?

Hi All,
My script gets aborted as it is connecting as a remote database through a DB link on every 3rd sunday.As the remote DB is down for more than 6 hours.

Can TNSPING DBNAME inside my script ensure the database is up???

Then how can i check the database is up or down ?

Regards
Megh

tnsping instance_name 2>&1 > /dev/null
if [[ $? -eq 0 ]] ; then
    echo "instance_name is up"
else
    echo "not up"
fi

No,
it only shows that the listener is accessible and running.