After reading from several resources including:
- COMMIT (Oracle Database SQL Reference)
- Checkpoints (Oracle Programmer Reference)
- Difference between commit and checkpoint (on this site)
- ORACLE CHECKPOINTS by Anju Garg
I have concluded the following:
- The effects of any transaction are written to the log buffer in the memory.
- Commit flushes the log buffer to the logfiles in the disk.
- On the occurrence of a Checkpoint, DBW writes the dirty blocks to datafiles on the basis of logfile entries.
- In the event of a crash, the Recovery Manager reads the logfiles (till the last checkpoint) and performs Undo/Redo on the transactions.
I understand that the committed transactions are redone and uncommitted transactions are undone.
What I don't understand is how are uncommitted transactions known, given that they exist only in the log buffer in the memory and any crash is supposed to wipe-out the memory and the only surviving transactions are those residing in the logfiles on the disk (after getting committed). Is something wrong in my understanding?