Fisac
Fisac
2. Briefly explain what happens during system failure when the following scenario occurs
3. Consider the following example of a log of three transactions, where an immediate database
modification scheme is used. If a crash occurs just after step 8, what are the steps taken to recover
from this crash?
4. Consider the following example of a log of three transactions, where deferred database
modification scheme is used. If a crash occurs just after step 9, what are the steps taken to recover
from this crash?
5. Consider you’re in a busy restaurant where two waiters are serving dishes at their respective
tables. Waiter A needs to serve soup to Table 1 but must wait for Waiter B to finish garnishing it.
Meanwhile, Waiter B needs to serve dessert to Table 2 but is waiting for Waiter A to pass him the
sugar. If neither waiter gives way, the service comes to a standstill, much like a deadlock in a
database system. How would you design a protocol to prevent such a service deadlock in the
restaurant, drawing parallels to deadlock prevention methods in database management systems?
6. Consider a library where patrons can either read books on the premises or check them out to take
home. If two patrons wish to read the same book at the library, they can share it by reading different
chapters without taking the book out of the library, akin to a Shared Lock in a DBMS. However, if
a patron wants to take the book home, they must have exclusive access, like an Exclusive Lock.
How does this library system’s book checkout process resemble the lock-based protocols in a
DBMS?
7. Suppose a transaction deletes a record, and the free space generated thus is allocated to a record
inserted by another transaction, even before the first transaction commits.
a. What problem can occur if the first transaction needs to be rolled back?
b. Would this problem be an issue if page-level locking is used instead of tuple-level locking?
c. Suggest how to solve this problem while supporting tuple-level locking, by logging post- commit
actions in special log records, and executing them after commit. Make sure your scheme ensures
that such actions are performed exactly once.
8. Consider the three transactions T1, T2, and T3, and the schedules S1 and S2 given below. Draw
the serializability (precedence) graphs for S1 and S2, and state whether each schedule is serializable
or not. If a schedule is serializable, write down the equivalent serial schedule(s).
T1: r1 (X); r1 (Z); w1 (X);
T2: r2 (Z); r2 (Y); w2 (Z); w2 (Y);
T3: r3 (X); r3 (Y); w3 (Y);
S1: r1 (X); r2 (Z); r1 (Z); r3 (X); r3 (Y); w1 (X); w3 (Y); r2 (Y); w2 (Z); w2 (Y);
S2: r1 (X); r2 (Z); r3 (X); r1 (Z); r2 (Y); r3 (Y); w1 (X); w2 (Z); w3 (Y); w2 (Y);
9. Discuss the role of recovery techniques in handling failures in a DBMS. How do techniques like
undo and redo logging help in recovering from different types of failures?
10. What is the difference between the UNDO/REDO and the UNDO/NO-REDO
algorithms for recovery with immediate update? Develop the outline for an
UNDO/NO-REDO algorithm.