Home » Infrastructure » Unix » How to identify a DB is up or not through a script
How to identify a DB is up or not through a script [message #97165] Tue, 01 January 2002 16:30 Go to next message
O. Vamsi Krishna
Messages: 3
Registered: January 2002
Junior Member
Hi,

Is there anyway to identify, through a script, if a Oracle DB is up or not. We can connect using sqlplus utility and if there is any error during connecting, then we can identify it. But i want to know if there is any other method.

Regards,

Vamsi

----------------------------------------------------------------------
Re: How to identify a DB is up or not through a script [message #97175 is a reply to message #97165] Fri, 04 January 2002 09:47 Go to previous messageGo to next message
David Smelker
Messages: 2
Registered: January 2002
Junior Member
There are multiple ways of testing to see if the database is up. On Unix the simplest way I know of is to check to see if the backround processes are running. This only means that the instance is up, but if you have a database failure the instnace should come down as well. Can incorporate the following line into a script and schedule it to run.
ps -ef | grep -v grep | grep ora_smon_$DBNAME
where $DBNAME is set to the name of the database you want to check.

----------------------------------------------------------------------
Re: How to identify a DB is up or not through a script [message #97289 is a reply to message #97175] Mon, 25 February 2002 11:26 Go to previous message
D Shashikanth
Messages: 1
Registered: February 2002
Junior Member
Hi.

I have difft. problem in this regard. On one fine morning, I found that the instance was up, but I wasn't able to access my DB. That was because due to a memory lock by some program, the DB hung, it just hung thats all. And even if I try a script as below:
sqlplus username/password <<!
exit;
!
and after this I grep for the process id of sqlplus, or check the exit status of sqlplus command, it didn't work because the shell never exited out of the sqlplus command cozz DB was hung.

How do I identify such a situation?

Regards,
Shashikanth.
Previous Topic: Re: Deleting file named *
Next Topic: Re: Oracle 8i installation on SCO Unixware 7
Goto Forum:
  


Current Time: Wed Apr 24 07:03:48 CDT 2024