Switch off your Mobiles Phones or Change Profile to Silent Mode.

Slides:



Advertisements
Similar presentations
Chapter 10: Designing Databases
Advertisements

TRANSACTION PROCESSING SYSTEM ROHIT KHOKHER. TRANSACTION RECOVERY TRANSACTION RECOVERY TRANSACTION STATES SERIALIZABILITY CONFLICT SERIALIZABILITY VIEW.
Lock-Based Concurrency Control
Database Management System MIS 520 – Database Theory Fall 2001 (Day) Lecture 13.
Distributed Databases John Ortiz. Lecture 24Distributed Databases2  Distributed Database (DDB) is a collection of interrelated databases interconnected.
Distributed databases
Transaction.
Database Systems, 8 th Edition Concurrency Control with Time Stamping Methods Assigns global unique time stamp to each transaction Produces explicit.
Chapter 13 (Web): Distributed Databases
Advanced Database Systems September 2013 Dr. Fatemeh Ahmadi-Abkenari 1.
Transaction Management and Concurrency Control
CS263 Lecture 19 Query Optimisation.  Motivation for Query Optimisation  Phases of Query Processing  Query Trees  RA Transformation Rules  Heuristic.
Copyright © 2007 Ramez Elmasri and Shamkant B. Navathe Slide
Database management concepts Database Management Systems (DBMS) An example of a database (relational) Database schema (e.g. relational) Data independence.
Overview Distributed vs. decentralized Why distributed databases
The Relational Database Model:
Chapter 8 : Transaction Management. u Function and importance of transactions. u Properties of transactions. u Concurrency Control – Meaning of serializability.
Functions of a Database Management System. Functions of a DBMS C.J. Date n Indexing n Views n Security n Integrity n Concurrency n Backup/Recovery n Design.
Database Systems: Design, Implementation, and Management Eighth Edition Chapter 10 Transaction Management and Concurrency Control.
July 14, 2015ICS 424: recap1 Relational Database Design: Recap of ICS 324.
Transaction. A transaction is an event which occurs on the database. Generally a transaction reads a value from the database or writes a value to the.
Academic Year 2014 Spring. MODULE CC3005NI: Advanced Database Systems “DATABASE RECOVERY” (PART – 1) Academic Year 2014 Spring.
Distributed DBMSPage © 1998 M. Tamer Özsu & Patrick Valduriez Outline Introduction Background Distributed DBMS Architecture Distributed Database.
Lecture 2 The Relational Model. Objectives Terminology of relational model. How tables are used to represent data. Connection between mathematical relations.
CSC271 Database Systems Lecture # 30.
1 CSE 480: Database Systems Lecture 23: Transaction Processing and Database Recovery.
Chapter Oracle Server An Oracle Server consists of an Oracle database (stored data, control and log files.) The Server will support SQL to define.
Database Design – Lecture 16
DISTRIBUTED DATABASES IN ADBMS Shilpa Seth
Concepts and Terminology Introduction to Database.
Database Management System Module 5 DeSiaMorewww.desiamore.com/ifm1.
Physical DB Issues, Indexes, Query Optimisation Database Systems Lecture 13 Natasha Alechina.
BIS Database Systems School of Management, Business Information Systems, Assumption University A.Thanop Somprasong Chapter # 10 Transaction Management.
Academic Year 2014 Spring. MODULE CC3005NI: Advanced Database Systems “QUERY OPTIMIZATION” Academic Year 2014 Spring.
Switch off your Mobiles Phones or Change Profile to Silent Mode.
Chapter 15 Recovery. Topics in this Chapter Transactions Transaction Recovery System Recovery Media Recovery Two-Phase Commit SQL Facilities.
Lecture 12 Recoverability and failure. 2 Optimistic Techniques Based on assumption that conflict is rare and more efficient to let transactions proceed.
1 IRU Concurrency, Reliability and Integrity issues Geoff Leese October 2007 updated August 2008, October 2009.
Lecture2: Database Environment Prepared by L. Nouf Almujally 1 Ref. Chapter2 Lecture2.
Switch off your Mobiles Phones or Change Profile to Silent Mode.
Chapter 1 Introduction to Databases. 1-2 Chapter Outline   Common uses of database systems   Meaning of basic terms   Database Applications  
Chapter 16 Recovery Yonsei University 1 st Semester, 2015 Sanghyun Park.
Introduction to Database Systems1. 2 Basic Definitions Mini-world Some part of the real world about which data is stored in a database. Data Known facts.
Database structure and space Management. Database Structure An ORACLE database has both a physical and logical structure. By separating physical and logical.
INFO1408 Database Design Concepts Week 16: Introduction to Database Management Systems Continued.
II.I Selected Database Issues: 2 - Transaction ManagementSlide 1/20 1 II. Selected Database Issues Part 2: Transaction Management Lecture 4 Lecturer: Chris.
1 Principles of Database Systems With Internet and Java Applications Today’s Topic Chapter 15: Reliability and Security in Database Servers Instructor’s.
Database Systems Recovery & Concurrency Lecture # 20 1 st April, 2011.
Chapter 10 Recovery System. ACID Properties  Atomicity. Either all operations of the transaction are properly reflected in the database or none are.
Introduction.  Administration  Simple DBMS  CMPT 454 Topics John Edgar2.
Section 06 (a)RDBMS (a) Supplement RDBMS Issues 2 HSQ - DATABASES & SQL And Franchise Colleges By MANSHA NAWAZ.
Academic Year 2014 Spring. MODULE CC3005NI: Advanced Database Systems “DATABASE RECOVERY” (PART – 2) Academic Year 2014 Spring.
Transactions.
Introduction to Distributed Databases Yiwei Wu. Introduction A distributed database is a database in which portions of the database are stored on multiple.
 Distributed Database Concepts  Parallel Vs Distributed Technology  Advantages  Additional Functions  Distribution Database Design  Data Fragmentation.
