Transaction log structure and log types
Transaction logs describe the operations that are executed inside the transaction. Each log consists of the transaction position reference, the System Change Number (SCN), the individually performed operation, and the change vector. From this perspective, transaction logs can be divided into two groups – UNDO
and REDO
structures. An UNDO
log stream stores the original data to allow the system to refuse transactions and revert individual operations to their original state. It is physically stored in the UNDO
tablespace in the database. On the other hand, the REDO
log stream is stored primarily in memory and then copied to the Online
REDO
log files, which are crucial to the Oracle database. This allows us to replay the approved transaction to get the state of the database just before the database instance or media failure. The Log Writer (LGWR) background process operates transaction log management.
Both streams are periodically overwritten...