|
|
- Anabel Lawrence
- 6 years ago
- Views:
Transcription
1
2
3
4
5
6
7
8
9
10
11
12
13
14 ss
15
16
17 A good decomposition must be lossless and dependency preserving 1. Lossless-Join Decomposition Exactly the original information can be recovered by joining 2. Non-Lossless-Join or Lossy Decomposition Partial or inexact information can be recovered A. Dependency Preserving The original dependencies are all found in the decomposition
18 B. Dependency Non-preserving Original dependencies are not reflected in the decomposition Definition of Decomposition Let r be a relation on relation scheme R and let r i = Ri (r) for i=1,2,. then r r 1 join r 2..join r n The Decomposition of the relational scheme R={A1, A2, A3,, An} is its replacement by a set of relation schemes {R1, R2, R3,., Rn} such that R1 join R2 join R3..Rn = R. Example Lossless-Join Decomposition Given R a relation and F a set of FDs Decompose R into R1 and R2 Decomposition is lossless if F+ contains either Intersection(R1, R2) R1 or Intersection(R1, R2) R2 EmpDept ( empno, empname, job, deptno, dname, dloc) F = { deptno dname deptno dloc empno empname empno deptno empno job } Decompose EmpDept into two relations Emp ( empno, empname, job, deptno ) Dept( deptno, dname, dloc) Intersection(Emp, Dept) = { deptno } Dept Decompose EmpDept into two relations Emp ( empno, empname, job) Ejob( deptno, dname, dloc, job) Decomposition is non-lossless-join Intersection(Emp, Dept) = { job } Emp or Ejob Does not hold Answer 3 b) Closure of a Set of Attributes 1. The set of all attributes that are implied by a given set of attributes S is called the closure of S 2. A superkey implies all the other attributes of a relvar
19 3. The nonkey attributes of a relvar represent a closure of the superkey, but not necessarily an irreducible one 4. Any group of attributes for which all the other attributes represent a closure is a superkey Algorithm to find closure CLOSURE [F,R]:= F; do forever ; for each FD X Y in S do; if X CLOSURE [F,R] then CLOSURE[F,R] := closure [F,R] Y; end if CLOSURE [F,R] did not change on this iteration then leave the loop; /* computation complete */ end; Algorithm to Computing the closure F+ of F under R Answer. 3 c) Normalization is a process for assigning attributes to entities. It reduces data redundancies and helps eliminate the data anomalies. Normalization is a process of refining table structures into a proper state so that they can store data as efficiently as possible. Normalization works through a series of stages called normal forms: a. First normal form (1NF) b. Second normal form (2NF) c. Third normal form (3NF) d. Fourth normal form (4NF) The highest level of normalization is not always desirable. First Normal Form (1 NF) 1NF Definition The term first normal form (1NF) describes the tabular format in which:» All the key attributes are defined.» There are no repeating groups in the table.» All attributes are dependent on the primary key. A relation R(A1, A2,., An) is said to be in 1 NF if : Values in the domain of each attribute of the relation are atomic. Relational model expects relations to be in 1 NF. STUDENT(name, fname, roll-no, course,grade) Every attribute takes on a simple value.thus it is in 1 NF. EMPLOYEE(name, address, child) child has attributes like child-name,age,sex.it is not atomic and thus is not in 1 NF.
20 The Second Normal Form, 2NF Eliminate partial functional dependency by having only full functional dependencies. A relation is in 2 NF if it is in 1 NF and if each non-prime field is fully dependent upon each candidate key Represent the offending partial functional dependency as a separate relation by decomposition. Decompose into 2NF Emp(Eno, Ename, Designation, salary) Eno Designation Eno Salary Eno, Ename Designation Eno, Ename Salary PFD of Salary and designation respectively on Eno, Ename Problem: as many tuples as (alias) Enames of an Eno. Option 1 E (Eno, Designation, Salary) E (Eno, Ename) Option 2 E (Eno, Salary) E (Eno, Designation) E (Eno, Ename) Operationally, Option 1 is better.
21 Third Normal Form(3NF) Codd s Definition A relation is in 3NF if it satisfies 2NF and no nonprime attribute of R is transitively dependent on the primary key 3NF Decomposition Algorithm If A B and B C in R then create R1(A,B), R2 (B,C) Equivalently, A relation is in 3 NF if for every functional dependency X A, one of the following statements is true: i) it is a trivial FD X is a superkey A is a prime attribute Consider a relation Stdinf (Name, Phoneno, Course, Major, Prof., Grade, Major-Elective) with following FD s Name Course Phoneno Major Prof.. Grade Major-Elective The key of the relation is {Name Course} The partial dependencies are caused by Name Phoneno Name Major and Course Prof. The only transitive dependency is Name Major, Major Major-Elective.
22 Consider a relation Stdinf (Name, Phoneno, Course, Major, Prof., Grade, Major-Elective) with following FD s Name Course Phoneno Major Prof.. Grade Major-Elective The key of the relation is {Name Course} The partial dependencies are caused by Name Phoneno Name Major and Course Prof. The only transitive dependency is Name Major, Major Major-Elective. 2NF Decomposition: R1(Name, Phoneno, Major, Major-Elective) R2(Course,Prof.) R3(Name,Course,Grade) 3NF Decomposition: R1-1(Name,Phoneno,Major) R1-2(Major, Major-Elective) R2(Course, Prof.) R3(Name,Course,Grade) BCNF
23 Need For BCNF arises when X A and A B where B is a subset of X Student (Name, Course, Teacher) and Name Course Teacher Note: Name, Course is the primary key of Student Name Course Teacher A C1 T1 B C1 T1 C C2 T2 A relation R is in BCNF if it is in 1NF and for every collection C of fields, if any field not in C is functionally dependent on C, then C R A relation is in BCNF if whenever a functional dependency X A holds then, either i) X is a super key of R, or ii) X A is trivial (A is subset of X) Difference with 3NF: A cannot be a prime attribute Lossless BCNF Decomposition For R(A,B,C) if A,B C and C B, decompose R into R1(C,B) and R2 (R - B) Note: Dependency Non-preserving
24 Answer 4 a) A transaction is a unit of program execution that accesses and possibly updates various data items. A transaction must see a consistent database. During transaction execution the database may be inconsistent. When the transaction is committed, the database must be consistent. Two main issues to deal with: Failures of various kinds, such as hardware failures and system crashes Concurrent execution of multiple transactions Transaction State 1. Active, the initial state; the transaction stays in this state while it is executing 2. Partially committed, after the final statement has been executed. 3. Failed, after the discovery that normal execution can no longer proceed. 4. Aborted, after the transaction has been rolled back and the database restored to its state prior to the start of the transaction. Two options after it has been aborted: a. restart the transaction only if no internal logical error b. kill the transaction 5. Committed, after successful completion.
25 Example of Fund Transfer Transaction to transfer $50 from account A to account B: 1. read(a) 2. A := A write(a) 4. read(b) 5. B := B write(b) Consistency requirement the sum of A and B is unchanged by the execution of the transaction. Atomicity requirement if the transaction fails after step 3 and before step 6, the system should ensure that its updates are not reflected in the database, else an inconsistency will result. Durability requirement once the user has been notified that the transaction has completed (i.e., the transfer of the $50 has taken place), the updates to the database by the transaction must persist despite failures. Isolation requirement if between steps 3 and 6, another transaction is allowed to access the partially updated database, it will see an inconsistent database (the sum A + B will be less than it should be). Can be ensured trivially by running transactions serially, that is one after the other. However, executing multiple transactions concurrently has significant benefits, as we will see. Answer. 4 b) Schedules 1. When several transactions are executing concurrently the order of execution of various instructions is known as a schedule.
26 2. The concept of serializability of schedules is used to identify which schedules are connect when transaction executions have interleaving of their operations in the schedules. 3. Types of schdeules a. Serial schedules b. Non-serial schedules c. Conflict schedules d. View schedules Serial schedules 1. Two schedules T1 and T2 are called serial schedule if the operations of each transaction are executed consecutively, without any interleaved operations from the other transaction. 2. In a serial schedule, entire transaction are performed in serial order T1 and then T2 OR T2 then T1. Non-serial Schedule Two schedules T1 and T2 are called non-serial schedule if the operations of each transaction are executed non-consecutively with interleaved operations from the other transaction.
27 Conflict schedule The precedence graph contains no cycle is called conflict serializable schedule View Schedule 1. The precedence graph contains a cycle is called view schedule. 2. If the graph contains no cycle, then the schedule S is conflict serializable. 3. If the graph for S has a cycle, then schedule S is not conflict serializable. Conflict Serializability Instructions li and lj of transactions Ti and Tj respectively, conflict if and only if there exists some item Q accessed by both li and lj, and at least one of these instructions wrote Q. 1. li = read(q), lj = read(q). li and lj don t conflict. 2. li = read(q), lj = write(q). They conflict. 3. li = write(q), lj = read(q). They conflict 4. li = write(q), lj = write(q). They conflict Intuitively, a conflict between li and lj forces a (logical) temporal order between them. If li and lj are consecutive in a schedule and they do not conflict, their results would remain the same even if they had been interchanged in the schedule. View Serializability Let S and S be two schedules with the same set of transactions. S and S are view equivalent if the following three conditions are met: 1. For each data item Q, if transaction Ti reads the initial value of Q in schedule S, then transaction Ti must, in schedule S, also read the initial value of Q. 2. For each data item Q if transaction Ti executes read(q) in schedule S, and that value was produced by transaction Tj (if any), then transaction Ti must in schedule S also read the value of Q that was produced by transaction Tj. 3. For each data item Q, the transaction (if any) that performs the final write(q) operation in schedule S must perform the final write(q) operation in schedule S.
28 As can be seen, view equivalence is also based purely on reads and writes alone. Recoverability Need to address the effect of transaction failures on concurrently running transactions. 1. Recoverable schedule if a transaction Tj reads a data items previously written by a transaction Ti, the commit operation of Ti appears before the commit operation of Tj. 2. The following schedule (Schedule 11) is not recoverable if T9 commits immediately after the read Schedule If T8 should abort, T9 would have read (and possibly shown to the user) an inconsistent database state. Hence database must ensure that schedules are recoverable. Cascading rollback a single transaction failure leads to a series of transaction rollbacks. Consider the following schedule where none of the transactions has yet committed (so the schedule is recoverable) Schedule 12 If T10 fails, T11 and T12 must also be rolled back. Can lead to the undoing of a significant amount of work
29 Cascadeless schedules cascading rollbacks cannot occur; for each pair of transactions Ti and Tj such that Tj reads a data item previously written by Ti, the commit operation of Ti appears before the read operation of Tj. Every cascadeless schedule is also recoverable It is desirable to restrict the schedules to those that are cascadeless Answer 4 C) Distributed Database: A distributed database system consists of loosely coupled sites that share no physical component Database systems that run on each site are independent of each other Transactions may access data at one or more sites Data Replication A relation or fragment of a relation is replicated if it is stored redundantly in two or more sites. Full replication of a relation is the case where the relation is stored at all sites. Fully redundant databases are those in which every site contains a copy of the entire database. Advantages of Replication Availability: failure of site containing relation r does not result in unavailability of r is replicas exist. Parallelism: queries on r may be processed by several nodes in parallel. Reduced data transfer: relation r is available locally at each site containing a replica of r. Disadvantages of Replication Increased cost of updates: each replica of relation r must be updated. Increased complexity of concurrency control: concurrent updates to distinct replicas may lead to inconsistent data unless special concurrency control mechanisms are implemented. One solution: choose one copy as primary copy and apply concurrency control operations on primary copy Data Fragmentation Division of relation r into fragments r1, r2,, rn which contain sufficient information to reconstruct relation r. Horizontal fragmentation: each tuple of r is assigned to one or more fragments Vertical fragmentation: the schema for relation r is split into several smaller schemas o All schemas must contain a common candidate key (or superkey) to ensure lossless join property. o A special attribute, the tuple-id attribute may be added to each schema to serve as a candidate key. Example : relation account with following schema Account = (account_number, branch_name, balance ) Advantages of Fragmentation Horizontal:
30 o allows parallel processing on fragments of a relation o allows a relation to be split so that tuples are located where they are most frequently accessed Vertical: o allows tuples to be split so that each part of the tuple is stored where it is most frequently accessed o tuple-id attribute allows efficient joining of vertical fragments Vertical and horizontal fragmentation can be mixed. o Fragments may be successively fragmented to an arbitrary depth. Replication and fragmentation can be combined o Relation is partitioned into several fragments: system maintains several identical replicas of each such fragment. Answer. 5 a) Lock: A mechanism to control concurrent access to a data item by competing transactions. Locking protocol: A set of rules followed by all transactions while requesting and releasing locks. Types of Lock Granularity of locks: Can be at the field level, record level, or disk block level, or table level. Less granular locks provides better concurrency, but increases locking overhead since more lock/unlock operations are needed. Types of locks: Read lock or shared lock (lock-s): Data item can be read but not updated by the locking and other transactions. Write lock or exclusive lock (lock-x): Data items can be read and updated by the locking transaction, but not by other transactions. Concurrency control manager can upgrade read locks to write locks, or downgrade write locks to read locks, as requested. All locking operations (read_lock, write_lock) precede the first unlock operation in the transactions. Two phases: expanding phase: new locks on items can be acquired but none can be released shrinking phase: existing locks can be released but no new ones can be acquired
31 not two-phase locking read_lock(y); read_lock(x); read_item(y); unlock(y); read_item(x); X:=X+Y; write_lock(x); write_item(x); unlock(x); two-phase locking read_lock(x); read_item(x); write_lock(y); unlock(x); read_item(y); Y:=X+Y; write_item(y); unlock(y); Graph Based Protocol 1. To acquire a prior knowledge, we impose a partial ordering on the set D={d1,d2,..dn} of all data item. If di dj, then any transaction accessing both di and dj must access di before accessing dj. 2. The partial ordering implies that the set D may now be viewed as a directed acyclic graph called a database graph. 3. For the sake the simplicity, we will restrict our attention to only those graphs that are rooted trees. 4. Tree protocol is restricted to employ only exclusive locks. 5. In the tree protocol, the only lock instruction allowed is lock-x. Each transaction Ti can lock a data item at,most once, and must observe the following rules: a. The first lock by Ti may be any data item. b. Subsequently, a data item Q can be locked by Ti only if the parent of Q is currently locked by Ti. c. Data items may be unlocked at any item. d. A data item that has been locked and unlocked by Ti cannot subsequently be relocked by Ti. Graph-based protocol Advantages & Disadvantages over two-phase locking Advantages It is deadlock-free so no rollbacks are required. Unlocking may occur earlier. Earlier unlocking may lead to shorter waiting times, and to an increase in concurrency. Disadvantages Transaction may have to lock data items that it does not access. Answer 5 b) Deadlock: when each of two transactions is waiting for the other to release an item. Approaches for solution:
32 o deadlock prevention protocol: every transaction must lock all items it needs in advance o deadlock detection (if the transaction load is light or transactions are short and lock only a few items): Livelock: a transaction cannot proceed for an indefinite period of time while other transactions in the system continue normally. o Solution: fair waiting schemes (i.e. first-come-first-served) There are two principal methods for dealing with deadlock problems: Deadlock prevention protocol Deadlock detection and recovery process Deadlock prevention protocol This protocol ensures the system will ensure that the system will not go into deadlock state. There are different methods can be used for deadlock prevention: The simplest scheme requires that each transaction locks all its data item before it starts execution. Another method for prevention of deadlock is to impose a partial ordering of all data items and require that a transaction can lock a data item only in the order specified by partial order. Another approach for the prevention of deadlock is to use pre-emption and transaction rollbacks. Deadlock Detection and Recovery If a system does not imply some protocol that ensures deadlock freedom, then a detection and recovery scheme must be used. Deadlock Detection Deadlock can be described previously in terms of a directed graph called a wait a graph. This graph consist of a pair G=(V,E) where V is a set of vertices and E is set of edges. Each element in the set E of edges is an ordered pair Ti Tj. If Ti Tj is in E, then there is a directed edge from transaction Ti+Tj, implying that transaction Ti, is waiting for ransaction Tj to releases a data item that it needs. A deadlock exist in the system if and only if the wait for graph contains a cycle. Each transaction involved in the cycle is said to be deadlocked. Deadlock Recovery When a detection algorithm determines that a deadlock exists, the system must recover from deadlock. The most common solution is to rollback one or more transactions to break the deadlock. There actions need to be taken: 1. Selection of a victim 2. Rollback 3. Starvation As Tanenbaum shows, when the wait-for graph is computed at a central location that collects messages from the various systems involved in
33 transactions, it is easy to find also false, or spurious, or phantom deadlocks as in the following picture when Q first releases S and then P requests S, but the messages delivered to the coordinator that collects the messages arrive in the wrong order. Then the coordinator believes that a deadlock has arisen and kills unnecessarily P or Q. Of course, if Q was following a 2-phase locking policy, it would not release any lock until it had acquired every lock it needed. Thus phantom deadlocks would not arise if 2-phase locking is followed. Answer 5 c) i) Time stamping protocol for concurrrency control Time stamping ids a concurrency protocol in which the fundamental goal is to order transactions globally in such a way that older transactions get priority in the event of a conflict. In this method, if a transaction attempts to read or write a data item, then a read or write operation is allowed only if the last updated on that data item was carried out by an older transaction. Otherwise the transaction, requesting the read or write is restarted and given a new timestamp. The restarted transaction is assigned a new timestamp to prevent it from continuously aborting and restarting. In this method, sequence of transaction is selected in advance by using time stamping concept. We associate a unique, fixed non-decreasing numbers called the timestamp to each transaction in the system. This number can be the system clock value, i.e. when the transaction enters the system the current value of the clock is assigned to that transaction as the timestamp value. We can also use a logical number that is incremented after a new transaction enters the system. A transaction with a smaller timestamp value is considered to be an adder transaction than another transaction with a larger time stamp value. In other words, if a transaction T1 has been assigned a timestamp S1 and a new transaction T2 enters the system with a time stamp value S2 then S1<S2 and system will allow the transaction T1 to run first followed by the transaction T2. If any conflict is found between transaction using timestamp based system, one of the conflicting transaction is rolled back. There are two types of timestamps: W-time stamp (Q): Denotes the largest time stamp of any transaction that executed write(q) successfully.
34 R-Time stamp (Q): Denotes the largest time stamp of any transaction that executed read(q) successfully. ii) Checkpoints Storage Structure Volatile storage: does not survive system crashes examples: main memory, cache memory Loss of Volatile Storage- It can be recovered using various methods. e.g., Logbased recovery, Buffer Management, checkpoints, and shadow paging techniques. Checkpoints or syncpoints or save points A checkpoint is a point of synchronization b/w the database and the transaction log file. All buffers are force-written to secondary storage at the checkpoint. Checkpoints are schedules at predetermined interval and involves operations like writing all log records in main memory to secondary storage. If the transactions are executed serially, when a failures occurs, we check the log file to find the transaction that started before the last chcekpoint.
Q.2 e) Time stamping protocol for concurrrency control Time stamping ids a concurrency protocol in which the fundamental goal is to order transactions globally in such a way that older transactions get
More informationChapter 15: Transactions
Chapter 15: Transactions! Transaction Concept! Transaction State! Implementation of Atomicity and Durability! Concurrent Executions! Serializability! Recoverability! Implementation of Isolation! Transaction
More informationChapter 13: Transactions
Chapter 13: Transactions Transaction Concept Transaction State Implementation of Atomicity and Durability Concurrent Executions Serializability Recoverability Implementation of Isolation Transaction Definition
More informationCSIT5300: Advanced Database Systems
CSIT5300: Advanced Database Systems L12: Transactions Dr. Kenneth LEUNG Department of Computer Science and Engineering The Hong Kong University of Science and Technology Hong Kong SAR, China kwtleung@cse.ust.hk
More informationReferences. Transaction Management. Database Administration and Tuning 2012/2013. Chpt 14 Silberchatz Chpt 16 Raghu
Database Administration and Tuning 2012/2013 Transaction Management Helena Galhardas DEI@Técnico DMIR@INESC-ID Chpt 14 Silberchatz Chpt 16 Raghu References 1 Overall DBMS Structure Transactions Transaction
More informationTransactions. Prepared By: Neeraj Mangla
Transactions Prepared By: Neeraj Mangla Chapter 15: Transactions Transaction Concept Transaction State Concurrent Executions Serializability Recoverability Implementation of Isolation Transaction Definition
More informationTransactions. Lecture 8. Transactions. ACID Properties. Transaction Concept. Example of Fund Transfer. Example of Fund Transfer (Cont.
Transactions Transaction Concept Lecture 8 Transactions Transaction State Implementation of Atomicity and Durability Concurrent Executions Serializability Recoverability Implementation of Isolation Chapter
More informationAdvanced Databases (SE487) Prince Sultan University College of Computer and Information Sciences. Dr. Anis Koubaa. Spring 2014
Advanced Databases (SE487) Prince Sultan University College of Computer and Information Sciences Transactions Dr. Anis Koubaa Spring 2014 Outlines Transaction Concept Transaction State Implementation of
More informationBİL 354 Veritabanı Sistemleri. Transaction (Hareket)
BİL 354 Veritabanı Sistemleri Transaction (Hareket) Example BUSEY SAVINGS Winslett $1000 Transfer $500 BUSEY CHECKING Winslett $0 A single operation from the customer point of view It comprises several
More informationTransactions and Concurrency Control. Dr. Philip Cannata
Transactions and Concurrency Control Dr. Philip Cannata 1 To open two SQLDevelopers: On the Mac do the following: click on the SQLDeveloper icon to start one instance from the command line run the following
More informationChapter 9: Transactions
Chapter 9: Transactions modified from: Database System Concepts, 6 th Ed. See www.db-book.com for conditions on re-use Chapter 9: Transactions Transaction Concept Transaction State Concurrent Executions
More informationChapter 14: Transactions
Chapter 14: Transactions Database System Concepts, 6 th Ed. See www.db-book.com for conditions on re-use Chapter 14: Transactions Transaction Concept Transaction State Concurrent Executions Serializability
More informationUNIT 4 TRANSACTIONS. Objective
UNIT 4 TRANSACTIONS Objective To study about the transaction concepts. To know the recovery management. To have a clear understanding of concurrent executions. To know how these are facilitated in SQL.
More informationTransactions These slides are a modified version of the slides of the book Database System Concepts (Chapter 15), 5th Ed
Transactions These slides are a modified version of the slides of the book Database System Concepts (Chapter 15), 5th Ed., McGraw-Hill, by Silberschatz, Korth and Sudarshan. Original slides are available
More informationRoadmap of This Lecture
Transactions 1 Roadmap of This Lecture Transaction Concept Transaction State Concurrent Executions Serializability Recoverability Implementation of Isolation Testing for Serializability Transaction Definition
More informationDatabase Management Systems 2010/11
DMS 2010/11 J. Gamper 1/30 Database Management Systems 2010/11 Chapter 6: Transactions J. Gamper Transaction Concept ACID Properties Atomicity and Durability Concurrent Execution Serializability Recoverability
More informationICOM 5016 Database Systems. Chapter 15: Transactions. Transaction Concept. Chapter 15: Transactions. Transactions
ICOM 5016 Database Systems Transactions Chapter 15: Transactions Amir H. Chinaei Department of Electrical and Computer Engineering University of Puerto Rico, Mayagüez Slides are adapted from: Database
More informationChapter 15: Transactions
Chapter 15: Transactions Chapter 15: Transactions Transaction Concept Transaction State Concurrent Executions Serializability Recoverability Implementation of Isolation Transaction Definition in SQL Testing
More informationCS322: Database Systems Transactions
CS322: Database Systems Transactions Dr. Manas Khatua Assistant Professor Dept. of CSE IIT Jodhpur E-mail: manaskhatua@iitj.ac.in Outline Transaction Concept Transaction State Concurrent Executions Serializability
More informationTransaction Concept. Two main issues to deal with:
Transactions Transactions Transactions Transaction States Concurrent Executions Serializability Recoverability Implementation of Isolation Transaction Definition in SQL Testing for Serializability. Transaction
More informationDatabase System Concepts
Chapter 15+16+17: Departamento de Engenharia Informática Instituto Superior Técnico 1 st Semester 2010/2011 Slides (fortemente) baseados nos slides oficiais do livro c Silberschatz, Korth and Sudarshan.
More informationCHAPTER: TRANSACTIONS
CHAPTER: TRANSACTIONS CHAPTER 14: TRANSACTIONS Transaction Concept Transaction State Concurrent Executions Serializability Recoverability Implementation of Isolation Transaction Definition in SQL Testing
More informationDatabase System Concepts
Chapter 15: Departamento de Engenharia Informática Instituto Superior Técnico 1 st Semester 2007/2008 Slides (fortemente) baseados nos slides oficiais do livro c Silberschatz, Korth and Sudarshan. Outline
More informationChapter 14: Transactions
Chapter 14: Transactions Transaction Concept Transaction Concept A transaction is a unit of program execution that accesses and possibly updates various data items. E.g. transaction to transfer $50 from
More informationAdvanced Databases. Transactions. Nikolaus Augsten. FB Computerwissenschaften Universität Salzburg
Advanced Databases Transactions Nikolaus Augsten nikolaus.augsten@sbg.ac.at FB Computerwissenschaften Universität Salzburg Version October 18, 2017 Wintersemester 2017/18 Adapted from slides for textbook
More informationQ.1 Short Questions Marks 1. New fields can be added to the created table by using command. a) ALTER b) SELECT c) CREATE. D. UPDATE.
ID No. Knowledge Institute of Technology & Engineering - 135 BE III SEMESTER MID EXAMINATION ( SEPT-27) PAPER SOLUTION Subject Code: 2130703 Date: 14/09/27 Subject Name: Database Management Systems Branches:
More informationLecture 20 Transactions
CMSC 461, Database Management Systems Spring 2018 Lecture 20 Transactions These slides are based on Database System Concepts 6 th edition book (whereas some quotes and figures are used from the book) and
More informationTransaction Concept. Chapter 15: Transactions. Example of Fund Transfer. ACID Properties. Example of Fund Transfer (Cont.)
Chapter 15: Transactions Transaction Concept - ACID Transaction States Concurrent Executions Serializability Testing for Serializability Recoverability Transaction Definition in SQL Transaction Concept
More informationTransactions. Silberschatz, Korth and Sudarshan
Transactions Transaction Concept ACID Properties Transaction State Concurrent Executions Serializability Recoverability Implementation of Isolation Transaction Definition in SQL Testing for Serializability.
More informationConcurrency Control! Snapshot isolation" q How to ensure serializability and recoverability? " q Lock-Based Protocols" q Other Protocols"
Concurrency Control! q How to ensure serializability and recoverability? q Lock-Based Protocols q Lock, 2PL q Lock Conversion q Lock Implementation q Deadlock q Multiple Granularity q Other Protocols q
More informationUNIT IV TRANSACTION MANAGEMENT
UNIT IV TRANSACTION MANAGEMENT The term transaction refers to a collection of operations that form a single logical unit of work. For instance, transfer of money from one account to another is a transaction
More informationDatabase System Concepts
Chapter 15: Departamento de Engenharia Informática Instituto Superior Técnico 1 st Semester 2008/2009 Slides (fortemente) baseados nos slides oficiais do livro c Silberschatz, Korth and Sudarshan. Outline
More informationDATABASE DESIGN I - 1DL300
DATABASE DESIGN I - 1DL300 Spring 2011 An introductory course on database systems http://www.it.uu.se/edu/course/homepage/dbastekn/vt11/ Manivasakan Sabesan Uppsala Database Laboratory Department of Information
More informationUNIT-IV TRANSACTION PROCESSING CONCEPTS
1 Transaction UNIT-IV TRANSACTION PROCESSING CONCEPTS A Transaction refers to a logical unit of work in DBMS, which comprises a set of DML statements that are to be executed atomically (indivisibly). Commit
More informationChapter 5. Concurrency Control Techniques. Adapted from the slides of Fundamentals of Database Systems (Elmasri et al., 2006)
Chapter 5 Concurrency Control Techniques Adapted from the slides of Fundamentals of Database Systems (Elmasri et al., 2006) Chapter Outline Purpose of Concurrency Control Two-Phase Locking Techniques Concurrency
More informationTRANSACTION PROCESSING CONCEPTS
1 Transaction CHAPTER 9 TRANSACTION PROCESSING CONCEPTS A Transaction refers to a logical unit of work in DBMS, which comprises a set of DML statements that are to be executed atomically (indivisibly).
More informationTransaction Management. Chapter 14
Transaction Management Chapter 14 What we want to cover Transaction model Transaction schedules Serializability Atomicity 432/832 2 Chapter 14 TRANSACTION MODEL 432/832 3 Transaction Requirements Eg. Transaction
More informationChapter 13 : Concurrency Control
Chapter 13 : Concurrency Control Chapter 13: Concurrency Control Lock-Based Protocols Timestamp-Based Protocols Validation-Based Protocols Multiple Granularity Multiversion Schemes Insert and Delete Operations
More informationDHANALAKSHMI COLLEGE OF ENGINEERING, CHENNAI
DHANALAKSHMI COLLEGE OF ENGINEERING, CHENNAI Department of Computer Science and Engineering CS6302- DATABASE MANAGEMENT SYSTEMS Anna University 2 & 16 Mark Questions & Answers Year / Semester: II / III
More informationConcurrency Control. Data Base Management Systems. Inherently Concurrent Systems: The requirements
Concurrency Control Inherently Concurrent Systems: These are Systems that respond to and manage simultaneous activities in their external environment which are inherently concurrent and maybe broadly classified
More informationFoundation of Database Transaction Processing. Copyright 2012 Pearson Education, Inc.
Foundation of Database Transaction Processing Copyright 2012 Pearson Education, Inc. Chapter Outline - 17.1 Introduction to Transaction Processing - 17.2 Transaction and System Concepts - 17.3 Desirable
More informationBabu Banarasi Das National Institute of Technology and Management
Babu Banarasi Das National Institute of Technology and Management Department of Computer Applications Question Bank (Short-to-Medium-Answer Type Questions) Masters of Computer Applications (MCA) NEW Syllabus
More informationA can be implemented as a separate process to which transactions send lock and unlock requests The lock manager replies to a lock request by sending a lock grant messages (or a message asking the transaction
More informationTransaction Management
Transaction Management 1) Explain properties of a transaction? (JUN/JULY 2015) Transactions should posses the following (ACID) properties: Transactions should possess several properties. These are often
More informationUNIT 3 UNIT 3. Transaction Management and Concurrency Control, Performance tuning and query optimization of SQL and NoSQL Databases.
UNIT 3 Transaction Management and Concurrency Control, Performance tuning and query optimization of SQL and NoSQL Databases. 1. Transaction: A transaction is a unit of program execution that accesses and
More informationTransactions. Chapter 15. New Chapter. CS 2550 / Spring 2006 Principles of Database Systems. Roadmap. Concept of Transaction.
New Chapter CS 2550 / Spring 2006 Principles of Database Systems 09 Transactions Chapter 15 Transactions Alexandros Labrinidis University of Pittsburgh Alexandros Labrinidis, Univ. of Pittsburgh 2 CS 2550
More informationmywbut.com Concurrency Control
C H A P T E R 1 6 Concurrency Control This chapter describes how to control concurrent execution in a database, in order to ensure the isolation properties of transactions. A variety of protocols are described
More informationTransactions. Kathleen Durant PhD Northeastern University CS3200 Lesson 9
Transactions Kathleen Durant PhD Northeastern University CS3200 Lesson 9 1 Outline for the day The definition of a transaction Benefits provided What they look like in SQL Scheduling Transactions Serializability
More informationLecture 22 Concurrency Control Part 2
CMSC 461, Database Management Systems Spring 2018 Lecture 22 Concurrency Control Part 2 These slides are based on Database System Concepts 6 th edition book (whereas some quotes and figures are used from
More information! A lock is a mechanism to control concurrent access to a data item! Data items can be locked in two modes :
Lock-Based Protocols Concurrency Control! A lock is a mechanism to control concurrent access to a data item! Data items can be locked in two modes : 1 exclusive (X) mode Data item can be both read as well
More informationTransaction Management
Instructional Objectives Upon completion of this Unit, students will be introduced to the following About Transaction Processing Transaction and System Concepts Desirable Properties of Transactions Schedules
More information2 nd Semester 2009/2010
Chapter 16: Concurrency Control Departamento de Engenharia Informática Instituto Superior Técnico 2 nd Semester 2009/2010 Slides baseados nos slides oficiais do livro Database System Concepts c Silberschatz,
More informationGraph-based protocols are an alternative to two-phase locking Impose a partial ordering on the set D = {d 1, d 2,..., d h } of all data items.
Graph-based protocols are an alternative to two-phase locking Impose a partial ordering on the set D = {d 1, d 2,..., d h } of all data items. If d i d j then any transaction accessing both d i and d j
More informationDATABASE MANAGEMENT SYSTEMS
www..com Code No: N0321/R07 Set No. 1 1. a) What is a Superkey? With an example, describe the difference between a candidate key and the primary key for a given relation? b) With an example, briefly describe
More informationtransaction - (another def) - the execution of a program that accesses or changes the contents of the database
Chapter 19-21 - Transaction Processing Concepts transaction - logical unit of database processing - becomes interesting only with multiprogramming - multiuser database - more than one transaction executing
More informationBCA204T: DATA BASE MANAGEMENT SYSTEMS
BCA204T: DATA BASE MANAGEMENT SYSTEMS Page 1 of 12 BCA204T: DATA BASE MANAGEMENT SYSTEMS Unit - V Transaction Processing Concepts: Introduction, Transaction and System Concepts, Desirable properties of
More informationChapter 15 : Concurrency Control
Chapter 15 : Concurrency Control What is concurrency? Multiple 'pieces of code' accessing the same data at the same time Key issue in multi-processor systems (i.e. most computers today) Key issue for parallel
More informationChapter 12 : Concurrency Control
Chapter 12 : Concurrency Control Chapter 12: Concurrency Control Lock-Based Protocols Timestamp-Based Protocols Validation-Based Protocols Multiple Granularity Multiversion Schemes Insert and Delete Operations
More informationPage 1. Goals of Today s Lecture. The ACID properties of Transactions. Transactions
Goals of Today s Lecture CS162 Operating Systems and Systems Programming Lecture 19 Transactions, Two Phase Locking (2PL), Two Phase Commit (2PC) Finish Transaction scheduling Two phase locking (2PL) and
More informationChapter 19: Distributed Databases
Chapter 19: Distributed Databases Chapter 19: Distributed Databases Heterogeneous and Homogeneous Databases Distributed Data Storage Distributed Transactions Commit Protocols Concurrency Control in Distributed
More informationLecture 21 Concurrency Control Part 1
CMSC 461, Database Management Systems Spring 2018 Lecture 21 Concurrency Control Part 1 These slides are based on Database System Concepts 6 th edition book (whereas some quotes and figures are used from
More informationTransaction Management. Pearson Education Limited 1995, 2005
Chapter 20 Transaction Management 1 Chapter 20 - Objectives Function and importance of transactions. Properties of transactions. Concurrency Control Deadlock and how it can be resolved. Granularity of
More informationConcurrency Control. Transaction Management. Lost Update Problem. Need for Concurrency Control. Concurrency control
Concurrency Control Process of managing simultaneous operations on the database without having them interfere with one another. Transaction Management Concurrency control Connolly & Begg. Chapter 19. Third
More informationUNIT 5. Failure Classification. Recovery Techniques. UNIT V Crash Recovery
UNIT 5 Failure Classification There are various types of failure that may occur in a system, each of which needs to be dealt with in a different manner. The simplest type of failure is one that does not
More informationIntro to DB CHAPTER 15 TRANSACTION MNGMNT
Intro to DB CHAPTER 15 TRANSACTION MNGMNT Chapter 15: Transactions Transaction Concept Transaction State Implementation of Atomicity and Durability Concurrent Executions Serializability Recoverability
More informationLecture 13 Concurrency Control
Lecture 13 Concurrency Control Shuigeng Zhou December 23, 2009 School of Computer Science Fudan University Outline Lock-Based Protocols Multiple Granularity Deadlock Handling Insert and Delete Operations
More informationCMSC 461 Final Exam Study Guide
CMSC 461 Final Exam Study Guide Study Guide Key Symbol Significance * High likelihood it will be on the final + Expected to have deep knowledge of can convey knowledge by working through an example problem
More informationDatabase Management Systems
Database Management Systems Associate Professor Dr. Raed Ibraheem Hamed University of Human Development, College of Science and Technology Computer Science Department 2015 2016 1 Points to Cover Transaction
More informationConcurrency Control. Concurrency Control Ensures interleaving of operations amongst concurrent transactions result in serializable schedules
Concurrency Control Concurrency Control Ensures interleaving of operations amongst concurrent transactions result in serializable schedules How? transaction operations interleaved following a protocol
More informationUNIT 3 DATABASE DESIGN
UNIT 3 DATABASE DESIGN Objective To study design guidelines for relational databases. To know about Functional dependencies. To have an understanding on First, Second, Third Normal forms To study about
More informationCHAPTER 3 RECOVERY & CONCURRENCY ADVANCED DATABASE SYSTEMS. Assist. Prof. Dr. Volkan TUNALI
CHAPTER 3 RECOVERY & CONCURRENCY ADVANCED DATABASE SYSTEMS Assist. Prof. Dr. Volkan TUNALI PART 1 2 RECOVERY Topics 3 Introduction Transactions Transaction Log System Recovery Media Recovery Introduction
More informationD.Hemavathi,R.Venkatalakshmi Assistant Professor, SRM University, Kattankulathur
DATABASE SYSTEMS IT 0303 5 TH Semester D.Hemavathi,R.Venkatalakshmi Assistant Professor, SRM University, Kattankulathur School of Computing, Department of IT Unit 5: Physical implementation, transaction
More informationROEVER ENGINEERING COLLEGE
ROEVER ENGINEERING COLLEGE ELAMBALUR, PERAMBALUR- 621 212 DEPARTMENT OF INFORMATION TECHNOLOGY DATABASE MANAGEMENT SYSTEMS UNIT-1 Questions And Answers----Two Marks 1. Define database management systems?
More informationIntroduction Conflict Serializability. Testing for Serializability Applications Scope of Research
Lecture- 22 Serializability Contents Introduction Conflict Serializability View Serializability Testing for Serializability Applications Scope of Research Introduction Basic Assumption Each transaction
More informationChapter 18 Concurrency Control Techniques
Chapter 18 Concurrency Control Techniques Copyright 2004 Pearson Education, Inc. Chapter 18 Outline Databases Concurrency Control 1 Purpose of Concurrency Control 2 Two-Phase locking 5 Limitations of CCMs
More informationIntroduction to Transaction Management
Introduction to Transaction Management CMPSCI 645 Apr 1, 2008 Slide content adapted from Ramakrishnan & Gehrke, Zack Ives 1 Concurrency Control Concurrent execution of user programs is essential for good
More informationDatabase Management Systems Paper Solution
Database Management Systems Paper Solution Following questions have been asked in GATE CS exam. 1. Given the relations employee (name, salary, deptno) and department (deptno, deptname, address) Which of
More informationCMSC 424 Database design Lecture 22 Concurrency/recovery. Mihai Pop
CMSC 424 Database design Lecture 22 Concurrency/recovery Mihai Pop Admin Signup sheet for project presentations Recap...1 ACID properties: Atomicity (recovery) Consistency (transaction design,, concurrency
More informationTransaction: Action, or series of actions, carried out by user or application, which accesses or changes contents of database. It Transforms database from one consistent state to another, although consistency
More informationElmasri/Navathe, Fundamentals of Database Systems, Fourth Edition Chapter 10-2
Elmasri/Navathe, Fundamentals of Database Systems, Fourth Edition Chapter 10-2 Chapter Outline 1 Informal Design Guidelines for Relational Databases 1.1Semantics of the Relation Attributes 1.2 Redundant
More informationCSE 444: Database Internals. Lectures Transactions
CSE 444: Database Internals Lectures 13-14 Transactions CSE 444 - Spring 2014 1 Announcements Lab 2 is due TODAY Lab 3 will be released today, part 1 due next Monday HW4 is due on Wednesday HW3 will be
More informationCopyright 2016 Ramez Elmasri and Shamkant B. Navathe
CHAPTER 14 Basics of Functional Dependencies and Normalization for Relational Databases Slide 14-2 Chapter Outline 1 Informal Design Guidelines for Relational Databases 1.1 Semantics of the Relation Attributes
More informationTechno India Batanagar Computer Science and Engineering. Model Questions. Subject Name: Database Management System Subject Code: CS 601
Techno India Batanagar Computer Science and Engineering Model Questions Subject Name: Database Management System Subject Code: CS 601 Multiple Choice Type Questions 1. Data structure or the data stored
More informationCopyright 2007 Ramez Elmasri and Shamkant B. Navathe. Slide 18-1
Slide 18-1 Chapter 18 Concurrency Control Techniques Chapter 18 Outline Databases Concurrency Control 1. Purpose of Concurrency Control 2. Two-Phase locking 3. Limitations of CCMs 4. Index Locking 5. Lock
More informationAttach extra pages as needed. Write your name and ID on any extra page that you attach. Please, write neatly.
UCLA Computer Science Department Fall 2003 Instructor: C. Zaniolo TA: Fusheng Wang Student Name and ID: CS143 Final EXAM: Closed Book, 3 Hours Attach extra pages as needed. Write your name and ID on any
More informationTransaction Processing: Basics - Transactions
Transaction Processing: Basics - Transactions Transaction is execution of program that accesses DB Basic operations: 1. read item(x): Read DB item X into program variable 2. write item(x): Write program
More informationCS352 Lecture - Concurrency
CS352 Lecture - Concurrency Objectives: Last revised 11/16/06 1. To introduce locking as a means of preserving the serializability of concurrent schedules. 2. To briefly introduce other approaches to this
More informationChapter 20 Introduction to Transaction Processing Concepts and Theory
Chapter 20 Introduction to Transaction Processing Concepts and Theory - Logical units of DB processing - Large database and hundreds of transactions - Ex. Stock market, super market, banking, etc - High
More informationChapter 22. Transaction Management
Chapter 22 Transaction Management 1 Transaction Support Transaction Action, or series of actions, carried out by user or application, which reads or updates contents of database. Logical unit of work on
More informationMultiversion schemes keep old versions of data item to increase concurrency. Multiversion Timestamp Ordering Multiversion Two-Phase Locking Each
Multiversion schemes keep old versions of data item to increase concurrency. Multiversion Timestamp Ordering Multiversion Two-Phase Locking Each successful write results in the creation of a new version
More informationDB2 Lecture 10 Concurrency Control
DB2 Lecture 10 Control Jacob Aae Mikkelsen November 28, 2012 1 / 71 Jacob Aae Mikkelsen DB2 Lecture 10 Control ACID Properties Properly implemented transactions are commonly said to meet the ACID test,
More informationCS352 Lecture - Concurrency
CS352 Lecture - Concurrency Objectives: Last revised 3/21/17 1. To introduce locking as a means of preserving the serializability of concurrent schedules. 2. To briefly introduce other approaches to this
More informationCheckpoints. Logs keep growing. After every failure, we d have to go back and replay the log. This can be time consuming. Checkpoint frequently
Checkpoints Logs keep growing. After every failure, we d have to go back and replay the log. This can be time consuming. Checkpoint frequently Output all log records currently in volatile storage onto
More informationA lock is a mechanism to control concurrent access to a data item Data items can be locked in two modes:
Concurrency Control Concurrency Control Lock-Based and Tree-Based Protocols Timestamp-Based Protocols Validation-Based Protocols Multiple Granularity Multiversion Schemes Insert and Delete Operations Concurrency
More informationPage 1. Goals of Today s Lecture" Two Key Questions" Goals of Transaction Scheduling"
Goals of Today s Lecture" CS162 Operating Systems and Systems Programming Lecture 19 Transactions, Two Phase Locking (2PL), Two Phase Commit (2PC)" Transaction scheduling Two phase locking (2PL) and strict
More informationTransactions and Concurrency Control
Transactions and Concurrency Control Computer Science E-66 Harvard University David G. Sullivan, Ph.D. Overview A transaction is a sequence of operations that is treated as a single logical operation.
More informationDefn. A schedule is called Serial if the operations of each individual Tx are performed sequentially.
C. Shadow Paging. (Doesn t require a log file) The database is made up of some number of disk pages. A "page table" is constructed with one entry per data page (The page address). When a Tx begins, the
More informationPage 1. Goals of Todayʼs Lecture" Two Key Questions" Goals of Transaction Scheduling"
Goals of Todayʼs Lecture" CS162 Operating Systems and Systems Programming Lecture 19 Transactions, Two Phase Locking (2PL), Two Phase Commit (2PC)" Transaction scheduling Two phase locking (2PL) and strict
More informationReferences. Concurrency Control. Administração e Optimização de Bases de Dados 2012/2013. Helena Galhardas e
Administração e Optimização de Bases de Dados 2012/2013 Concurrency Control Helena Galhardas DEI@Técnico e DMIR@INESC-ID Chpt 15 Silberchatz Chpt 17 Raghu References 1 Summary Lock-Based Protocols Multiple
More informationRelational Database design. Slides By: Shree Jaswal
Relational Database design Slides By: Shree Jaswal Topics: Design guidelines for relational schema, Functional Dependencies, Definition of Normal Forms- 1NF, 2NF, 3NF, BCNF, Converting Relational Schema
More information