Home » RDBMS Server » Server Administration » how to know database's status in command-line mode?
how to know database's status in command-line mode? [message #59460] Sun, 23 November 2003 20:28 Go to next message
jack
Messages: 123
Registered: September 2000
Senior Member
I want to know my database (oracle9i)'s status, I mean, if it nomounted, mounted or open from command-line mode.

Thanks in advance!
Re: how to know database's status in command-line mode? [message #59469 is a reply to message #59460] Mon, 24 November 2003 09:13 Go to previous messageGo to next message
Thiru
Messages: 1089
Registered: May 2002
Senior Member
Since you didnt preclude the use of sqlplus wrapped inside a shell script executed from command line, thats what I am going to suggest !
Query v$instance to get the instance status(Started,Mounted,Open). When the instance is down,you will probably get an error messagee which you can interpret as 'Down' .

Also,if you are in Unix, you can do a couple of things

ps -ef&#124grep smon
sysresv

to see if the instance is up(but wont tell you any more details about database status(ie mounted,open)).

For eg )
$sysresv&#124grep DEV08&#124grep -v IPC
Oracle Instance alive for sid "DEV08"

But I use v$instance.

-Thiru
Re: how to know database's status in command-line mode? [message #59481 is a reply to message #59460] Tue, 25 November 2003 17:57 Go to previous message
jack
Messages: 123
Registered: September 2000
Senior Member
thanks Thiru, you answered my question! I get the information from v$instance
Previous Topic: ORA-01858 Error
Next Topic: PCTFREE/PCTUSED
Goto Forum:
  


Current Time: Fri Sep 20 10:44:26 CDT 2024