Home » RDBMS Server » Server Administration » How to detect if a database needs recovery (DB 11.x, 12.x)
How to detect if a database needs recovery [message #617219] Thu, 26 June 2014 03:46 Go to next message
John Watson
Messages: 7663
Registered: January 2010
Location: Global Village
Senior Member
How can I determine, in mount mode, if the database is consistent or if it needs recovery? ie, was it shut down in an orderly fashion with a checkpoint, or was the instance aborted for any reason? I've been looking at various columns in controlfile views, such as

v$database CHECKPOINT_CHANGE#, CONTROLFILE_CHANGE#
v$datafile CHECKPOINT_CHANGE#
v$log NEXT_CHANGE#

follwing a SHU IMMEDIATE or a SHU ABORT and I don't have an answer. Surely there is an easy way to do this!

Any insight will be welcome.
Re: How to detect if a database needs recovery [message #617221 is a reply to message #617219] Thu, 26 June 2014 04:10 Go to previous messageGo to next message
Lalit Kumar B
Messages: 3131
Registered: May 2013
Location: World Wide on the Web
Senior Member
John Watson wrote on Thu, 26 June 2014 14:16
How can I determine, in mount mode, if the database is consistent or if it needs recovery?


If this is of any help, per documentation http://docs.oracle.com/cd/E11882_01/server.112/e25789/startup.htm#CEGCHJGF,

Quote:
Whether instance recovery is required depends on the state of the redo threads. A redo thread is marked open in the control file when a database instance opens in read/write mode, and is marked closed when the instance is shut down consistently. If redo threads are marked open in the control file, but no live instances hold the thread enqueues corresponding to these threads, then the database requires instance recovery.


I believe instance recovery happens automatically.
Re: How to detect if a database needs recovery [message #617226 is a reply to message #617221] Thu, 26 June 2014 05:15 Go to previous messageGo to next message
John Watson
Messages: 7663
Registered: January 2010
Location: Global Village
Senior Member
Thank you for replying. Yes, instance recovery is automatic.
Re: How to detect if a database needs recovery [message #617227 is a reply to message #617219] Thu, 26 June 2014 05:16 Go to previous message
John Watson
Messages: 7663
Registered: January 2010
Location: Global Village
Senior Member
The answer:

v$thread.status is OPEN if the instance is aborted, CLOSED if it is a consistent shutdown.

Previous Topic: ORA-00376: file 24 cannot be read at this time
Next Topic: Move Oracle 11gr2 database to new Windows server?
Goto Forum:
  


Current Time: Wed Nov 14 07:06:09 CST 2018