Re: starting the database
- From: Nirmalya Das <nirmalya@xxxxxxx>
- To: stephenbooth.uk@xxxxxxxxx
- Date: Mon, 1 May 2006 08:50:27 -0700
The only problem of checking just the "pmon" is that the database can be on
"mount" or "nomount" state and "ps -ef | grep pmon" will still return the
desired result and will give the impression that it is "up".
Nirmalya
Quoting stephen booth <stephenbooth.uk@xxxxxxxxx>:
On 01/05/06, Fred Smith <fred_fred_1@xxxxxxxxxxx> wrote:
I'm looking to make a cronjob that will every 5 minutes check if the
database is up, and if not, start it. Does anyone have a script that does
this available?
Thanks.
I normally check for pmon using pf -ef with the output piped through
grep, check the exit state of grep, using an if statement, to check if
the process was found.
You'll need to read the man page for grep on your OS as the meaning of
exit status varies from version to version. For some an exit state
of 0 means "One or more matches found" (non-zero meaning "No matches
found or an error occured"), for others the exit state is the number
of matches found (so zero would be no matches).
I have a script that does this but don't have access to it today (I'm
not in the office, today is a national holiday). The script I have
sends an email notifying us that the database is down rather than
trying to restart it. If the database is down then I want to know
why, it might be down for legitmate reasons (cold backup, maintence
work &c) or there might be a problem and trying to restart the
database might cause things to get worse. I'd rather spend 5 minutes
checking there's no underlying problem than 3 days fixing what was a
small problem but became a lot worse.
Stephen
--
It's better to ask a silly question than to make a silly assumption.
http://stephensorablog.blogspot.com/
--
http://www.freelists.org/webpage/oracle-l
--
http://www.freelists.org/webpage/oracle-l
- Follow-Ups:
- Re: starting the database
- From: stephen booth
- References:
- starting the database
- From: Fred Smith
- Re: starting the database
- From: stephen booth
Other related posts:
- » starting the database
- » Re: starting the database
- » Re: starting the database
- » Re: starting the database
- » Re: starting the database
- » Re: starting the database
- » Re: starting the database
- » Re: starting the database
- » Re: starting the database
I'm looking to make a cronjob that will every 5 minutes check if the database is up, and if not, start it. Does anyone have a script that does this available?
Thanks.
I normally check for pmon using pf -ef with the output piped through grep, check the exit state of grep, using an if statement, to check if the process was found.
You'll need to read the man page for grep on your OS as the meaning of exit status varies from version to version. For some an exit state of 0 means "One or more matches found" (non-zero meaning "No matches found or an error occured"), for others the exit state is the number of matches found (so zero would be no matches).
I have a script that does this but don't have access to it today (I'm not in the office, today is a national holiday). The script I have sends an email notifying us that the database is down rather than trying to restart it. If the database is down then I want to know why, it might be down for legitmate reasons (cold backup, maintence work &c) or there might be a problem and trying to restart the database might cause things to get worse. I'd rather spend 5 minutes checking there's no underlying problem than 3 days fixing what was a small problem but became a lot worse.
Stephen
-- It's better to ask a silly question than to make a silly assumption.
http://stephensorablog.blogspot.com/ -- http://www.freelists.org/webpage/oracle-l
- Re: starting the database
- From: stephen booth
- starting the database
- From: Fred Smith
- Re: starting the database
- From: stephen booth