Professional Documents
Culture Documents
DBMS (Unit-3&4)
DBMS (Unit-3&4)
PART-1
3
UNIT
Database
Design & Normalization
Functional Dependencies.
Questions-Answers
Questions
Long Answer Type and Medium Answer Type
its role in
Que 3.1. What is functional dependency ? Explain
inferen ce rules for functional
database design. Describe the
CONTENTS dependencies.
Answer
Part-1 : Functional Dependencies.. 3-2A to 3-7A Functional dependeney :
constraint between two sets of attributes
Part-2 : Normnal Forms, ***** .3-7A to 3-11A 1 Afunctional dependency isa
from the database.
First, Second, Third Normnal denoted by X ’ Y, between two sets of
Form, BCNF 2. A functional dependency is of Rspecifies a constraint on the
attributes X andY that are subsets
relation r.
Part-3 : Inclusion Dependence, .3-11A to 3-13A possible tuples that can form a
which bave
Lossless Join Decomposition 3 The constraint for any two tuples t, and to, inr
t, [X]=t, [X1;
Part-4 : Normalization using FD, .3-13A to 3-18A Also, must have
MVD and JDs, 4, (Y| =t, [Yl;
Alternative Approaches to component of a tuple in r depends
Database Design 4. This means that the values of the Y components, or alternatively,
on, or are determined by the value of theX
tuple uniquely (or functionally)
the values of the X component of a
determine the value of the Ycomponent.
Role of functional dependency : designer to express facts
1. Functional dependency allows the database enterprise
that the designer is modeling with the
about the enterprise
databases.
2 It allows the designers to express
constraints, which cannot be expressed
with super keys.
Inference rules for functional dependencies :
Bcathena ’p holds.
1. Reflexivity rule: Ifa is a set of attributes and
attributes then
2 Augmentation rule : If a B holds and y is a set of
Ya ’ yB holds.
holds.
3. Transitivity rule : If a’B holds and B->y holds, then a -> y
Complementation rule : If a-’ß hold, then a -’R-(aUB))
4
holds.
3-1 A (CSTT-Sem-5)
Database Management System 3-3A (CSTT-Sem-5) 34A (CSIT-Sem-5) Database Design &Normalization
5 Multivalued augmentation rule:a ’B hold and ycR and 8cy These two can be combined toget
then ya 188 holds. A’ BC
& Multivaluedtransitivity rule :If a-+p holds, then ß- yholds. Now, the revised set F becomes :
then a-’-y-B holds.
7. Replication rule :lfa -’+B hlds and yc Band there is a8such that A ’ BC
8cRand 8nB=¢ and 8-’ y, thena’yholds.
8 Union rule : ifa ’B holds and a ’ yholds, then a > By holds. B’C
they are equivalent. AKTU 2018-19, Marks07 Answer Fisa minimal set of
cover of aset of FDs
Answer Minimal cover :A minimal is equivalent to F.
functional dependenciesFthat
Partial fun ctional dependency : Refer Q3.3, Page 34A,
Numerical : Unit-3. Numerical :
Given : RA, B, C)
From F, Non-redundant cover for F:
E’AD
on right hand side
E’A(By Decomposition Rule) Step 1:Only one attribute
F=A’ B
E’D B’C
Also given that
A’C
2’H AB ’ B
So, E->AH (By Union Rule) AB ’ C
which is a FD of set G. AC ’ B
Again A’C and AC-’D
Database Management System
Que 3.l8. What is meant by the attribute preservation condition 2 The relation r, , a ... r, is called a universal relation since it
involves all the attributes in the "universe" defined byR, uR, U... UR
on decomposition ? Given relation R(A, B,C,D,E) with the functional
dependencies F= (AB->CD, A’E, C’D), the decomposition of R into 3 Ifdangling tuples are allowed in the database, instead of decomposing a
R,(A, B, CO, R,(B, C, D), R,(C, D, E) check whether the relation is lossy universal relation, we may prefer to synthesize a collection of normal
or lossless. form schemas from a given set of attributes.
Answer
VERY IMPORTANT QUESTIONS
Attribute preservation condition on decomposition:
1 The relational database design algorithms start from a single universal Following questions are very important. These questions
relation schema R=(A, A,, .., A,] that includes all the attributes of the may be asked in your SESSIONALS as
tvell as
database. UNIVERSITY EXAMINATION.
2 We implicitly make the universal relation assumption, which states that
every attribute name is unique.
trivial and non
3. Using the functional dependencies, the algorithms decompose the Q.1. What is functional dependency ? Explain
canonical cover.
universal relation schema Rinto a set of relation schemas D = (R, Ky trivial functional dependency. Define
R) that will become the relational database schema; D is called a Ans: Refer Q. 3.2.
decomposition of R.
Database Management System
4-1A (CSIT-Sem-5)
44A(CSTT-Sem-5)
Transaction Processing Concept
3 Atomicity is handled by transactiOn management component Database Management System 4-5A (CSIT-Sem-5)
Answer
2. Partially committed : A transaction is said to be entered in the
partial state when final statement gets executed. But it is still possible
ACID properties of transaction: Refer Q. 4.2, Page 4 2A, Unit-4 that it may have to be aborted, since its actual operation is still resided
Usefulness of ACID properties : in main memory in which the power failure brings failure of its
execution.
Atomicity : Atomicity is useful to ensure that if for any reason an error 3 Failed : A transaction enters a failed state after the system determines
occurs and the transaction is unable to complete all of its steps, then the that the transaction can no longer proceeds with its normal execution.
SVstem is returned to the state it was in before the transaction was started.
4. Aborted :A transaction enters this state after the transaction has
Consistency: The consistency property is useful to ensure that a complete been rolledback and the database has been restored to its state, prior
execution of transaction from beginning to end is done without interference to the start of the transaction.
of other transactions.
5. Committed : Atransactionenter this state after successful completion.
Isolation :Isolation property is useful to ensure that a transaction should ACID properties with example : Refer Q. 4.2, Page 4-2A, Unit-4.
appear isolated from other transactions, even tho ugh mnany transactions
Que 4.6. How can you implement atomicity in transactions ?
are executing concurrently.
Durability: Durability is useful to ensure that the changes applied to the Answer
database by a committed transaction must persist in the database.
Implementation of atomicity in transaction can be done in two ways :
Que 4.5. 1 Completeness :
Explain transaction state in brief.
Allof the operations encapsulated within adatabase transaction
OR
What is transaction ? Draw a state diagram ofa transaction showin5 represent an atomic unit of work.
its states. Explain ACID properties of a transaction with suitable b. According to atomicity either all of transaction will run to
completion (Commit) or none of them.
examples. |AKTU 2015-16. Marks 10 C. There will not be any partial transaction in left over state
from
OR incomplete execution of one or more operationsina transaction.
Draw a transaction state diagram and describe the states a d. If the user decides to cancel
everything (Rollback), all of the
transaction goes through during execution. changes made by the tran saction will be undone and the state
would be as ifthe transaction never began by using undo operation.
Answer e. For every change made by
data to be used to rollbackoperations
in the database, it logs undo
Transaction : Refer Q. 4.1, Page 4-2A, Unit-4.
State diagram of the effects of operations.
1 Active :
transaction : the final
2. Mutual exclusion/Mocking :
The
transaction is said to be in the active state till a. Only one transaction will be
statement is executed. exclusive lock on the particularallowed to progress
data item.
by taking an
46A(CSTT-Sem-5) Transaction Processing Concept Database Management System 4-7A (CSTT-Sem-5)
The lock will not be released until the transaction ends (either
3. However, if I, andI, refer to the same data item Q. then the order ofthe
through rollback, commit or abort). two steps matter.
C. Any other concurrent transaction interested in updating the same Following are four possible cases :
row will have to wait. 4
Swapping possible
Que 4.7. What is serializability ? Why serializability is required ?
Write short note on serializability of schedule. Read (Q) Read () Yes
Questions-Answers T T.
Long Answer Type and Medium Answer read (A)
Type Questions write (B)
read (A)
read (B)
Que 48. Discuss conflict serializability with write (A)
example. write (B)
Answer read (B)
1 write (B)
Consider a schedule S, in which there are two
2
I, and I, of
transactions T, and T, respectively consecutive
IfI and I, refer to (i j).
instructions Since the write (A) instruction of T, in Schedule Sdoes not conflict
different
affecting the results of any data items, then swap I, and 1, witho
with the read (B) instruction of T,, we can swap these instructions
instruction in
the schedule. to generate an equivalent schedule.
iü. Both schedules will produce the same final system state.
4-8A (CSIT-Sem-5)
Lsaction Processing Concept Database Management System 4-9A (CSTT-Sem-5)
6. If a schedule S can be transformed into a
schedule S by a
swaps of non-conflicting instructions, we say that Sands series of Schedule Sl and S2 are view equivalent as :
equivalent. are conflict 1 T, reads initial value of data item A in Sl and s2.
7 The concept of conflict
equivalence leads to the concept of confict 2 T, reads value of data item A written by T, in S1 and S2.
serializability and the schedule S is conflict serializable.
3 T, writes final value of data item A in Sl and S2.
Que 4.9. Explain view
serializability with example. Que 4.10. What is schedule ? Define the concept of recoverable,
Answer cascadeless and strict schedules.
1 The schedule S and S are said to
be view
three conditions met : equivalent if following Answer
a For each data item Q, if Schedule : A schedule is a set of transaction with the order of exe cution of
in schedule S, then transaction T; reads the initial value of 0 instruction in the transaction.
the initial value of Q.transaction T, in schedule S, must also read Recoverable schedule :
b For each data item Qif Arecoverable schedule is one in which for each pair of transaction T; andT
transaction T,
S and if that value
produced by a writeexecutes read (Q) in schedule
(Q)operation executed
if T,reads a data item previously written by T, the commit operation of T
appears before the commit operation of T;.
transaction then the read (Q) operation
T,
of transaction T, in
by
schedule S,must also read the value of Q that Sor example : In schedule S, let T, commits immediately after executing
the same write (Q) was produced by read (A) ie., T, co-umits before T, does. Now let T, fails before it commits,
For each data itemn operation
of transaction T
C.
Q, the transaction we must abort I, to ensure transaction atomicity. But as T, has already
final write (Q) operation in (if any) that
performs the committed, it cannot be aborted. In this situation, it is impossible to recover
write (Q)operation in
schedule S must perform the final correctly from the failure of T,.
2 schedule S'.
Conditions (a) and (b) ensure that each Schedule S
values in both schedules and transaction reads the same T
therefore, performs
Condition (c), coupled with condition the same
both schedules result in the (a)and condition (b)computation.
ensure that read (A)
3. The same final system state.
concept of view equivalence leads to the write (A)
4
serializability. concept of view read (A)
We say that schedule S is view
5
serial schedule. serializable, ifit is view equivalent to read (B)
Every conflict serializable Cascadeless schedule :
are view schedule is also view serializable but
Example: serializable schedules that are not conflict serializable. there 1. Acascadeless schedule is one, where for each pair of transaction T,
and T, such that T, reads a data item previously written by T, the
Schedule S1 commit operation to T, appears before the read operation of T,
Schedule S2
2 Even if a schedule is recoverable, to recover correctly from the
T. Ti fajlure of a transaction T, we may have to rollback several transactions.
T Such situations occur if transactions have read data written by T;
read (A)
Write (A) read (A) Strict schedule :
read (B) write (A) 1 Aschedule is called strict if everyvalue written by a transaction Tis
write (B) read (A) not read or changed by other transaction until T either aborts or
commits.
read (A) read (B)
write (A)
write (A) 2 Astrict schedule avoids cascading and recoverability.
read (B) write (B)
write (B) read (B)
write (B)
4-11A (CSTT-Sem-5)
410A (CSTT Sem-5) Transaction Processing Concept Database Management System
There is no cycle, so it is serialized. We prefer serializable schedule instead of serial schedule because :
The equivalent serial schedule i_: 1. The problem with serial schedule is that it limits concurrency or
r,*), r,a), w,*), ra), w,() interleaving of operations.
2 In a serial schedule, if a transaction waits for an VOoperation to
Que 4.13. Discuss cascadeless schedule and cascading rollback complete, we cannot switch the CPU processor to another transaction,
Why is cascadeless of schedule desirable ? thus wasting valuable CPU processing time.
3. If some transaction T is quite long, the other transactions must wait
Answer for T' to complete all its operations before committing.
Cascadeless schedule : Refer Q. 4.10, Page 4-9A, Unit-4.
Cascading rollback :Cascading rollback is a phenomenon in which a
Que 4.15. What are schedules ? What are differences between
single failure leads to a series of transaction rollback. conflict serializability and view serializability ? Explain with suitable
example what are cascadeless and recoverable schedules ?
For example:
Schedule S
AKTU2015-16, Marks 10
T Answer
Ts
read (A) Schedule : Refer Q. 4.10, Page 4-9A, Unit-4.
read (B) Differen ce between conflict and view serializability :
write A)
read (A S. No. Conflict serializability View serializability
write (A) 1. Easy to achieve. Diffcult to achieve.
read (A) 2
In the exarnple, transaction T, writes a Cheaper to test. Expensive to test.
T. Transaction T, writes a value of Athatvalue ofA that is read by transaction 3 Every conflict serializable is Every view serializable is not
is read by transaction T,. Suppose view serializable. conflict serializahl
that at this point T, fails. T,must be rolled back.
Since T, is
dependent on T.. T, mustdependent
T,must be rolled back, since T, is on T,, 4. Used in most concurrency Not used in cor.: vcontrol
Need for cascadeless be rolled back. control scheme. scheme.
schedules :
Cascadeless schedules are desirable because the failure of a Cascadeless schedule : Refer Q. 4.13, Page 4-12A, Unit-4.
does not lead to the aborting of any other transaction Recoverable schedule : Refer Q. 4.10, Page 4 9A, Unit-4.
cost of less
concurrency. transaction. This comes at the
Que 4.14. Que 4.16. What is schedule ? What are its types ? Explain view
Discuss the rules to be
serializable schedule. Why should we followed
prefer
while preparing a serializable and cascadeless schedule with suitable example of each.
instead of serial schedules ? serializable schedules AKTU2018-19, Marks 07
Answer
The set of rules
schedule are : which mnust be followed for preparing serializable Scheduie : Refer Q. 4.10, Page 4-9A, Unit-4.
Types of schedule are :
1. Take any
concurrent 1 Recoverable schedule
2
Draw the precedence schedule.
graph for concurrent
2 Cascadeless schedule
3 3 Strict schedule
Ifthere is a cycle in precedence graph
4. If there is no
schedule.
then schedule is not View serializable : Refer Q. 4.9, Page 4 8A, Unit-4.
cycle the schedule serializable.
is serializable. Cascadeless schedule : Refer Q. 4.10, Page 4-9A, Unit-4.
5
Prepare serializable schedule using precedence graph.
414A(CSTTSem-5)
Transaction Processing Concent Database Management System
4-15 A (CSTT-Sem-5)
T, T,
rlr)
r3()
w3x) Fig. 4.17.3.
wlir)
it is not conflict serializable.
r2) Since, the graph contains cycle. Hence,
PART-3
Questions-Answers
5
manage with less memory space.
Locks are released after
Que 4.19.
modification.
Describe shadow paging recovery
technique. Fig. 4.19.1. Shadow paging
AKTU2016-17. Marks 05
4-18 A(CSTT-Sem-5)
Transaction Processing Concept 4-19 A (CSTT-Sem-5)
When shadow paging does not require log: Database Management System
It does not require the use of log in an environment where
only one Steps for log based recovery :
is active at a time.
transaction 1 The log file is kept on a
stable storage media.
execution, it writes a
Que 4.20. What do you mean by the system and starts
important types of checkpointing methods. checkpointing ? Explain 2 When a transaction enters
log about it
<T,, start>
follows
Answer an item X, it write log as
3 When the transaction modifies
Checkpointing : <T, X, V, V>
1. Itis a process of saving a snapshot of the the value of X, from V, to V,.
application's state, so that it
can restart from that point in case of failure. It reads as T, has changed
finishes, it logs
2. Checkpoint is a point of time at 4 When the transaction
which a record is written onto the <T,, commit>
database from the buffers.
3. Checkpointing shortens the For example :
Types of checkpointing recovery process. <T, start>
1. techniques
:
<To, A, 0, 10>
Consistent checkpointing :
a.
Consistent checkpointing creates a consistent imageof the <Ty, commit>
at checkpoint. database <T,, start>
b. During recovery, only those <T,, B, 0, 10>
last checkpoint are undone ortransactions which take place after <T, start>
C.
The transactions that take place redone.
<T,, C, 0, 10>
checkpoint are already committed and before the last consistent
need not be processed <T, C, 10, 20>
d The
actions taken for check pointing are: again.
i.
<checkpoint (T,, T,)>
All changes in
disk. main-memory buffers are written onto tne <T, start>
ii. <T, A, 10, 20>
i. The
A"checkpoint" record is written in the transaction log. <T, D,0, 10>
2. Fuzzy transaction: log is written to the disk. <T, commit>
checkpointing
In fuzzy Describe the important types of recovery
techniques.
b transactions
In case of
checkpoi nting, atin thethe log.time of checkpoint, all the active
are written
Que 4.22.
Explain their advantages and disadvantages.
failure, the recovery
C transactions
The that were active manager processes only those
during checkpoint and later. Answer
transactions
written the diskthatandhave been committed before checkpoint are
to There are many different database recovery
techniques to recover a database:
4-15A, Unit-4.
Que 4.21. What is hence need not be Deferred update recovery: Refer Q. 4.18, Page
log file? redone. 1.
Advantages :
of a Write the steps for log based recovery
system with suitable a Recovery is easy.
transaction
example. AKTU2018-19, Marks 07 b Cascading rollback does not occur because no other
Answer sees the work of another until it is
committed.
Log file :Alog file is Disadvantages :
afile
database. that records all the update occur in the a. Concurrency is limited.
activities Immediate update recovery :Refer Q4.18, Page 4-15A,
Unit-4.
2
4-20 A (CSTT-Sem-5)
Transaction Processing Concept Database Management System
4-21 A (CSIT-Sem-5)
schemes.
Que 4.24. Discuss about the deadlock prevention Answer
2
Replication is a key to the effectiveness of distributed lsystems in that, it Passive replication
provides enhanced performance, high availability and high fault tolerance. Client
8 The replication is the maintenance of copies of dataat multiple computers
4 Replication is a technique for enhancing a service.
5 When data are replicated, the replication transparency is required ie.
cients should not normally have to be aware that multiple copies of data Process Process
Process
exist.
Types of replication :
L Active replication : (State State) State)
1 In active replication each chent request is processed by all the servers. Server Server Server
2 This requires that the process hosted by the servers is deterministic, Fig. 4.28.2.
Le., given the same initial state and arequest sequence, all processes
willproduce the same response sequence and end up in the samne Que 4.29. Explain data fragmentation with types.
final state. |AKTU 2017-18, Marks 1O
Active replication
Client Answer
Fragmentation :
1 It is the decomposition of a relation into fragments.
2 It permits to divide a single query into a set of multiple sub-queries that
Process Process Process can execute parallelon fragments.
3 Fragmentation is done according to the data selection patterns of
applications running on the database.
State State) State)
Fragmentation techniques/types are as follows :
Server Server Server 1 Vertical fragmentation :
Fig. 4.28.1.
3 In order to make all the
a. It divides a relation into fragments which contain a subset of
servers receive the same attributes of a relation along with the primary key attribute of the
operations, an atomic broadcast protocol must be used.sequence
of
relation.
4 An atomic broadcast protocol
guarantees that either all the servers
receive a message or none, plus that they all receive Name Reg. No. Course Dept
the same order. messages in
ii. Passive replication :
1 Fragmentation1 Fragmentation2| Fragmentation3
In passive replication there is only one
processes client requests. server (called primary) un
2.
After processing arequest, the primary server updates the state on
the other (backup) servers and sends back the Fig. 4.29.1. Vertical fragmentation.
client. response to e b The purpose of vertical fragmentation is to partition a relation
3. If the primary
server fails, one of the backup servers takes its into a set of smaller relations to enable user applications to run on
place. only one fragment.
4
Passive
processes.replication may be used even for non-deterministic
4-28 A (CSTT-Sem-5) Transaction Processing Concept Database Management System 4-29 A (CSIT-Sem-5)
2
Horizontal fragmentation : with a suitable example, what are the differences in replication and
It divides a relation into fragments along its tuples. Each fragment fragmentation transparency ? AKTU 2015-16, Marks 10
is a subset of tuples of a relation. OR
b
It identifies some specific rows based on some criteria and marks it Explain the types of distributed data storage.
as a fragment. OR
Name Reg. No. Course Depth What are distributed database? List advan tage and disadvantage
of data replication and data fragmentation.
Fragmentation 1
AKTU2019-20, Marks 07
Fragmentation2
Fragmentation3 Answer
Fragmentation4 Distributed database : Refer Q. 4.26, Page 4-23A, Unit-4.
Fig. 4.29.2. Horizontal fragmentation. Advantages of data replication :
C Various horizontal fragmentation techniques are : Availability : If one of the sites containing relation r fails, then the
Primary hori~ontal fragmentation : This type of relation r can be found in another site. Thus, the system can continue to
fragmentation is done where the tables in a database are process queries involving 'r', despite the failure of one site.
neither joinednor have dependencies. So, no relationship exists ii. Increased parallelism : Number of transactions can read relation r in
among the tables. parallel. The more replicas of r there are, the greater parallelism is
achieved.
ii. Derived horizontal fragmentation : Derived horizontal
fragmentation is used for parent relation. It is used where Disadvantages of data replication :
tables are interlinked with the help of foreign keys. It ensures i. Increased overhead on update : The system must ensure that all
that the fragments which are joined together are put on the replicas ofarelation r are consistent; otherwise, erroneous computation
same site. may result Thus, whenever r is updated, the update must be propagated
3
Hybrid/mixed fragmentation : to all sites containing replicas. The result is increased overhead.
a.
The mixed/hy iridfragmentation is combination of horizontal and Advantages of data fragmentation :
vertical fragmentations. L Parallelized execution of queries by different sites is possible.
b This type is most complex one, because both types are used in Data management is easy as fragments are smaller compare to the
horizontal and vertical fragmnentation of the DB application. complete database.
C
The original relation is obtained back by join or union operations. Increased availability of data to the users/queries that are local to the
R site in which the data stored.
iv. As the data is available close to the place where it is most frequently
HF HF used, the efficiency of the system in terms of query processing,
R
transaction processing is increased.
VP
V
Data that are not required by local applications are not stored locally. It
VE VF leads to reduced data transfer between sites, and increased security.
VF VF
Disadvantages of data fragmentation :
Rz1 Rg2 The performance of global application that requires data from several
Fig. 4.289.3.
Hybrid/mixed fragmentation. fragments located at different sites may be slower.
Que 4.30. What are Integrity control may be more difficult ifdata and functional dependencies
disadvantages of data distributed database ? List advantages arnd are fragmented and located at different sites.
replieation and data fragmentation. Explain
4-30 A
(CNTT-Sem-5) Transaction Processing Concept Database Management Systenm 4-31A(CSIT-Sem-5)
Differences in replication and fragmentation transpareney:
8 No.Replication transpareney Pragmentation transparency Questions-Answers
It involves placing copies of Itinvolves decomposition ofa table
Long Answer Type and Medium Answer Type Questions
1
each table or each of their in many tables in the system.
fragments on more than one
site in the system.
Que 4.32. What is coneurrency control ? Why it is
needed in
2 The user does not know The user does not know about.
about how many replicas of how relation is divided/ database system.
the relation are present in fragmented in the system. OR
system ?
the system. Explain concurrency control. Why it is needed in database
3 For example, if relation r is For example, if relation r is AKTU2019-20, Marks 07
replicated, a copy of relation fragmented, 'r is divided into a
r is stored in two or more number of fragments. These Answer
sites. In extrene case, a copy fragments contain sufficient 1 Concurrency Control (CC) is a process to ensure that data is updated
is stored in every site in the information to allow correctly and appropriately when multiple transactions are concurrently
system which is calledas full reconstruction of the original executed in DBMS.
replication. relation 'r. more database
2. It is a mechanism for correctness when two or
executed
There are two types of distributed data storage : transactions that access the same data or dataset are
concurrently with time overlap.
L Data fragmentation :Refer Q. 4.29, Page 4-27A, Unit-4. transaction
2 Data rcplication : Refer Q.4.28, Page 4-25A, Unit-4. 3 In general, concurrency control is an essential part of
management.
Que 431. Discuss the types of distributed database. Concurrency control is needed :
1 To ensure consistency in the database.
Answer
2. To prevent following problem:
Distributed databases are classified as: a. Lost update :
1. Homogeneous distributed database : 1 A second transaction writes a second value of a data item
on
In this, all sites have identical database top of a first value written by a first concurrent transaction,
management system and the first value is lost to other transactions running
software.
b All sites are aware of one another, and agree to
concurrently which need, by their precedence, to read the
co-operate in first value.
processing user's requests. The transactions that have read the wrongg value end with
2
Heterogeneous distributed database: incorrect results.
In this, different sites may use
different schemas, and differen b. Dirty read :
database management system software. i Transactions read a value written by a transaction that has
b The sites may not be aware of
one another, and they may provide been later aborted.
only limited facilities for This value disappears from the database upon abort, and should
co-operation in transaction proceSsins
not have been read by any transaction ("dirty read").
PART-6 The reading transactions end with incorrect results.
iii.
Concurrent Control, Directory System. Que 4.33. Explain coneurrency control mechanism performed in
distributed databases ?
432A (CSTT-Sem-5)
Transaction Processing Concept Database Management Systemn 4-33 A (CSTT-Sem-5)
Answer
2 Atransaction can acquire a lock on object Oin some mode M.
Following are concurrency control mechanism in Doing that, it holds the lock in mode Muntil its termination.
database :
Two-phase commit protocol :
distributed 3
4 Besides holding a lock, a transaction can retain a lock in mode M.
Two-phase
designed to allowany participant to abort its part ofcommit protocol is 5 When a subtransaction commits, its parent transaction inherits its
the requirement for atomicity, if one part of a transaction. Due to locks and then retains them. Ifatransaction holds a lock, it has the
then the whole transaction must also be aborted. transaction is aborted right to access the locked object (in the corresponding mode).
However, the same is not true for retained locks,
Following are the two phase used in this protocol: 6
Phase 1 (voting phase): 7. Aretained lock is only a place holder and indicates that transactions
outside the hierarchy of the retainer cannot acquire the lock, but
1 The co-ordinator sends a that descendants potentially can.
canComnmit? request to each of the
participants in the transaction.
8. As soon as a transaction becomes a retainer of a lock, it remains a
2 When a participant receives retainer for the lock until it terminates.
vote (Yes or No) to the canCommit? request it replies with its
co-ordinator. Before voting Yes, it prepares
to commit by saving objects Que 4.33. Explain directory system in detail.
in permanent storage. Ifthe vote is No,
the participant aborts immediately. AKTU 2019-20, Marks 07
Phase 2(eompletion according to outcome of vote):
1 The co-ordinator collects the votes
(including its own). Answer
Ifthere are no failures and all the votes are Yes the
co-ordinator 1 directory is a listing of information about some class ofobjects such
A
decides to commit the transaction and sends a doCommit as persons.
request each of the participants.
to 2 Directories can be used to find information about a specific object,or in
b
Otherwise the co-ordinator decides to abort the the reverse direction to find objects that meet a certain requirement.
and sends doAbort requests to all transaction In the networked world, the directories are present over a computer
2 Participants that voted Yes are participants that voted Yes. 3
network, rather than in a physical (paper) form.
waiting for a doCommit or doAbort which
request from the co-ordinator. When a 4 Adirectory system is implemented as one of more servers,
these messages it acts accordingly and inparticipant receives one of
the case of commnit, makes service multiple clients.
a the
haveCommittedcalls as confirmation to the
co-ordinator. 5 Clients use the application programmer interface defined by
directory system to communicate with the directory servers.
Co-ordinator
Btatus Participant Directory access protocols :
step status step 1. Directory access protocol is a protocol that allows to access directory
prepared to comnit canCommit? information through program.
access control.
(waiting for votes) prepared to 2 Directory access protocols also define a data model and
Yes commit web browsers can store personal bookmarks and other
3. For instance, user can thus access the
(uncertain) browser settings in a directory system. A
doCommit homne and at work,
eommitted
done committed
same settings from multiple locations,
without having to share a file systemn.
such as at
have Committed 4
Pig. 4.2a.2.
1
Moss
coneurreney Communi estion in two phnse comnit protocol.
control
control protocol
Moss
on the eoneurreney protocol for nested transactions is based
concept of upward
inheritance of locks.