W6 DBMS Chapter22
W6 DBMS Chapter22
At time t7,
transaction
TY writes the values
of account A, so it
will write as done at
time t4 that will be
$400.
It means the value
written by TX is lost,
i.e., $250 is lost
Y=150
Copyright © 2016 Ramez Elmasri and Shamkant B. Navathe Slide 21- 13
Example for Unrepeatable Read Problem: Consider two
transactions, TX and TY, performing the read/write operations
on account A, having an available balance = $300
Two-Phase
Locking 2PL
happening.
Deadlock Avoidance: try to avoid deadlocks by use of prior
are not done properly then the system may detect the
deadlock and recover it.
If the log contains the record <Ti, Start> and <Ti, Commit> then
the Transaction Ti needs to be redo.
If log contains record<Tn, Start> but does not contain the record
either <Ti, commit> or <Ti, abort>, then the Transaction Ti needs
to be undo.
Undo helps in rollback while redo helps in rolling forward.
Slide 22- 26
Copyright © 2016 Ramez Elmasri and Shamkant B. Navathe
A Typical Strategy For Recovery
If there is extensive damage to a wide portion of the database
due to catastrophic failure, such as a disk crash, the recovery
method:
Restores a past copy of the database that was backed up
to archival storage.
Reconstructs a more current state by redoing the
UNDO all the write-item operations of all the TAs in the list in
the reverse order in which they appear in the log (use before
image from the log records).
Copyright © 2016 Ramez Elmasri and Shamkant B. Navathe Slide 22- 34
UNDO/NO-REDO recovery algorithm