DBMS Unit 4 Part 2 Transaction Processing Concept

Que4.11. What’s priority graph? How can it be used to test the conflict serializability of a schedule? Answer Priority graph 1. A priority graph is a directed graph G = ( N, E) that consists of set of bumps N = { T1, T2,., Tn} and set of directed edges E = ( e1,e2., em). 2. There’s one knot in the graph for each sale Ti in the schedule. 3. Each edge ei in the graph is of the form( Tj Tk), 1 j n, 1 k n, where Tj is the starting knot of ei and Tk is the ending knot of ei. 4. Such an edge is created if one of the operations in Tj appears in the schedule before some disagreeing operation in Tk. Algorithm for testing conflict serializability of schedule S a. For each sale Ti sharing in schedule S, produce a knot labeled Ti in the priority graph. b. For each case in S where Tj executes aread_item( X) after Ti executes awrite_item( X), produce an edge( Ti Tj) in the priority graph. c. For each case in S where Tj executes awrite_item( X) after Ti executesread_item( X), produce an edge( Ti Tj) in the priority graph. d. For each case in S where Tj executes awrite_item( X) after Ti executes awrite_item( X), produce an edge( Ti Tj) in the priority graph. e. The schedule S is serializable if and only if the priority graph has no cycles. 5. The priority graph is constructed as described in given algorithm. 6. still, schedule S isn’t( conflict) If there’s a cycle in the priority graph. serializable; if there’s no cycle, S is serializable. 7. In the priority graph, and edge from Ti to Tj means that sale Ti must come ahead sale Tj in any periodical schedule that is original to S, because two disagreeing operations appear in the schedule in that order. 8. still, we can produce an original If there’s no cycle in the priority graph. periodical schedule S that’s original to S, by ordering the deals that share in S as follows Whenever an edge exists in the priority graph from Ti to Tj, Ti must appear before Tj in the original periodical schedule S. Que4.13. bandy cascadeless schedule and slinging rollback. Why is cascadeless of schedule desirable? Answer Cascadeless schedule Refer

Q.4.10, runner 4 – 9A, Unit- 4. Cascading rollback Slinging rollback is a miracle in which a single failure leads to a series of sale rollback. For illustration Schedule S In the illustration, sale T1 writes a value of A that’s read by sale T2. sale T2 writes a value of A that’s read by sale T3. Suppose that at this point T1 fails. T1 must be rolled back. Since T2 is dependent on T1, T2 must be rolled back, since T3 is dependent on T2, T3 must be rolled back. Need for cascadeless schedules Cascadeless schedules are desirable because the failure of a sale does not lead to the aborting of any other sale. This comes at the cost of lower concurrency.

Que4.14. bandy the rules to be followed while preparing a serializable schedule. Why should we prefer serializable schedules rather of periodical schedules? Answer The set of rules which must be followed for preparing serializable schedule are 1. Take any concurrent schedule. 2. Draw the priority graph for concurrent schedule. 3. If there’s a cycle in priority graph also schedule isn’t serializable. 4. If there’s no cycle the schedule is serializable. 5. Prepare serializable schedule using priority graph. We prefer serializable schedule rather of periodical schedule because 1. The problem with periodical schedule is that it limits concurrency or interleaving of operations. 2. In a periodical schedule, if a sale waits for an I/ O operation to complete, we can not switch the CPU processor to another sale, therefore wasting precious CPU processing time. 3. still, the other deals must stay If some sale T is relatively long. for T to complete all its operations before committing. Que4.18. Explain log grounded recovery. OR What’s log? How is it maintained? bandy the features of remitted database revision and immediate database revision in detail. Answer 1. The log/ system log is a sequence of log records, recording all the update conditioning in the database. 2. colorful types of log records are denoted as a. sale Ti has started. < Ti, Xj, V1, V2> sale Ti has performed a write on data item Xj. Xj had value V1 before the write, and will have value V2 after the write. c. sale Ti has committed. d. sale Ti has abandoned. 3. Whenever a sale performs a write, it’s essential that the log record for that write be created before the database is modified. Log grounded recovery Log grounded recovery is a system to insure atomicity using log when failure occurs. In log grounded recovery, following two ways are used to insure atomicity and to maintain log 1. Prolonged database revision i. The remitted database revision fashion ensures sale atomicity by recording all database variations in the log, but postponing the prosecution of all write operations of a sale until the sale incompletely commits. ii When a sale incompletely commits, the information on the log associated with the sale is used in executing the remitted writes. Features of remitted database revision 1. All logs written onto the database is streamlined when a sale commits. 2. It doesn’t bear old value of data item on the log. 3. It don’t need redundant I/ O operation before commit time. 4. It can manage with large memory space. 5. Cinches are held till the commit point. 2. Immediate database revision i. The immediate database revision fashion allows database variations to be affair to the database while the sale is still in the active state. ii. Data revision written by active deals. Features of immediate database revision 1. All logs written onto the database is streamlined incontinently after every operation. 2. It requires both old and new value of data item on the log. 3. It needs redundant I/ O operation to flush out block- buffer. 4. It can manage with lower memory space. 5. Cinches are released after revision. Que4.19. Describe shadow paging recovery fashion. Answer 1. Shadow paging is a fashion in which multiple clones( known as shadow clones) of the data item to be modified are maintained on the fragment. 2. Shadow paging considers the database to be made up of fixed- size logical units of storehouse called runners. 3. These runners are counterplotted into physical blocks of storehouse with the help of runner table( or directory). 4. The physical blocks are of the same size as that of the logical blocks. 5. A runner table with n entries is constructed in which the ith entry in the runner table points to the ith database runner on the fragment as shown in 4.19.1. 6. The main idea behind this fashion is to maintain two runner tables. a. In current runner the entries points to the most recent database runners on the fragment. When a sale starts, the current runner table is copied into a shadow runner table( or shadow directory). b. The shadow runner table is also saved on the fragment and the current runner table is used by the sale. The shadow runner table is noway modified during the prosecution of the sale. Que4.20. What do you mean by checkpointing? Explain important types of checkpointing styles. Answer Checkpointing 1. It’s a process of saving a shot of the operation’s state, so that it can renew from that point in case of failure. 2. Checkpoint is a point of time at which a record is written onto the database from the buffers. 3. Checkpointing shortens the recovery process. Types of checkpointing ways 1. harmonious checkpointing harmonious checkpointing creates a harmonious image of the database at checkpoint. b. During recovery, only those deals which take place after last checkpoint are undone or redone. c. The deals that take place before the last harmonious checkpoint are formerly committed and need not be reused again. d. The conduct taken for checkpointing are i. All changes in main- memory buffers are written onto the fragment. ii. A “ checkpoint ” record is written in the sale log. iii. The sale log is written to the fragment. 2. Fuzzy checkpointing a. In fuzzy checkpointing, at the time of checkpoint, all the active deals are written in the log. b. In case of failure, the recovery director processes only those deals that were active during checkpoint and latterly. c. The deals that have been committed before checkpoint are written to the fragment and hence need not be redone.

Leave a Comment