[Introduction to Database Systems] Homework 7 Chapter 10 Exercises 45

1. Requirements:

1. Please complete the homework of Chapter 10, Questions 4 and 5 of Exercise 10, and submit the documents.

2. Topic:

4. Consider the logging shown in the following figure:

insert image description here

(1) If the system failure occurs after 14, explain which transactions need to be redone and which transactions need to be rolled back.

Answer: T1 and T3 need to be redone, T2 and T4 need to be rolled back

(2) If the system failure occurs after 10, explain which transactions need to be redone and which transactions need to be rolled back.

Answer: T1 needs to be redone, and T2 and T3 need to be rolled back

(3) If the system failure occurs after 9, explain which transactions need to be redone and which transactions need to be rolled back.

Answer: T1 needs to be redone, and T2 and T3 need to be rolled back

(4) If the system failure occurs after 7, explain which transactions need to be redone and which transactions need to be rolled back.

Answer: T1 needs to be redone, T2 needs to be rolled back

5. Consider the log records shown in question 4, assuming that the values ​​of A, B, and C are all 0 at the beginning:

(1) If the system failure occurs after 14, write the values ​​of A, B, and C after the system is restored;

Answer: After the system is restored: A=8, B=7, C=11

(2) If the system failure occurs after 12, write the values ​​of A, B, and C after the system is restored;

Answer: After the system is restored: A=10, B=0, C=11

(3) If the system failure occurs after 10, write the values ​​of A, B, and C after the system is restored;

Answer: After the system is restored: A=10, B=0, C=11

(4) If the system failure occurs after 9, write the values ​​of 4, B, and C after the system is restored;

Answer: After the system is restored: A=10, B=0, C=11

(5) If the system failure occurs after 7, write the values ​​of A, B, and C after the system is restored:

Answer: After the system is restored: A=10, B=0, C=11

(6) If the system failure occurs after 5, write the values ​​of A, B, and C after the system recovers.

Answer: After the system is restored: A=0, B=0, C=0

Guess you like

Origin blog.csdn.net/weixin_44893902/article/details/129599481