You are on page 1of 15

Department of Computer Science and Engineering (CSE)

Database
Management System

Course Outcome Will be covered in


CO Title Level this lecture
Number
CO1 To perceive the significance and Remember
implementation of a commercial  
relational database system (Oracle)
by writing SQL using the system.
CO2 To understand the relational database Understand
theory, and be able to write  
relational algebra expressions for
queries
CO3 To identify the basic issues of Analysis and
transaction processing and application
concurrency control and find out its
solutions.

2
Contents of the Syllabus

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.
Relational Algebra & Relational Calculus: Introduction, Syntax, Semantics, Additional
operators, Grouping and Ungrouping, Relational comparisons, Tuple Calculus, Domain Calculus,
Calculus Vs Algebra, Computational capabilities.

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)

(Transaction Management and Concurrency Control)


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.
Learning Objective
• About database transactions and their
properties
• concurrency control and role it plays in
maintaining the database’s integrity
• locking methods and how they work
• How optimistic methods ,stamping methods
are used for concurrency control
Learning Outcome
• Importance of ACID properties in transactions.
• Discuss the concepts of concurrency
transparency.
• Discuss the role of locks to prevent
interference problems among multiple users.
Recoverable Schedules
Need to address the effect of transaction failures on concurrently
running transactions.
• Recoverable schedule — if a transaction Tj reads a data item
previously written by a transaction Ti , then the commit
operation of Ti appears before the commit operation of Tj.
• The following schedule (Schedule 11) is not recoverable

• 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.
Recoverable Schedules
Schedules in which transactions commit only after all transactions whose
changes they read commit are called recoverable schedules.

In other words, if some transaction T  is reading value updated or written by


j

some other transaction T , then the commit of T  must occur after the commit
i j

of T.
i

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.

So this schedule is irrecoverable schedule. When Tj is reading the value updated by Ti and Tj is
committed before committing of Ti, the schedule will be irrecoverable.
Cascadeless Recoverable
Rollback
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.

So this is a Cascadeless recoverable schedule. So, if Tj reads value updated by Ti only after Ti is
committed, the schedule will be cascadeless recoverable.
Cascading Rollbacks
• 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)

If T10 fails, T11 and T12 must also be rolled back.


• Can lead to the undoing of a significant amount of work
Cascadeless Schedules
• 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
Frequently Asked Questions
• Discuss various types of Locks in Transactions.
• Define Timestamps and their applications.
• What is a Transaction? How Concurrent
Tranasctions carried out?
• Differentiate between Isolation and Durability.
• What are Schedules?
• Define Serilizability.
References

• 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-concu
rrency-control-gq
• https://en.wikipedia.org/wiki/Concurrency_control

You might also like