Undo versus Redo

From Robs_Wiki
Jump to: navigation, search

Oracle uses UNDO to undo changes and to keep a read consistent image of block. UNDO holds a copy of previous data until the transaction commits and for some time afterwards (depending on undo retention period specified), thus providing read consistence, since the user can read the data as it is at the time a transaction started, while transaction is still in the process. Capturing the undo data enables Oracle to roll back the uncommitted data. Undo data is used for both read consistency and to recover from failed transactions.

Meanwhile REDO log records all the changes to the database as they happen. If the database crashes, Oracle will first read redo logs and apply all committed changes that that didn't end up in data files yet, due to the crash) before opening the database for regular use.