see when the database is running in ARCHIVELOG MODE and when u want to do a Tablespace or datafile recovery - u need not shut it down because u will have the trouble opening it again with datafiles missing.
Then u take the tablespace or datafile offline with immediate option.
restore the damaged file
recover the tablespace or datafile with reover command.
then bring tablespace online.
u afe doing Incomplete recovery , Time based , Cancel based , changed based u need to shutdown the db using shutdown abort.
restore all datafiles
startup and mount
run your recovery using appropriate statement options.
recover database unti cancel
recover database unti change scn
recover database unti time.
why is the shutdown not neccessary in first case.
can we do a tspace or datafile recoverY when the db is open AND RUNNING .
06-05-2002, 02:52 PM
The second option will leave your DB in an inconsistent state. All the headers of Datafiles will not be in Sync.
It is an incomplete recovery. For example if you have logs say 1500 to 1800, current log # is 1801. you recover db using cancel based recovery upto say 1750. Now the logs 1751 to 1800 are good for nothing. If you are in a recovery situation at a later point of time, You'll need all the logs including the 50.
That's the reason we start the DB using Reset Logs which resets the log sequence to 1. You cannot bring the DB to a consistent state until you do all these operations after shutting down.
In the First Case, you are trying to completely recover the TBS to bring it to a state consistent with the information in the control files. If it succeeds then your log numbers will be the same. If it fails, then you'll have to go to the second type of recovery.
I'll leave the judgement to gurus.
06-05-2002, 07:10 PM
any other ideas
ur feedback / answers is awaited
06-05-2002, 08:51 PM
Not much any more. Mr.Patnams is correct. Basically, all the headers are open for data files and are recorded in Control files. They should be in sync. You need to down the database in second case, otherwise, log sequence and headers will be inconsistent, and control file can't read and match with it's current SCNs.
unless in the first case, you are making the required TS offline. so the headers of those particular DF are remianed same. after recovery, if the SCNs are matched with the headers, ur successful else u've second option, follow it. no other go...