← RGPV CS-502 DBMS December 2020 solved question paper
← RGPV CS-502-CBGS DBMS June 2020 solved question paper
← RGPV CS-502 DBMS December 2025 solved question paper
CS-502 (CBGS) | December 2020 | Q3(b) | 7 marks
Question (restated): Define a database log and describe its maintenance.
Answer
A transaction log is a persistent sequence of records describing transaction activity and database modifications. It supports atomicity and durability by allowing the recovery manager to undo incomplete transactions and redo committed changes after a failure. Typical records include transaction start, update with old and new values, commit, abort and checkpoint. Each record is identified by a log sequence number.
For example, T1 transfers 100 from A to B, initially 500 and 300. Log records may be START T1, (T1,A,500,400), (T1,B,300,400), COMMIT T1. If a crash occurs before commit and changes reached disk, recovery can undo the changes using old values. If commit is durable but a modified page was not written, recovery can redo the necessary changes using new values.
Write-ahead logging requires relevant log records to reach stable storage before the corresponding dirty data pages are written. Commit must not be acknowledged until the required commit log information is durable. Logs are buffered in memory and flushed in batches to reduce I/O overhead.
Checkpoints record recovery progress and relevant transaction or dirty-page information. They limit the amount of log that recovery must examine. Modern systems may use fuzzy checkpoints without stopping all transactions. Log segments can be archived for backup and point-in-time recovery, and obsolete segments recycled only when no longer required by recovery, replication or backup policies.
Logs must be protected from unauthorized changes and storage failure. Recovery algorithms differ in detail; ARIES, for example, uses analysis, redo and undo phases. The essential principle is that durable recovery information precedes potentially irreversible data writes.

Further reading: Silberschatz, Korth and Sudarshan, Database System Concepts.
June 2020 – Q7(a)
Question: What is Log? How is it maintained?
A transaction log is a persistent chronological record of transaction events and changes to database items. It supports recovery after transaction failures or system crashes. Typical records include start, update, commit, abort and checkpoint records. An update record may contain transaction ID, item ID, old value and new value.
Write-ahead logging requires the relevant log record to reach stable storage before a modified data page is written to disk. A commit is acknowledged only after the required commit information and preceding log records are durable. Logs are normally appended sequentially and identified by log sequence numbers. Checkpoints record recovery information and limit the amount of log that must be examined after a crash.
For example, T1 changes A from 500 to 700. The log contains START T1, UPDATE(T1,A,500,700), COMMIT T1. If the committed change has not reached the data file when a crash occurs, redo can restore 700. If T1 had not committed and its change had reached disk, undo can restore 500 in a conventional undo/redo recovery scheme. Actual recovery algorithms may use additional records and page sequence numbers.
Logs are retained or archived according to backup and recovery policy. They must be protected from unauthorized modification and storage failures.
December 2025 – Q7(b)
Question (restated): Explain log-based recovery and checkpoints with an example.
A transaction log records updates and transaction events on stable storage. Under write-ahead logging, the log describing a change must be durable before the changed page is written to disk, and the commit record must be durable before success is acknowledged. An update record may contain transaction ID, item, old value and new value.
<START T1> <T1, A, 100, 80> <COMMIT T1> <CHECKPOINT> <START T2> <T2, B, 50, 70> CRASH
In a simplified immediate-update recovery model, committed T1 is redone if necessary, restoring A=80; uncommitted T2 is undone, restoring B=50 if its update reached disk. Actual recovery depends on the DBMS algorithm and page/log state.
A checkpoint records recovery information so the system need not always scan the entire log. A simple quiescent checkpoint can flush dirty pages and record a consistent boundary. Modern fuzzy checkpoints allow transactions to continue and record active transactions and dirty-page information. Recovery may need records before the checkpoint for active transactions. Checkpoints reduce recovery work but do not replace backups or transaction commits.
← RGPV CS-502 DBMS December 2020 solved question paper
Discussion
Ask a question, share your thoughts or report an error.
Sign in to participate in the discussion.
Join the discussion