Lecture 2.4 Recoverability
Lecture 2.4 Recoverability
Database
Management System
UNIT-I [10h]
Overview of Databases: Database concepts, DBMS, Data Base System Architecture (Three
Level ANSI-SPARC Architecture), Advantages and Disadvantages of DBMS, Data Independence,
DBA and Responsibilities of DBA, Relational Data Structure, Keys, Relations, Attributes, Schema and
Instances, Referential integrity, Entity integrity.
Data Models: Relational Model, Network Model, Hierarchical Model, ER Model: Design,
issues, Mapping constraints, ER diagram, Comparison of Models.
UNIT-II [10h]
Functional dependencies and Normalization: Functional dependencies, Decomposition, Full
Functional Dependency (FFD), Transitive Dependency (TD), Join Dependency (JD), Multi-valued
Dependency (MVD), Normal Forms (1NF, 2NF, 3NF, BCNF), De-normalization.
Database Security: Introduction, Threats, Counter Measures.
Control Structures: Introduction to conditional control, Iterative control and sequential control
statements, Cursors, Views.
3
Contents of the Syllabus
UNIT-III [10h]
Package, Procedures and Triggers: Parts of procedures, Parameter modes, Advantages of
procedures, Syntax for creating triggers, Types of triggers, package specification and package body,
developing a package, Bodiless package, Advantages of packages.
Transaction Management and Concurrency Control: Introduction to Transaction Processing,
Properties of Transactions, Serializability and Recoverability, Need for Concurrency Control, Locking
Techniques, Time Stamping Methods, Optimistic Techniques and Granularity of Data items.
Database Recovery of database: Introduction, Need for Recovery, Types of errors, Recovery
Techniques.
4
Department of Computer Science and Engineering (CSE)
Example 1:
S1: R1(x), W1(x), R2(x), R1(y), R2(y), W2(x),
W1(y), C1, C2;
Given schedule follows order of Ti->Tj => C1->C2. Transaction T1 is
executed before T2 hence there is no chances of conflict occur.
R1(x) appears before W1(x) and transaction T1 is committed before
T2 i.e. completion of first transaction performed first update on data
item x, hence given schedule is recoverable.
Example 2: Consider the following schedule
involving two transactions T1 and T2.
This is a recoverable schedule since T1 commits before T2, that makes the value read
by T2 correct.
T1 T2
R(A)
W(A)
W(A)
R(A)
commit
commit
Irrecoverable Schedule
The table below shows a schedule with two transactions, T1 reads and writes A and
that value is read and written by T2. T2 commits.
But later on, T1 fails. So we have to rollback T1. Since T2 has read the value written by
T1, it should also be rollbacked. But we have already committed that.
The table below shows a schedule with two transactions, T1 reads and writes A and
commits and that value is read by T2. But if T1 fails before commit, no other transaction
has read its value, so there is no need to rollback other transaction.
• DatabaseSystemConceptsbySudarshan,Korth(McGraw-
HillEducation)
• FundamentalsofDatabaseSystemByElmasari&Navathe-
PearsonEducation
• http://labe.felk.cvut.cz/~stepan/AE3B33OSD/Transactions.
pdf
• http://cis.csuohio.edu/~sschung/IST331/Coronel_PPT_.pdf
• http://www.geeksforgeeks.org/dbms-gq/transactions-and-
concurrency-control-gq
• https://en.wikipedia.org/wiki/Concurrency_control