Friday, 16 October 2020

Undo vs Redo

 

Undo vs Redo

 Here is a simple difference between the two:


Undo

Redo

Makes a change go away

Reproduces a change

Used for rollback and read consistency

Used for rolling forward the changes

Protects the database from inconsistent reads

Protects from data loss

Data stored in Undo segments in Undo tablespace

Logs stored in SGA, in memory

 

Undo

1.       Undo is a record of a transaction before it is committed.

2.       When issuing a ROLLBACK statement, undo records help to undo changes made to the database by the uncommitted transaction.

3.       We use Undo for rollback and read consistency

Redo 

1.       On the other hand, redo is an entry in redo log files that holds a group of change vectors.

2.       These logs contain files with a history of all changes made to the database.

3.       Redo for rolling forward database changes

 

No comments: