Database Management Systems-0106 by besube

VIEWS: 436 PAGES: 13

									Suggested Answers with Examiner's Feedback                                                                      Page 1 of 13




                            Question Paper
            Database Management Systems (MC141) : January 2006
                                 Section A : Basic Concepts (30 Marks)
                     •   This section consists of questions with serial number 1 - 30.
                     •   Answer all questions.
                     •   Each question carries one mark.
                     •   Maximum time for answering Section A is 30 Minutes.


                                                                                                                   < Answer >
 1.   What are “Raw” facts such as telephone number, birth date, sales value etc are called?
      (a) Record              (b) Data                 (c) File                 (d) Field          (e)
      Information
 2.   Which of the following models is concerned with what is represented in the database, rather than how it < Answer >
      is represented?
      (a) Conceptual model                            (b) View model                           (c) Physical
      model
      (d) External model                               (e) Implementation model.
                                                                                                                   < Answer >
 3.   Which of the following is not a component of storage manager?
      (a) Authorization and integrity manager        (b) Transaction manager
      (c) File manager                                  (d) Buffer manager               (e) Query evaluation
      engine.
                                                                                                                   < Answer >
 4.   Which of the following specifies that an entity can be a member of only one subtype at a time?
      (a) Removal             (b) Exclusion           (c) Disjoint             (d) Inclusion       (e)
      Overlapping.
                                                                                                                   < Answer >
 5.   For the following diagram, which answer is true?


                                                    Works_in




        Supervises           EMPLOYEE                                DEPARTMENT




                                                     Manages


      (a)    Each employee can supervise 1 to many employees
      (b)    Each employee can manage many departments
      (c)    Each employee works in one department
      (d)    Both (a) and (b) above
      (e)    Both (a) and (c) above.
                                                                                                                   < Answer >
 6.   Which of the following is the relationship between two instances of a single or same entity type?
      (a) Binary              (b) Tertiary            (c) Primary               (d) Ternary               (e)
      Unary.
                                                                                                                   < Answer >
 7.   On which of the following options the Hierarchical database model is based?




file://C:\WINDOWS\Desktop\Professional\MC141-0106.htm                                                                3/17/06
Suggested Answers with Examiner's Feedback                                                                     Page 2 of 13



       (a) Tree structure                                (b) Graph structure
       (c) Relational model                               (d) Physical model
       (e) Linear lists.
                                                                                                                  < Answer >
 8.    Which of the following options depicts the organization of data in a relational database?
       (a) A collection of records                      (b) A collection of common fields
       (c) Elements                                       (d) Tables                                     (e)
       Objects.
                                                                                                                  < Answer >
 9.    Which of the following relational operations yields all values from selected attributes?
       (a) Difference           (b) Product             (c) Select              (d) Project           (e)
       Join.
                                                                                                                  < Answer >
 10. Consider the relation pt_works(emp_name, branch_name, salary):
       Which of the following is the correct relational algebra expression for finding the maximum salary for
       part-time employees at each branch?
       (a) branch_name g max(salary)                (b) branch_name g max(salary) (pt_works)
       (c) g max (salary) (pt_works)             (d) branch_name g sum(salary) (pt_works)
       (e) branch_name G max(salary) (pt_works).
                                                                                                                  < Answer >
 11. A foreign key must
       (a)   Be numeric
       (b)   Be unique
       (c)   Be defined in all tables within the database
       (d)   Match the field value of a primary key in a related table
       (e)   Contain only one attribute.
 12. Within a table, the primary key must be unique so that it will identify each row. Which of the following < Answer >
     constraints exhibits the above criterion?
       (a) Referential integrity                         (b) Entity integrity
       (c) Enforced integrity                            (d) Domain integrity
       (e) Check integrity.
 13. You want the contents of the PRODUCT table listed by P_Price in ascending order listing P_CODE, < Answer >
     P_DESCRIPT, P_INDATE, and P_PRICE and with P_INDATE < ‘8-oct-05’.
       The command will be
       (a) Select p_code, p_descript, p_indate, p_price from product where P_INDATE < ‘8-oct-05’
            sequence by p_price;
       (b) Select p_code, p_descript, p_indate, p_price from product where P_INDATE < ‘8-oct-05’ list by
            p_price;
       (c) Select p_code, p_descript, p_indate, p_price from product order by p_price asc where P_INDATE
            < ‘8-oct-05’;
       (d) Select p_code, p_descript, p_indate, p_price from product where P_INDATE < ‘8-oct-05’
            ascending by p_price;
       (e) Select p_code, p_descript, p_indate, p_price from product where P_INDATE < ‘8-oct-05’order by
            p_price asc.

                                                                                                                  < Answer >
 14.




       In the above the relation A,B,C,D are the attributes and (A,B) are the key attributes. The arrows
       represent the functional dependencies. Which of the following statements is true based upon the above




file://C:\WINDOWS\Desktop\Professional\MC141-0106.htm                                                               3/17/06
Suggested Answers with Examiner's Feedback                                                                      Page 3 of 13



      diagram?
      (a) The above relation has partial dependency      (b) The above relation is not in 1NF
      (c) The above relation is not in 2NF                 (d) The above relation is in BCNF
      (e) The above relation is in 3NF, but not in BCNF.
                                                                                                                   < Answer >
 15. Which of the following structures eliminates the redundant storage of search key values in B+ trees?
      (a) B-Trees                                         (b) Indexed sequential file           (c) AVL trees
      (d) Hash structure                                (e) Graph structure.
                                                                                                                   < Answer >
 16. Which of the following is referred to as a sequential storage device?
      (a) Tape storage                                  (b) Flash memory
      (c) Optical storage                               (d) Cache                               (e) Main
      memory.
                                                                                                                   < Answer >
 17. Which of the following statements is false with respect to the storage of the database?
      (a)    A database is mapped into a number of different files, which are maintained by the underlying
            operating system
      (b)   Each file is partitioned into fixed-length storage units called blocks
      (c)    A major goal of database system is to maximize the number of block transfers between disk and
            memory
      (d)   Both (a) and (b) false
      (e)    Both (b) and (c) false.
 18. In order to maintain transactional integrity and database consistency, what technology does a DBMS < Answer >
     deploy?
      (a) Triggers              (b) Pointers            (c) Locks                 (d) Cursors       (e)
      Deadlocks.
                                                                                                                   < Answer >
 19. A lock that allows concurrent transactions to access different rows of the same table is known as a
      (a) Database-level lock                           (b) Table-level lock
      (c) Page-level lock                                (d) Row-level lock
      (e) Field-level lock.
                                                                                                                   < Answer >
 20. Which of the following is/are reason(s) for the existence of variable length records in database systems?
      (a)   Storage of multiple record types in a file
      (b)   Record types that allow variable lengths for one or more fields
      (c)   Record types that allow repeating fields
      (d)   All of the above
      (e)   None of the above.
 21. Which of the following are the indices based on the uniform distribution of values across a range of < Answer >
     buckets?
      (a) Hash indices                                  (b) Ordered indices
      (c) Primary indices                                (d) Dense indices
      (e) Sparse indices.
                                                                                                                   < Answer >
 22. Which of the following statements is/are false with regard to indices?
      (a)   Sparse index appears for only some of the search key values
      (b)   Primary indices are also called clustering indices
      (c)   Secondary indices can be sparse
      (d)   Multilevel indices are created if the search time to find an entry is very low
      (e)   Both (c) and (d) false.
                                                                                                                   < Answer >
 23. Which of the following gives the state of the transaction after the final statement has been executed?
      (a) Active                                         (b) Partially committed
      (c) Failed                                         (d) Aborted                                 (e)
      Committed.
                                                                                                                   < Answer >
 24. The syntax of the users query is verified by the
      (a) Parser                                         (b) The database manager




file://C:\WINDOWS\Desktop\Professional\MC141-0106.htm                                                                3/17/06
Suggested Answers with Examiner's Feedback                                                                     Page 4 of 13



      (c) Query optimizer                                (d) Database administrator
      (e) Programmer.
                                                                                                                   < Answer >
 25. Which of the following are introduced to reduce the overheads caused by the log-based recovery?
      (a) Checkpoints          (b) Indices             (c) Deadlocks            (d) Locks              (e)
      Keys.
                                                                                                                   < Answer >
 26. Which of the following protocols ensures conflict serializability and safety from deadlocks?
      (a) Two-phase locking protocol                   (b) Time-stamp ordering protocol
      (c) Graph based protocol                          (d) Both (a) and (b) above
      (e) Both (b) and (c) above.
                                                                                                                   < Answer >
 27. Which of the following is the block that is not permitted to be written back to the disk?
      (a) Dead code            (b) Read only            (c) Pinned               (d) Zapped      (e) Restricted.
                                                                                                                   < Answer >
 28. If transaction Ti gets an explicit lock on the file Fc in exclusive mode, then it has an
     __________ on all the records belonging to that file.
      (a) Explicit lock in exclusive mode                (b) Implicit lock in shared mode
      (c) Explicit lock in shared mode.                 (d) Implicit lock in exclusive mode.
      (e) Implicit lock in implicit mode.
                                                                                                                   < Answer >
 29. The schemes Wait-die and wound-wait are used for?
      (a) Deadlock prevention                           (b) Deadlock detection
      (c) Deadlock recovery                              (d) Deadlock creation
      (e) Deadlock obstruction.
 30. Which of the following is a stored procedure that Oracle automatically fires under appropriate < Answer >
     conditions?
      (a) Assertion                                      (b) Constraint                                  (c)
      Function
      (d) Recursive function                            (e) Trigger.


                                                END OF SECTION A




file://C:\WINDOWS\Desktop\Professional\MC141-0106.htm                                                                3/17/06
Suggested Answers with Examiner's Feedback                                                                    Page 5 of 13




                                           Section B : Problems (50 Marks)
                       This section consists of questions with serial number 1 – 5.
                       Answer all questions.
                       Marks are indicated against each question.
                       Detailed workings should form part of your answer.
                       Do not spend more than 110 - 120 minutes on Section B.

  1.     JobSearch.com is an internet based company. The company provides information about opened positions to
       students looking for a job and in the same time provides information about candidates to the companies. Both
       companies and the students can access the database. Students access the database to post their resume and look for
       opened positions in their area of study. Companies access the database to post their job openings as well as to look
       for the candidates that best fit their needs. For every student the following information is kept in the database:
       student identification number, name, birthday, telephone number, address, e-mail address, gender, country of
       citizenship, immigration status, university, major department, degree program, skills. For every company the
       following information is recorded: name, address (street, city, state, zip code), telephone number, website address,
       and industry. When a job opening is submitted, the companies specify the following: posted date, job description,
       type of job (full time, part time, co-op etc.), and number of openings. A contact person that works with the
       company looks into the database, chooses candidates, schedules the interviews and interviews the students.
       Draw an E-R diagram for the JobSearch.com database. Clearly state any assumptions you make
                                                                                                     (10 marks) < Answer >
  2.   Suppose that a query optimizer has a rewrite rule that translates a query of the form
                select <select-list>
                from R
                where <condition1> OR <condition2>
                into a query of the form
                select <select-list>
                from R
                where <condition1>
                union all
                select <select-list>
                from R
                where <condition2>
        Give a simple counterexample that shows that this rewrite is not, in general, correct. Also, modify this rule so
       that it correctly translates an "OR" query of the first form into a UNION query similar to the second form.
       Assume that <condition1> and <condition2> never evaluate to NULL.
                                                                                                     (10 marks) < Answer >
  3.   Studentsinfo(Sno, Sname, gender, Date_of_birth, address, course_code)// Sno is the primary key
       Course(course_code,course_name, Duration) course_code is the primary key, Duration should be in months.
       Solve the following queries based on the above the schema:
       a.    Display the details of the Students along with the course_name.
       b.   Display all the details of the students who were born in the year 1981.
       c.    Display the age of the students along with their Student number and names.
       d.    Display all the students who opted for ‘DBMS’ and ‘NETWORKS’. Solve this query using the concept of
            inner query.
                                                                                    (2 + 2 + 3 + 3 = 10 marks) < Answer >
  4.    Suppose that we are using an extendible hashing on a file that contains records with the following search-key
       values:
            2,3,5,7,11,17,19,23,29,31




file://C:\WINDOWS\Desktop\Professional\MC141-0106.htm                                                               3/17/06
Suggested Answers with Examiner's Feedback                                                                      Page 6 of 13



        Construct the extendible hash structure for this file if the hash function is h(x) = x mod 8 and the buckets can hold
       three records.
                                                                                                       (10 marks) < Answer >
  5.   The schema of an internet shop is given under:
       Books(isbn,title,author_no,qty_in_stock,price,year_published, author_address, author_phone)
       Customers(cid, cname, c_address)
       Orders(ordernum, isbn, cid, credit_cardnum, qty, order_date, ship_date)
       a.    List out the functional dependencies of each relation.
       b.    Refine the schema using normalization until the schema is in 3NF.
                                                                                               (4 + 6 = 10 marks) < Answer >




                                                   END OF SECTION B


                                     Section C : Applied Theory (20 Marks)
                        This section consists of questions with serial number 6 - 7.
                        Answer all questions.
                        Marks are indicated against each question.
                        Do not spend more than 25 -30 minutes on section C.


  6.   Explain shadow-paging technique with a neat diagram and explain how the data is effectively recovered?
                                                                                                       (10 marks) < Answer >
  7.   What are deadlocks? Give a brief description of deadlock prevention and detection mechanisms?
                                                                                                       (10 marks) < Answer >
                                                   END OF SECTION C

                                              END OF QUESTION PAPER




                           Suggested Answers
            Database Management Systems (MC141) : January 2006
                                              Section A: Basic Concepts
                   1.   Answer : (b)                                                                   < TOP
                                                                                                           >
                        Reason :  “Raw” facts are called data.
                   2.   Answer : (a)                                                                   < TOP
                                                                                                           >
                        Reason :  Conceptual model is concerned with the logical details(what is
                                 represented ) of the database.
                   3.   Answer : (e)                                                                   < TOP
                                                                                                           >
                        Reason : Query evaluation is not a part of the strorage manager.It is a
                                 pat of the query processor.
                   4.   Answer : (c)                                                                   < TOP




file://C:\WINDOWS\Desktop\Professional\MC141-0106.htm                                                                 3/17/06
Suggested Answers with Examiner's Feedback                                                                   Page 7 of 13



                    Reason :   Disjoint rule is a constraint of specialiazation.                        >

               5.   Answer :   (e)                                                                   < TOP
                                                                                                         >
                    Reason :   Both a and c are correct.
               6.   Answer :   (e)                                                                   < TOP
                                                                                                         >
                    Reason :   A relationship between the instances of a single entity type is
                               called a unary relationship.
               7.   Answer :   (a)                                                                   < TOP
                                                                                                         >
                    Reason :   The Hierarchical database model is based on tree structure.
               8.   Answer :   (d)                                                                   < TOP
                                                                                                         >
                    Reason :   In a relational database data is organized as tables.
               9.   Answer :   (c)                                                                   < TOP
                                                                                                         >
                    Reason :   A Relational operator that yields all values from selected
                               attributes is known as a select operator.
               10. Answer :    (b)                                                                   < TOP
                                                                                                         >
                   Reason :    brach_name g max(salary) (pt_works) is the correct syntax.
               11. Answer :    (d)                                                                   < TOP
                                                                                                         >
                   Reason :     (d) is the correct option.
               12. Answer :    (b)                                                                   < TOP
                                                                                                         >
                   Reason :     When there is a primary key table is said to exhibit entity
                               integrity.
               13. Answer :    (e)                                                                   < TOP
                                                                                                         >
                   Reason :     (e) is the correct syntax for the query.
               14. Answer :    (e)                                                                   < TOP
                                                                                                         >
                   Reason :     A relation is said to be in BCNF if all the FDs are either trivial
                               or the determinant is a candidate key. In C• B, C is not a
                               candidate key. So the relation is not in BCNF. Since no
                               transitive dependencies are not there and it is in the 2NF the
                               relation is in 3NF.
               15. Answer :    (a)                                                                   < TOP
                                                                                                         >
                   Reason :      The redundant storage of search key values in B+ trees is
                               eliminated in B Trees.
               16. Answer :    (a)                                                                   < TOP
                                                                                                         >
                   Reason :     Tapes are sequential storage devices.
               17. Answer :    (c)                                                                   < TOP
                                                                                                         >
                   Reason :     Only c option is false because major goal of database system is
                               to minimize the number of block transfers between disk and
                               memory.
               18. Answer :    (c)                                                                   < TOP
                                                                                                         >
                   Reason :     Locks are used to maintain database consistency.
               19. Answer :    (d)                                                                   < TOP
                                                                                                         >
                   Reason :
               20. Answer : (d)                                                                      < TOP
                                                                                                         >
                   Reason : Variable length records arise out of all the given reasons.
               21. Answer : (a)                                                                      < TOP
                                                                                                         >
                   Reason : The indices based on the uniform distribution of values across
                            a range of buckets are called hash indices.
                                                                                                     < TOP
               22. Answer : (e)                                                                          >
                   Reason : Secondary indices can only be dense; multilevel indices are
                            created if the search time to find an entry is very high. So both
                            c and d are false.
                                                                                                     < TOP
               23. Answer : (b)




file://C:\WINDOWS\Desktop\Professional\MC141-0106.htm                                                            3/17/06
Suggested Answers with Examiner's Feedback                                                                   Page 8 of 13



                   Reason :    The state of the transaction after the final statement has been          >
                              executed is partially active.
               24. Answer :   (a)                                                                    < TOP
                                                                                                         >
                   Reason :    The syntax of the users query is verified by the Parser.
               25. Answer :   (a)                                                                    < TOP
                                                                                                         >
                   Reason :    Checkpoints are introduced to reduce overheads caused by the
                              log-based recovery.
               26. Answer :   (b)                                                                    < TOP
                                                                                                         >
                   Reason :     Time-stamp ordering protocol ensures conflict serializability
                              and safety from deadlocks.
               27. Answer :   (c)                                                                    < TOP
                                                                                                         >
                   Reason :    A block that is not permitted to be written back to the disk is
                              called pinned.
               28. Answer :   (d)                                                                    < TOP
                                                                                                         >
                   Reason :    If transaction Ti gets an explicit lock on the file Fc in exclusive
                              mode, then it has an implicit lock in exclusive mode on all the
                              records belonging to that file.
               29. Answer :   (a)                                                                    < TOP
                                                                                                         >
                   Reason :      Wait-die and wound-wait schemes are the schemes form
                              deadlock prevention.
               30. Answer :   (e)                                                                    < TOP
                                                                                                         >
                   Reason :     Triggers are the procedures in Oracle fired implicitly under
                              appropriate conditions.




