Skip to Main Content
  • Questions
  • Why do we have active redo log members, if a full checkpoint is performed at every log switch?

Breadcrumb

Question and Answer

Chris Saxon

Thanks for the question, Imad.

Asked: July 19, 2017 - 6:57 am UTC

Last updated: July 24, 2017 - 1:26 am UTC

Version: 11.2

Viewed 1000+ times

You Asked

Dears,
Hope you are fine
I'm a little confused about active redo logfiles.
I know that active redo log is not the current redo logfile being written to by LGWR. but the one that still have records needed by instance recovery.
But the documentation said that at redo log switch the system would perform a full checkpoint which means that dirty block protected by this logfile are written to disk. So why do still we need this redo logfile for instance recovery.

Regards,
Imad

and Chris said...

Whether or not a redo log file is active is a separate concept to whether blocks are protected. As the docs say:

If you have enabled archiving (the database is in ARCHIVELOG mode), then the database cannot reuse or overwrite an active online log file until one of the archiver background processes (ARCn) has archived its contents. If archiving is disabled (the database is in NOARCHIVELOG mode), then when the last redo log file is full, LGWR continues by overwriting the next log file in the sequence when it becomes inactive.

http://docs.oracle.com/database/122/ADMIN/managing-the-redo-log.htm#ADMIN11308

The point is you need the redo logs to do point-in-time recovery. So you can't overwrite their contents until you've saved them somewhere else (the archived redo log file). To stop this happening, they remain active until the database has archived them.

Rating

  (2 ratings)

Is this answer out of date? If it is, please let us know via a Comment

Comments

LGWR will not wait for checkpoint to complete?

Imad Jundi, July 23, 2017 - 5:26 am UTC

Thank you, Chris
So this means that at logswitch a full checkpoint is triggered but the lgwr will not wait for it to complete?

Connor McDonald
July 24, 2017 - 1:26 am UTC

Checkpoints have changed dramatically from the days where a log file switch was the driver for them (and hence you could get a "stalling" issue when log files switched). Nowadays you can think of checkpointing as more of a continuous activity that is always going on in the background.

But the underlying premise is the same - we cannot re-use a log file until we know that the modified blocks in the database cache are safely on disk (otherwise re-using the redo log will compromise our ability to protect those blocks).

Got it.

Imad Jundi, July 24, 2017 - 5:15 am UTC

Thank you again, Chris.
You made it very clear for me.