Log file is the fundamental mechanism for data recovery as it contains all the updates made in the database. Such as Transaction records as well as Check point records.
Transaction Records contains mainly the following information:
1) Transaction Identifier
2) Type of log records such as transaction start, insert, update, delete, transaction commit and transaction abort.
3) Database action such as insert, updates, and delete operations.
4) Before image of data and after image of data.
5) Log management information.
Checkpoint Records is created containing all active transaction along with corresponding identifiers.
Transactions are redone which are committed after checkpoint and Transaction are undone that were active during the crash.
Checkpoint is the point of synchronization between Log file and Database. All Memory buffer are forced to write to secondary storage. It’s like issuing flush command to the OS to write data to disk. Since writing to disk is the job of OS not the job Database.