Answer a consider the a bank account a with balance

Info icon This preview shows pages 7–8. Sign up to view the full content.

View Full Document Right Arrow Icon
Answer: a. Consider the a bank account A with balance $100. Consider two transactions T 1 and T 2 each depositing $10 in the account. Thus the balance would be $120 after both these transactions are executed. Let the transactions execute in sequence: T 1 first and then T 2 . The log records corresponding to the updates of A by transactions T 1 and T 2 would be < T 1 , A , 100 , 110 > and < T 2 , A , 110 , 120 > resp. Say, we wish to undo transaction T 1 . The normal transaction undo mechanism will replaces the value in question— A in this example— by the old-value field in the log record. Thus if we undo transaction T 1 using the normal transaction undo mechanism the resulting bal- ance would be $100 and we would, in effect, undo both transactions, whereas we intend to undo only transaction T 1 . b. Let the erroneous transaction be T e . Identify the latest archival dump, say D , before the log record < T e , START > . Restore the database using the dump. Redo all log records starting from the dump D till the log record < T e , COMMIT > . Some transaction—apart from transaction T e —would be active at the commit time of transaction T e . Let S 1 be the set of such transactions. Rollback T e and the transactions in the set S 1 . This completes point-in-time recovery. In case logical redo is possible, later transactions can be rex- ecuted logically assuming log records containing logical redo
Image of page 7

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

View Full Document Right Arrow Icon
22 Chapter 16 Recovery System information were written for every transaction. To perform log- ical redo of later transactions, scan the log further starting from the log record < T e , COMMIT > till the end of the log. Note the transactions that were started after the commit point of T e . Let the set of such transactions be S 2 . Re-execute the transactions in set S 1 and S 2 logically. c. Consider again an example from the first item. Let us assume that both transactions are undone and the balance is reverted back to the original value $100. Now we wish to redo transaction T 2 . If we redo the log record < T 2 , A , 110 , 120 > corresponding to transaction T 2 the balance would become $120 and we would, in effect, redo both transactions, whereas we intend to redo only transaction T 2 .
Image of page 8
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern