数据库原理知识点复习(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;.