I've never seen man pages for Oracle. The doc that is installed for Oracle is in $ORACLE_HOME/doc and is in html and pdf format.
tnsping <instance_name> is used to see if the instance is running and reachable -- that is, is the listener able to connect you to the database. you get several lines of output to a tnsping. The last line says OK (xx msec) if the database is reachable.
I have an older version of dbup.sh like this:
VERBOSE=0
shift OPTIND-1
for INSTANCE in $DB
do
FAILED=0; INSTANCEDOWN=0
if [ ${VERBOSE} -eq "1" ] ; then
echo "Checking instance ${INSTANCE}...\n"
fi
for PROCESS in pmon smon
do
RC=$(ps -ef | egrep ${INSTANCE} | egrep -v 'grep' | egrep ${PROCESS})
if [ "${RC}" = "" ] ; then
INSTANCEDOWN=1
if [ ${VERBOSE} -eq "1" ] ; then
echo "\tERROR: Instance ${INSTANCE} ${PROCESS} down!"
fi
fi
done
if [ ${INSTANCEDOWN} = "1" ] ; then
echo "`date` - Instance ${INSTANCE} is DOWN!!!\n"
FAILED=1
else
echo "`date` - Instance ${INSTANCE} is running.\n"
fi
done
if [ ${FAILED} = 1 ] ; then
return -1
else
return 0
fi
this is a script for determing if an Instance is up and running. I got it working and its okay.
${ORACLE_HOME}/bin/tnsping ${ORACLE_SID} > /dev/null
if [[ $? -eq 0 ]]; then
#Oracle is up...
#...do something...
else
#Oracle is down...
#...do something...
fi
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.