Transaction log recovery technique, Cheat Sheet of Database Management Systems (DBMS)

This is the one numerical problem solved of transaction log recovery technique of Database management system

Typology: Cheat Sheet

2024/2025

Uploaded on 06/06/2025

sagar-neupane-1
sagar-neupane-1 🇳🇵

1 document

1 / 3

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Q7. What is recoverable and nonrecoverable schedule? Explain with example.
Recoverable Schedule:
A schedule is recoverable if a transaction commits only after all the transactions from which it has
read have committed.
Example:
T1: r1(X) w1(X) Commit
T2: r2(X) Commit
Here, T2 reads X written by T1, and T1 commits before T2, so it's recoverable.
Non-Recoverable Schedule:
If a transaction commits before the transaction it has read from commits, the schedule is
non-recoverable.
Example:
T1: r1(X) w1(X)
T2: r2(X) Commit
Abort
If T1 aborts after T2 commits, then T2 has read dirty data, hence it's non-recoverable.
Deadlock and Two Approaches to Deadlock Prevention:
Deadlock: Occurs when two or more transactions wait indefinitely for each other to release locks.
Approaches:
pf3

Partial preview of the text

Download Transaction log recovery technique and more Cheat Sheet Database Management Systems (DBMS) in PDF only on Docsity!

Q7. What is recoverable and nonrecoverable schedule? Explain with example.

Recoverable Schedule: A schedule is recoverable if a transaction commits only after all the transactions from which it has read have committed.

Example: T1: r1(X) w1(X) Commit T2: r2(X) Commit Here, T2 reads X written by T1, and T1 commits before T2, so it's recoverable.

Non-Recoverable Schedule: If a transaction commits before the transaction it has read from commits, the schedule is non-recoverable.

Example: T1: r1(X) w1(X) T2: r2(X) Commit Abort If T1 aborts after T2 commits, then T2 has read dirty data, hence it's non-recoverable.

Deadlock and Two Approaches to Deadlock Prevention: Deadlock: Occurs when two or more transactions wait indefinitely for each other to release locks.

Approaches:

  1. Wait-Die Scheme:
    • Older transaction may wait.
    • Younger transaction aborts.
  2. Wound-Wait Scheme:
    • Older transaction preempts the younger one.
    • Younger one waits.

Serializability Check:

Schedule S1: T1: r1(X) r1(Z) w1(X) T2: r2(Y) r2(Z) w2(Z) w2(Y) T3: r3(X) r3(Y) w3(Y)

Conflicts: T1 -> T3 (w1(X) -> r3(X)) T3 -> T2 (w3(Y) -> w2(Y)) T2 -> T1 (w2(Z) -> r1(Z)) Graph has a cycle -> Not serializable

Schedule S2: T1: r1(X) r1(Z) w1(X) T2: r2(Y) r2(Z) r2(Y) w2(Z) w2(Y) T3: r3(X) r3(Y) w3(Y)

Conflicts: