Vous êtes sur la page 1sur 2

S02_HW1_AdvDB_140325.

doc 1/2
Convention:
Using Hoasen mail to send your answer to lecturer.

Subject: AdvDB Answer HW 1

Attach file: AD1_xxxxxx.doc (xxxxxx: student_code )

For example:
Subject: AdvDB Answer HW 1
file: AD1_123456.doc (123456 is Student ID)

Font: Arial Size: 12
Margin: 1 for Left, Right, Top, Bottom

Note: Deadline 19:00 Mon., 31/03/2014


Student code:
Student name:

Answer:

Homework 1
1. Which of the following schedules is (conflict) serializable or not? For each
serializable schedule, determine the equivalent serial schedules. (Draw the
precedence graph)

(a) r1 (X); r3 (X); w1(X); r2(X); w3(X)
(b) r1 (X); r3 (X); w3(X); w1(X); r2(X)
(c) r3 (X); r2 (X); w3(X); r1(X); w1(X)
(d) r3 (X); r2 (X); r1(X); w3(X); w1(X)

2. Consider the three transactions T1, T2, and T3, and the schedules S1 and S2
given below. Draw the serializibility (precedence) graphs for S1 and S2 and state
whether each schedule is serializable or not. If a schedule is serializable, write down
the equivalent serial schedule(s).

T1: r1(x); r1(z); w1(x)
T2: r2(z); r2(y); w2(z); w2(y)
T3: r3(x); r3(y); w3(y)

S1: r1(x); r2(z); r1(z); r3(x); r3(y); w1(x); w3(y); r2(y); w2(z); w2(y)
S2: r1(x); r2(z); r3(x); r1(z); r2(y); r3(y); w1(x); w2(z); w3(y); w2(y)

3. Consider schedules S1, S2, and S3 below. Determine whether each schedule is
strict, cascadeless, recoverable, or nonrecoverable. (Determine the strictest
recoverability condition that each schedule satisfies.)
S1: r1(x); r2(z); r1(z); r3(x); r3(y); w1(x); c1; w3(y); c3; r2(y); w2(z); w2(y);c2
S2: r1(x); r2(z); r1(z); r3(x); r3(y); w1(x); w3(y); r2(y); w2(z); w2(y); c1; c2; c3;
S3: r1(x); r2(z); r3(x); r1(z); r2(y); r3(y); w1(x); c1; w2(z); w3(y); w2(y); c3; c2;
S02_HW1_AdvDB_140325.doc 2/2

4. Consider the following schedule S: r1(X); w1(X); r1(Y); r2(X); w2(Y); r3(Y)
For each of the following properties, modify schedule S, by adding completion action
(i.e commit, abort) so that the result schedule is complete and has the given
property. If such a modification is not possible, briefly explain the reason:
a). Avoid cascading aborts (Cascadeless)
b). Avoid cascading aborts but no recoverable
c). Recoverable but does not avoid cascading aborts
d). Not recoverable
e). Conflict serializable

Vous aimerez peut-être aussi