数据库原理知识点复习

文章讨论了数据库中的undo和redo日志在事务处理中的应用。在不同的情景下,如事务提交或未提交,系统如何记录和处理事务状态,以确保数据一致性。例如,当两个事务Tina和Bar都已提交时,会执行redo操作;如果事务U未提交而T提交,则只有U会被标记为ABORTED并记录在日志中。
摘要由CSDN通过智能技术生成

数据库原理知识点复习(Ch16 异常处理)

基于《数据库系统实现》的习题解答。

习题4.2


According to undo and redo log, T T T in a,b are both commited. Therefore, they must be redone. The sequence of writing to disk is:

  • a. A : = 11 ; O ( A ) ; B : = 21 ; O ( B ) ; A:=11; O(A); B:=21; O(B); A:=11;O(A);B:=21;O(B);
  • b. A : = 21 ; O ( A ) ; B : = 21 ; O ( B ) ; C : = 31 ; O ( C ) ; A:=21; O(A); B:=21; O(B); C:=31; O(C); A:=21;O(A);B:=21;O(B);C:=31;O(C);

In the 2 sequences, O ( ⋅ ) O(·) O() stands for O U T P U T ( ⋅ ) OUTPUT(·) OUTPUT().

习题4.3


a.

If U , T U,T U,T are uncommited, then A : = 10 ; A:=10; A:=10;.
At last, the following sequence will be writen in the log:

<ABORTED U>; 
<ABORTED T>;
b.

If U U U is commited, T T T is uncommited, then A : = 10 ; B : = 21 ; C : = 30 ; D : = 41 ; A:=10;B:=21;C:=30;D:=41; A:=10;B:=21;C:=30;D:=41;.
At last, the following sequence will be writen in the log:

<ABORTED U>; 
c.

If U U U is uncommited, T T T is otherwise commited, then A : = 10 ; B : = 21 ; C : = 30 ; D : = 41 ; E : = 50 A:=10;B:=21;C:=30;D:=41;E:=50 A:=10;B:=21;C:=30;D:=41;E:=50.
At last, the following sequence will be writen in the log:

<ABORTED U>; 
d.

If U , T U,T U,T are uncommited, then A : = 10 ; B : = 21 ; C : = 31 ; D : = 41 ; E : = 51 ; A:=10;B:=21;C:=31;D:=41;E:=51; A:=10;B:=21;C:=31;D:=41;E:=51;.

  • 2
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值