Transactions and database recovery techniques

December 4, 2026 · Team EasyExamNotes · 3 min read (est.) · 0 comments

Share on WhatsApp

← RGPV CS-502 DBMS December 2024 solved question paper

← RGPV CS-502-CBGS DBMS June 2020 solved question paper

← RGPV CS-502 DBMS November 2019 solved question paper

RGPV Previous Year Examination Question

B.Tech. V Semester | CS-502 (GS) | December 2024 | 7(a)

Question (restated): Define a transaction and discuss techniques for recovering transactions.

Answer

Transaction and ACID properties

A transaction is a logical unit of database work consisting of one or more operations. For example, transferring ₹500 from account A to B requires debiting A and crediting B as a single unit. Atomicity ensures all or none of the operations occur; consistency preserves constraints; isolation controls concurrent effects; durability preserves committed changes after failure.

Need for recovery

Failures include transaction errors, system crashes and storage failures. Recovery restores a consistent database state, preserving committed changes and removing incomplete effects.

Log-based recovery

A log records transaction identifiers, changed items, old and new values, and commit or abort records. Write-ahead logging requires relevant log records to reach stable storage before corresponding dirty data pages are written. Commit records must be durable before successful commit is acknowledged.

<T1, START>
<T1, A, 2000, 1500>
<T1, B, 1000, 1500>
<T1, COMMIT>

If a crash occurs before commit under an immediate-update scheme, undo restores old values as needed. If commit is durable but data pages have not been written, redo reapplies committed changes. Actual recovery algorithms account for page state and log ordering.

Deferred and immediate update

Deferred update postpones database changes until commit, typically requiring redo but no undo of uncommitted database writes. Immediate update permits changes before commit and may require both undo and redo.

Checkpointing and shadow paging

Checkpoints record recovery information periodically to reduce the amount of log processing after a crash. Shadow paging maintains an unchanged shadow page table and a modified current page table; commit atomically switches the persistent reference. It avoids conventional undo logging in its basic form but may introduce fragmentation and copying overhead.

Backup and restore

For media failure, restore a valid backup and apply archived logs to recover to an appropriate point. Together these techniques support atomicity and durability and protect the database against failures.

Further reading

Silberschatz, Korth and Sudarshan, Database System Concepts; Elmasri and Navathe, Fundamentals of Database Systems.


June 2020 – Q8(b)(ii)

Question: Database recovery

Database recovery restores a consistent state after transaction or system failure. A log records changes and transaction outcomes. In a conventional undo/redo scheme, uncommitted updates may be undone and committed updates redone as needed. Write-ahead logging ensures log information is durable before corresponding data pages are written. Checkpoints reduce recovery work. Media failure may require restoring a backup and applying archived logs. Recovery supports atomicity and durability.

← RGPV CS-502 DBMS December 2024 solved question paper

← RGPV CS-502-CBGS DBMS June 2020 solved question paper

← RGPV CS-502 DBMS November 2019 solved question paper

Discussion

Ask a question, share your thoughts or report an error.

Sign in to participate in the discussion.

Join the discussion