file://C:\WINDOWS\Desktop\Professional\MC141-0106.htm                                                            3/17/06
Suggested Answers with Examiner's Feedback                                                                           Page 9 of 13




                                                   Section B : Problems
  1.




                                                                                                                            < TOP >

  2.   Suppose that
       •     R has attributes A and B
       •     R contains a single tuple: (a1, b1)
       •     <select-list> is A,B
       •     <condition1> is A = 'a1'
       •      <condition2> is B = 'b1'
       In this case, the result of the first query is just R, i.e., it consists of a single copy of (a1,b1). However, the result of
       the second query contains two copies of (a1,b1), one from each side of the union operation.
       One way to avoid this problem is to change the rewritten query to:
       select <select-list>
       from R
       where <condition1>
       union all
       select <select-list>
       from R
       where <condition2> AND NOT <condition1>
                                                                                                                            < TOP >
  3.   a)    Select Sno,Sname,gender, Date_of_birth, address, C.course_code, course_name from Studentsinfo S, Course
            C;
       b)   Select * from Studentsinfo where Date_of_birth like ‘%1981’;
       c)   Select Sno, Sname, round(months_between(sysdate, date_of_birth)/12) from Studentsinfo.
       d)    Select Sno, Sname from studentsinfo where course_code in (select course_code from Course where
            course_name = ‘DBMS’ and course_name = ‘NETWORKS’;
                                                                                                                            < TOP >

  4.   After step by step process of constructing a hash structure , the final Extendable hash structure is as follows:




file://C:\WINDOWS\Desktop\Professional\MC141-0106.htm                                                                       3/17/06
Suggested Answers with Examiner's Feedback                                                                  Page 10 of 13




                                                                                                                    < TOP >
  5.   The schema of an internet shop is given under:
       Books(isbn,title,author_no, qty_in_stock, price, year_published, author_address, author_phone)
       Customers(cid, cname, c_address)
       Orders(ordernum, isbn, cid, credit_cardnum, qty, order_date, ship_date)
       The list of functional dependencies are
       For books relation
       Isbn • title, author, qty_in_stock, price, year_ published
       Author • author_no, author_address, author_phone
       For this relation isbn is the primary key.
       Since the relation has no repeating groups it is in 1NF.
       Since the relation has no partial dependencies it is in 2NF.
       Since the relation has transitive dependencies it is not in 3NF.
       So decompose the relation into two relations
       Books(isbn,title,author,qty_in_stock, price, year_published)
       Author(author_address, author_phone)
       Customers(cid, cname, c_address)
       The FDs are cid • cname, c_address
       This relation is in 3NF as it is already in 2NF and no transitive dependencies.
       Orders(ordernum, isbn, cid, credit_cardnum, qty, order_date, ship_date)
       Here primary key is the composite key ordernum, isbn
       The FDs are ordernum, isbn • cid, credit_cardnum, qty, order_date, ship_date
       cid • credit_cardnum
       Since the relation has no repeating groups it is in 1NF.
       Since there are no partial dependencies the relation is in 2NF.
       Since in orders relation for a single order_date there may be many ship_dates
       It can be further divided into
       Orders(ordernum, isbn , cid, credit_cardno,qty, order_date)
       Orders1(ordernum, isbn, ship_date)
       Now the schema is in 3NF.
                                                                                                                    < TOP >

                                            Section C: Applied Theory
  6.   Shadow Paging
       •     Shadow paging is an alternative to log-based recovery; this scheme is useful if transactions execute serially




file://C:\WINDOWS\Desktop\Professional\MC141-0106.htm                                                               3/17/06
Suggested Answers with Examiner's Feedback                                                                  Page 11 of 13



      •     Idea: maintain two page tables during the lifetime of a transaction –the current page table, and the shadow
           page table
      •     Store the shadow page table in nonvolatile storage, such that state of the database prior to transaction
           execution may be recovered.
      •        Shadow page table is never modified during execution
      •     To start with, both the page tables are identical. Only current page table is used for data item accesses
           during execution of the transaction.
      •        Whenever any page is about to be written for the first time
      •        A copy of this page is made onto an unused page.
      •        The current page table is then made to point to the copy
      •        The update is performed on the copy

                                 Shadow and current page tables after the write to page 4




      To commit a transaction:
      1.   Flush all modified pages in main memory to disk
      2.   Output current page table to disk
      3.   Make the current page table the new shadow page table, as follows:
           •       keep a pointer to the shadow page table at a fixed (known) location on disk.
           •        to make the current page table the new shadow page table, simplyupdate the pointer to point to current
                   page table on disk
           •       Once pointer to shadow page table has been written, transaction is committed.
           •        No recovery is needed after a crash—new transactions can start right away, using the shadow page
                   table.
          •     Pages not pointed to from current/shadow page table should be freed (garbage collected).
      Advantages of shadow-paging over log-based schemes
      •     no overhead of writing log records




file://C:\WINDOWS\Desktop\Professional\MC141-0106.htm                                                              3/17/06
Suggested Answers with Examiner's Feedback                                                                        Page 12 of 13



       •     recovery is trivial
       Disadvantages :
       •     Copying the entire page table is very expensive
       •     Can be reduced by using a page table structured like a B+-tree
            –No need to copy entire tree, only need to copy paths in the tree that lead to updated leaf nodes
       •        Commit overhead is high even with above extension
       •        Need to flush every updated page, and page table
       •        Data gets fragmented (related pages get separated on disk)
       •     After every transaction completion, the database pages containing old versions of modified data need to be
            garbage collected
       •        Hard to extend algorithm to allow transactions to run concurrently
       •        Easier to extend log based schemes
                                                                                                                        < TOP >
  7.    System is deadlocked if there is a set of transactions such that every transaction in the set is waiting for another
       transaction in the set.
       Deadlock prevention protocols ensure that the system will never enter into a deadlock state. Some prevention
       strategies :
       •        Require that each transaction locks all its data items before it begins execution (predeclaration).
       •     Impose partial ordering of all data items and require that a transaction can lock data items only in the order
            specified by the partial order (graph-based protocol).
       Following schemes use transaction timestamps for the sake of deadlock prevention alone.
       •      wait-die scheme —non-preemptive
            -     older transaction may wait for younger one to release data item. Younger transactions never wait for
                 older ones; they are rolled back instead.
            -     a transaction may die several times before acquiring needed data item
       •     wound-wait scheme —preemptive
            -     transaction wounds(forces rollback) of younger transaction instead of waiting for it. Younger
                transactions may wait for older ones.
           -     be fewer rollbacks than wait-die scheme.
       Deadlock Detection
       •      Deadlocks can be described as a wait-forgraph, which consists of a pair G= (V,E),
       •      Vis a set of vertices (all the transactions in the system)
       •      Eis a set of edges; each element is an ordered pair Ti• Tj.
       •      If Ti • Tjis in E, then there is a directed edge from Tito Tj, implying that Tiis waiting for Tjto release a data
            item.
       •      When Ti requests a data item currently being held by Tj, then the edge TiTjis inserted in the wait-for graph.
            This edge is removed only when Tjis no longer holding a data item needed by Ti.
       •      The system is in a deadlock state if and only if the wait-for graph has a cycle. Must invoke a deadlock-
            detection algorithm periodically to look for cycles.




                                                                                                                      < TOP >
                                                         < TOP OF THE DOCUMENT >




file://C:\WINDOWS\Desktop\Professional\MC141-0106.htm                                                                   3/17/06
Suggested Answers with Examiner's Feedback              Page 13 of 13




file://C:\WINDOWS\Desktop\Professional\MC141-0106.htm        3/17/06

								
To top