Undo and Redo UNDO The data in the return segment is stored in a "return entry" mode. Return entry = block information (number of blocks of a change in transaction) Stored in the transaction Submitted data in the block in each return segment Oracle maintained a "transaction table" in the transaction table Record transaction numbers related to all returned entry in this back section (Transaction SCN & Return entry) REDO redo record consists of a "change vector". The modifications made to a block in the database are recorded in each change variable. When the user submits a commit statement, the LGWR process will immediately write a submission record into the redo log file, then start writing to the redo information related to the transaction. # After the transaction is submitted, Oracle will generate a system change code (SCN) for the request. The SCN of the transaction will be recorded simultaneously in its submission record and recording.
Article Excerpt: Commit is completed before committing transactions: • The retreat entry of this transaction is generated in the back of the SGA area. The original version of the data modified by the transaction is saved in the return entry. • Re-record the transaction is generated in the redo log cache in the SGA area. The transaction records modifications to the data block are described in the recording, and modifications to the data blocks in the retraction section are also described. The redo record in the cache is possible to write to the hard disk before transaction commit. · The transaction to the database is recorded in the database buffer in the SGA area. These modifications may also be written to the hard drive before transaction commit. Work completed while submitting a transaction: • This transaction has been submitted in the internal transaction table in the retracted section specified in the transaction, and generates a unique SCN record in the internal transaction table for unique identity. . • The LGWR rear process writes the redo record in the SGA area to log cache. The SCN of the transaction will be written while writing redo logs. · Oracle service process release all record locks and table locks used by the transaction. • Oracle notifies the user's transaction commit completion. · Oracle marks the transaction as completed. ROLLBACK Retreat The work is done: • Oracle revokes all SQL statements to the database to the database in revocation by using the rollback entry in the retreat section. · All locks used by Oracle Service Process Release Series have successfully retired. · Oracle marks the transaction as completed