The Transaction Log
A DBMS uses a transaction log to keep track of all transactions that update the database. The information stored in this log is used by the DBMS for a recovery requirement triggered by a ROLLBACK statement, a program’s abnormal termination, or a system failure such as a network discrepancy or a disk crash. Some RDBMSs use the transaction log to recover a database forward to a currently consistent state. After a server failure, for example, Oracle automatically rolls back uncommitted transactions and rolls forward transactions that were committed but not yet written to the physical database.
While the DBMS executes transactions that modify the database, it also automatically updates the transaction log.
The transaction log stores:
- A record for the beginning of the transaction.
- For each transaction component (SQL statement):
- The type of operation being performed (update, delete, insert).
- The names of the objects affected by the transaction (the name of the table).
- The “before” and “after” values for the fields being updated.
- Pointers to the previous and next transaction log entries for the same transaction.
- The ending (COMMIT) of the transaction.
You May Also Like:
Transaction and Its Properties