Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Check Oracle DB is up and running in rc script 1

Status
Not open for further replies.

dUbbsNIX

MIS
Jul 10, 2003
70
GB
We want to use init.d(4) scripts to start up applications and move away from manually starting them up after boot-time.
The applications use an Oracle database that reside on a different server (A dedicated database server)

Can anyone suggest a suitable method of checking the relevant database is up and running prior to starting up the processes that will use it?

TNS Ping has been suggested but I don't think this gaurantees the database is up, just confirms the resolution.

Oracle is 9i and all servers are running Solaris 8+

cheers,

Dubbs.
 
some variation of ps -ef |grep -e pmon -e smon maybe?
 

Thanks for this. The application is not local to the database, so perhaps we could use ssh to run the command.

" ps -ef|grep [p]mon_${DatabaseName}"

rsh is not really an option for security.

Dubbs.
 
You can use expect to automate a procedure like this
that secure shells in , runs a shell command, regexps
through the output, gets confirmation and then confirms
proper operation. It seems like an extremely apt kludge.

You could also use your server scripts to set up a
socket based interface that announces/multicasts status
to certain clients. This is also easy to accomplish.


 
Doh. Yeah. If it's already available why not just query
it and decide if the result is suitable?
 

Or why not just try and start the application and see if falls over. But I was hoping for something a little more elegant...

Thaks for all your help.

Dubbs.
 
Well, by your own admission TNS ping doesn't actually tell you if the database is up and functional, even looking for the processes isn't going to guarantee the database is working.

So, you can write a tiny script that goes out and tries to connect which you could control, time and monitor. That seems preferable to having some big app start up, then crash.

No reason to cop an attitude, we're the ones offering you free advice that you solicited.
 

No you have misconstrued me, I was not copping an attitude!

Infact I thanked everyone for their help!

Although I personally do not find the use of "Doh" insulting to me, I am sure that others might.

Dubbs.
 
When Homer Simpson says "Doh!", he is exclaiming about his own lack of perspicacity. It seems that the same is true of marsd. Therefore, no insult was intended.
 
Thanks futurelet. That's right. No insult intended at all.
Just a failure to see the forest for the trees on my part.
Context is everything! ;)
 

Well in that case, this would seem a very pertinent moment for me to say, DOH!

DUbbs. ;-)
 

After all, if the problem is not yet handled, I suggest a tnsping, and if it succeeds, should follow an sqlplus connection and a 'select * from dual'

This test clearly shows if the DB is up and functional.

--Trifo
 
I use big brother to monitor my Oracle databases but if you goto deadcat.net they have a bunch of scripts there you might be able to download one of them to get you in the right direction.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top