How Recovery Works ?

Normally recovery happens as follows:

In the controlfile is recorded the current log sequence number the database is working with, and – I think_- the current scn.
If one of the datafiles has an older seq# or scn in its header, that file must first be recovered up to the current scn before it can be used in the database.
So recovery brings the datafiles up to the same level as the controlfile.

Now suppose you loose you controlfile and a datafile, but you have all archivelogs and the online redologs. In this case you can do a full recovery. However you will first have to recreate your controlfile using ‘create controlfile …’. This statement could have been generated by a ‘alter database backup controlfile to trace’. However if you carefully loo at this statement you will see that it doesn’t contain a sequence number or a scn. So after creating the controlfile, the logic of the recovery above would not work: you can’t bring the datafiles to the level of the controlfile because you don’t know at what level the controlfile is.

Here the clause ‘using backup controlfile’ is required. It basically means: look at the datafiles, decide what is the oldest, look at the sequence nr it has in its header and ask for the archivelog file with that sequence number.

When your redolog files are still ok, Oracle will finally know when recovery has to finish. If you also lost your online redolog files, Oracle will just keep asking for the next archivelog until you reach the last one. Even then, Oracle will ask for an (unexisting) next one, because it cannot know at what level the controlfile was at the moment of the crash (remember, it has been recreated without specifying an seq nr or scn

Leave a Reply

Your email address will not be published. Required fields are marked *