Switch off your Mobiles Phones or Change Profile to Silent Mode.
10 1 Chapter 10 - A Transaction Management Database Systems: Design, Implementation, and Management, Rob and Coronel.
Distributed Database Design Bayu Adhi Tama, MTI Fasilkom-Unsri Adapted from Connolly, et al., Database Systems 4 th Edition, Pearson Education Limited,
1 Information Retrieval and Use De-normalisation and Distributed database systems Geoff Leese September 2008, revised October 2009.
Academic Year 2014 Spring Academic Year 2014 Spring.
CMS Advanced Database and Client-Server Applications Distributed Databases slides by Martin Beer and Paul Crowther Connolly and Begg Chapter 22.
1 Chapter 22 Distributed DBMSs - Concepts and Design Simplified Transparencies © Pearson Education Limited 1995, 2005.
Distributed Databases – Advanced Concepts Chapter 25 in Textbook.
Transaction Management and Concurrency Control
Functions of a Database Management System
Database management concepts
Chapter 10 Transaction Management and Concurrency Control
Database management concepts
Introduction of Week 13 Return assignment 11-1 and 3-1-5
STRUCTURE OF PRESENTATION :
Presentation transcript:

Switch off your Mobiles Phones or Change Profile to Silent Mode

Revision on Past Question Paper

Question 1

May 2012 The following relational schema specifies a part of a relational database for a college information system: Student(S#, S_Name, Gender, DOB, Address, Tel) Module (M#, M_Name, L#) Lecturer (L#, L_Name, Gender, DOB, Address, Tel) Enrolment(S#, M#, Semester, Year)

May 2012 The following assumptions are made: Student enrolment for a module is specified by the student number (S#), module number(M#), semester (e.g. ‘spring’, or ‘autumn’), and year. Answer the following questions: Identify the primary key, and foreign key(s) if applicable, for each of relations above. Indicate clearly which relation contains which foreign key(s). [4 marks]

May 2012 Student PRIMARY KEY (S#), Module PRIMARY KEY (M#), FOREIGN KEY (L#) Lecturer PRIMARY KEY (L#) Enrolment PRIMARY KEY (S#, M#) FOREIGN KEY (S#) FOREIGN KEY (M#)

May 2012 Specify correct sequence in which above four relations should be created, and the order in which relations should be dropped (removed). [3 Marks] Entities with foreign keys must be created only after entities with associated primary keys. Entities with foreign keys must be dropped (removed) before entities with associated primary keys.

May 2012 Example of Sequence of CREATE statements: Student -> Lecturer -> Module -> Enrolment Example of Sequence of DROP statements: Enrolment -> Module -> Lecturer -> Student

May 2012 Express each of the following queries firstly in SQL and secondly in Relational Algebra: Find names of all modules which are taught by lecturer Dr David and with word ‘Programming’ in module name. [4 marks] SELECT M.M_Name FROM Module M, Lecturer L WHERE M.L# = L.L3 AND L.L_Name = ‘Dr David’ AND M.M_Name = ‘Programming’

May 2012 Express each of the following queries firstly in SQL and secondly in Relational Algebra: Find names of all modules which are taught by lecturer Dr David and with word ‘Programming’ in module name. [4 marks] Join Module and Lecturer over L# giving T1 Select T1 where Name = ‘Dr David’ AND M_Name = ‘Programming’ T2 Project T2 over M_Name giving result

Question 2

May 2012 In the context of transaction processing discuss the concepts of: Transaction record Contains information on transaction start, end (commit or abort) Contains details of all updates during the transaction processing Checkpoint record Contains a list of transactions still in process at the time of the checkpoint being taken

May 2012 In the context of transaction processing discuss the concepts of: Commit This operation signals a successful end of transaction. It tells the transaction manager that a logical unit of work has been successfully completed. The database should be in a consistent state again.

May 2012 The following list represents the sequence of operations in an interleaved execution of a set of transactions T1, T2,...T11 in a concurrency system based on locking, where A, B,...H are data items. Assume that FETCH A requires an S lock on A, UPDATE A requires an X lock on A, and all locks are held until end-of-transaction (COMMIT or ROLLBACK).

May 2012 timetransactionoperation time t0 time t1T1FETCH A time t2T4FETCH D time t3T5FETCH A time t4T2FETCH E time t5T2UPDATE E time t6T3FETCH F time t7T2FETCH F time t8T1COMMIT time t9T6FETCH A

May 2012 timetransactionoperation time t10T5ROLLBACK time t11T6FETCH C time t12T6UPDATE C time t13T7FETCH G time t14T8FETCH H time t15T9FETCH G time t16T9UPDATE G time t17T8FETCH E time t18T7COMMIT

May 2012 timetransactionoperation time t19T9FETCH H time t20T3FETCH G time t21T10FETCH G time t22T9UPDATE H time t23T2UPDATE F time t24T11FETCH A time t25 Determine whether there are any deadlocks at time t25 by providing a Wait-For-Graph (WFG). [10 marks]

May 2012 timetransactionoperationwait time t0 time t1T1FETCH AS lock A time t2T4FETCH DS lock D time t3T5FETCH AS lock A time t4T2FETCH ES lock E time t5T2UPDATE EX lock E time t6T3FETCH FS lock F time t7T2FETCH FS lock F time t8T1COMMITRelease time t9T6FETCH AS lock A

May 2012 timetransactionoperationwait time t10T5ROLLBACKRelease time t11T6FETCH CS lock C time t12T6UPDATE CX lock C time t13T7FETCH GS lock G time t14T8FETCH HS lock H time t15T9FETCH GS lock G time t16T9UPDATE Gwait time t17T8FETCH Ewait time t18T7COMMITRelease

May 2012 timetransactionoperationwait time t19T9FETCH HS lock H time t20T3FETCH Gwait time t21T10FETCH GS lock G time t22T9UPDATE HX lock H time t23T2UPDATE Fwait time t24T11FETCH AS lock A time t25

Wait For Graph T3 T2 T9 T8 T10 The system is deadlocked at t25: Circular path: T8 waits for T2 on E T2 waits for T3 on F T3 waits for T9 on G T9 waits for T8 on H F H E G G

May 2012 Discuss how the system could recover if it were deadlocked at time t25, and justify your choice of the 'best’ victim transaction(s).[4 marks] To break the deadlock, transaction T2, or T3, or T8, or T9 would need to be rolled- back. T9 should be chosen as the victim transaction, as it would not only break deadlock but also release locks required by T10 at same time.

Question 3

May 2012 Consider the following relational schema for a database used by an IT consultancy, which provides a range of IT support services to its client. CLIENT (C#, c_name, addr, phone) SERVICE (S#, C#, P#, cost) PRODUCT (P#, p_name, p_type)

May 2012 Note that: Each product has its name and belongs to one product type ( e.g. ‘Oracle’, ‘DB/2’, ‘Linux’). The product type information is recorded in the p_type attribute of the PRODUCT relation. CLIENT relation contains 1000 records. SERVICE relation contains 3000 records. PRODUCT relation contains 4000 records, of which 50 are for products in the product type ‘Oracle’.

May 2012 Express the following query in SQL: Find the names of those clients who have received services using any ‘Oracle’ type product. [2 marks] SELECTcname FROM CLIENT, SERVICE, PRODUCT WHERECLIENT.C# = SERVICE.C# ANDSERVICE.P# = PRODUCT.P# ANDp_type = ‘Oracle’;

May 2012 Choose two possible methods to evaluate the query. Express each of the methods using both the relational algebra and a query tree. Clearly show all the steps required in the evaluation. [7 marks] Method 1: Join CLIENT and SERVICE giving T1 Join T1 and PRODUCT giving T2 Restrict T2 where p_type = ’Oracle’ giving T3 Project T3 over cname to give result

May 2012 Choose two possible methods to evaluate the query. Express each of the methods using both the relational algebra and a query tree. Clearly show all the steps required in the evaluation. [7 marks] Method 2: Restrict PRODUCT where p_type = ’Oracle’ giving T1 Join T1 and SERVICE giving T2 Join T2 and CLIENT giving T3 Project T3 over cname to give results

May 2012 Client Service Join Restrict Project Result Query Tree – Method 1 (Join – Select – Project) Over P# Where p_type = ’Oracle’ Over cname Join Product Over C#

May 2012 For each method, clearly indicate the size (number of tuples) for each of the intermediate relations produced at each step. Recommend the best method based on the results. [7 marks] Method 1: Calculate sizes for T1, T2, T3 correctly T1: 3000 tuples T2:3000 tuples T3:up to 50 tuples

May 2012 For each method, clearly indicate the size (number of tuples) for each of the intermediate relations produced at each step. Recommend the best method based on the results. [7 marks] Method 2: Calculate sizes for T1, T2, T3 correctly T1: 50 tuples T2: up to 50 tuples T3:up to 50 tuples

May 2012 Briefly outline the four stages involved in the query optimisation process. [4 marks] Convert query into some internal form more suitable for machine manipulation Convert to canonical form Further convert internal form into some equivalent and more efficient canonical form making use of well defined transformation rules

May 2012 Briefly outline the four stages involved in the query optimisation process. [4 marks] Choose a set of candidate low-level procedures using statistics about database Generate a set of candidate query plans and choose best (cheapest) of those plans by evaluating cost formulae

Question 4

May 2012 Describe the objectives of database recovery and database security. [4 marks] Recovery It deals with the issue of how a database system can recover from physical or software failures when they occur in the system;- robustness of the system.

May 2012 Describe the objectives of database recovery and database security. [4 marks] Security It deals with the issue of how to protect data from unauthorised use; - to ensure only authorised users are allowed to use the database and they do so under the access right control imposed by the system.

May 2012 Identify the three types of failure in a database system.[3 marks] There are generally three types of failure in a database system: Transaction failure: a transaction fails to complete (as a result of program or data 'failure') Media failure (hard crash): damage to (part of) a database (e.g. disk corrupt, 'unreadable')

May 2012 Identify the three types of failure in a database system.[3 marks] System failure (soft crash): affecting all transactions currently in progress but no damage to the database (e.g. power failure causing lost of data in main memory)

May 2012 Discuss two of the methods used for database recovery from system failures, namely, deferred update and immediate update. [6 marks] Deferred update Do not actually update the database (disk) until partially commit state is reached. If transaction fails to reach partially commit it will not have changed the database in any way – no need to undo the failed transactions.

May 2012 Discuss two of the methods used for database recovery from system failures, namely, deferred update and immediate update. [6 marks] Immediate update Writing operations carried out immediately to disk. If a transaction fails the effect of its operations must be undone.

May 2012 Transaction processing is a key component of a relational database system. Explain the concept of transaction, and provide a diagram to clearly depict the state transition for transaction execution.[7 marks]

May 2012

Question 5

May 2012 Discuss difference between a distributed database system and a decentralised database system. [6 marks] Distributed database is a single logical database that is spread physically across computers in multiple locations that are connected by data communications network. Sites of a distributed system may be distributed over a large area (e.g. nationally or even globally) or over a small area (e.g. over several floors of same building or a college campus). Computers may range from PC’s to mainframes.

May 2012 Discuss difference between a distributed database system and a decentralised database system. [6 marks] Decentralised database is also stored on computers at multiple locations, however, computers are not connected by a network. Consequently, data cannot be shared by users at different sites. Thus a decentralised database is best regarded as a collection of independent databases, rather than having the geographical distribution of a single database.

May 2012 Briefly explain each of the following fragmentation rules: Completeness Reconstruction Disjointedness [4 marks] Completeness Each data item from a 'global' relation R must appear in at least one of its fragments. This rule ensures no loss of data during fragmentation.

May 2012 Briefly explain each of the following fragmentation rules: Completeness Reconstruction Disjointedness [4 marks] Reconstruction It must always be possible to reconstruct each global relation from its fragments. This rule ensures no loss of functional dependencies.

May 2012 Briefly explain each of the following fragmentation rules: Completeness Reconstruction Disjointedness [4 marks] Disjointness Each data item from global relation should appear in only one of its fragments, except for vertical fragmentation where primary key attributes must be repeated to allow reconstruction. This rule ensures minimal data redundancy.

May 2012 There are different fragmentation options in distributing data. Demonstrate in detail how horizontal and vertical fragmentation options can be performed by providing one example of each, using the following relation STUDENT: Horizontal Fragmentation With Horizontal partitioning some of rows of table are put into a base relation at one site. Other rows are put into base relation at another site. More generally, rows of relation are distributed to many sites.

May 2012 There are different fragmentation options in distributing data. Demonstrate in detail how horizontal and vertical fragmentation options can be performed by providing one example of each, using the following relation STUDENT: Vertical Fragmentation Here some of columns of a table are projected into base relation at one of sites and other columns are projected into a base relation at different site. Often, columns may be projected to several sites. Relations at each of sites must share common attribute (primary key being duplicated at each site) so that original table can be reconstructed if required.