RDBMS_Day7 - RDBMS Day7 Time Stamping and Database Recovery...

Info iconThis preview shows pages 1–5. Sign up to view the full content.

View Full Document Right Arrow Icon
RDBMS – Day7 Time Stamping and Database Recovery A computer system may fail due to disk crash, power failure etc. A recovery scheme is an integral part of every DBMS . This minimizes the time duration required for the database to become usable after a crash.
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
ER/CORP/CRS/DB07/003 Version No: 2.0 2 Copyright © 2004, Infosys Technologies Ltd Time stamping Mechanism for serialization of a set of transactions in the chronological order of start time of these transactions. Each data item is associated with two values: – Wx: the largest timestamp value of any transaction that was allowed to write a value of X – Rx : the largest timestamp value of any transaction that was allowed to read the current value of X Timestamp could be based on system clock The time stamp protocol allows conflicting trnasactions to proceed based on time stamp ordering. The idea is like this: Let us say transaction Ti issues READ(X) Case I: If TS(Ti) < Wx(X), that means transaction Ti is wanting to read the value of X, but before it could do so, a later transaction has modified the value of X. So, what was the value of X when Ti started would be different from what the value of X is now, when ti actually gets a chance to read. So, this read request is rejected. If TS(Ti) >= Wx(x) then read operation is executed and Rx(x) is updated to Max(Rx(x), Ts(Ti) Continued in the notes page of the next slide……
Background image of page 2
ER/CORP/CRS/DB07/003 Version No: 2.0 3 Copyright © 2004, Infosys Technologies Ltd Two principles of Timestamping A transaction can read only rows or columns that have been updated by an older transaction else this transaction is rolled back. A transaction can update only rows or columns that have been read and updated by an older transaction else this transaction is rolled back.
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
ER/CORP/CRS/DB07/003 Version No: 2.0 4 Copyright © 2004, Infosys Technologies Ltd Concerns in time-stamping Why is there a high rate of transaction roll-back? Why is there a high level of concurrency? Why are there no deadlocks? To explain this with an example, let us say a data item X has the following status X WX=3.40 p.m Rx= 3.20 p.m Now transaction Ti starts at 3.35 p.m who’s action to be performed is Read(x). Ti wanted to read x at 3.35. at that time the value could have been 20 (assume) so Ti actually wanted this value 20. But, Ti could not get a chance at that time. In the meantime, another transaction Tj has updated the value of X at 3.40 p.m . When Ti is getting the chance, it is already 3.42 p.m . . If Ti reads the value of x, it is going to be the new valueas updated by tj and not the one ti actually wanted to read. So, there is no point in performing this read operation now. Ti is rejected and has to try again. Let us say Ti issues Write(Q) Case 1 : if(Ts(Ti) < Rx(x) it means ti is trying to update x whereas some other trans has already read the value of x. so the updation done by ti is not required. So ti is rejected Case 2 : if Ts(Ti) < Wx(x) then it means before Ti could update x, some other transaction has updated x with a latest value. So ti is rejected Case 3 : else ti is executed.
Background image of page 4
Image of page 5
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 12/29/2011 for the course COMPUTER Day7 taught by Professor Animesh during the Spring '11 term at Abraham Baldwin Agricultural College.

Page1 / 45

RDBMS_Day7 - RDBMS Day7 Time Stamping and Database Recovery...

This preview shows document pages 1 - 5. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online