Saturday, 12 January 2013

What Happens During a Hot Backup

What happens when we put Oracle database in hot backup mode

The BEGIN BACKUP command checkpoints the datafiles and advances the datafile header checkpoints to the begin backup checkpoint SCN. Until the END BACKUP command is executed, checkpoints will cease to update the datafile headers. It starts the logging of block images.Each time the block is read into cache an image of the whole block before the first change is logged.
 
The END BACKUP command creates a redo record containing the begin backup  checkpoint SCN. It stops the logging of block images and causes the datafile checkpoints to be advanced to the database checkpoint.  
Datafile updates by DBWR go on as usual during the time the backup is being copied so the backup gets a "fuzzy" copy of the datafile.Some blocks may be ahead in time versus other blocks and some may contain updates by transactions that are later rolled back. The "fuzzy" backup copy is unusable without the "focusing" via the redo log that occurs when the backup is restored and undergoes media recovery. Media recovery applies redo (from all threads) from the checkpoint SCN that was captured at BEGIN BACKUP time through the end-point of the recovery operation. 
 
Once redo application is finished, uncommited transactions are rolled back to leave a transaction-consistent "focussed" version of the datafile.

No comments:

Post a Comment