cm603.21 name : p.rajesh year/semester : vi semester subject : advanced database system subject code...

21
CM603.2 1 Name : p.rajesh Year/Semester : VI Semester Subject : Advanced database system Subject Code : CM-603 Topic : Advanced database concepts Duration : 50 minutes Sub Topic : Transactions Properties Teaching Aids : Animation clips

Upload: osborn-mccormick

Post on 19-Jan-2016

221 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: CM603.21 Name : p.rajesh Year/Semester : VI Semester Subject : Advanced database system Subject Code : CM-603 Topic : Advanced database concepts Duration

CM603.2 1

Name : p.rajesh

Year/Semester : VI Semester

Subject : Advanced database system

Subject Code : CM-603

Topic : Advanced database concepts

Duration : 50 minutes

Sub Topic : Transactions Properties

Teaching Aids : Animation clips

Page 2: CM603.21 Name : p.rajesh Year/Semester : VI Semester Subject : Advanced database system Subject Code : CM-603 Topic : Advanced database concepts Duration

CM603.2 2

Recap

In this previous class, you have learnt about

• Basics of Transactions

Page 3: CM603.21 Name : p.rajesh Year/Semester : VI Semester Subject : Advanced database system Subject Code : CM-603 Topic : Advanced database concepts Duration

CM603.2 3

OBJECTIVES:

On completion of this period, you would be able to know

•Transactions Properties

Page 4: CM603.21 Name : p.rajesh Year/Semester : VI Semester Subject : Advanced database system Subject Code : CM-603 Topic : Advanced database concepts Duration

CM603.2 4

Transactions and Concurrent Execution

• Transaction - DBMS’s abstract view of a user program (or activity): • A sequence of reads and writes of database objects.• Unit of work that must commit or abort as an atomic

unit• Transaction Manager controls the execution of

transactions.• User’s program logic is invisible to DBMS

• Arbitrary computation possible on data fetched from the DB

• The DBMS only sees data read/written from/to the DB.

Page 5: CM603.21 Name : p.rajesh Year/Semester : VI Semester Subject : Advanced database system Subject Code : CM-603 Topic : Advanced database concepts Duration

CM603.2 5

Definitions

• Data Items—collection of objects representing a database.

• Granularity—size of a data item.• Concurrency—multiple users accessing a

database instance at the same time.• Transaction—a logical unit of database

processing that includes one or more database access operations from the following• Insert, Delete, Modify, Retrieve operations

• Serializability—Interleaving execution of a set of concurrent transactions without “giving up any correctness”.

Page 6: CM603.21 Name : p.rajesh Year/Semester : VI Semester Subject : Advanced database system Subject Code : CM-603 Topic : Advanced database concepts Duration

CM603.2 6

Definitions

• Concurrency Control Protocols—set of rules for defining the execution of concurrent transactions (ultimately to ensure serializability)• Optimistic Concurrency Control—validation or

certification of a transaction AFTER it executes• If interference is detected, the transaction is

aborted and restarted at a later time

Contd…

Page 7: CM603.21 Name : p.rajesh Year/Semester : VI Semester Subject : Advanced database system Subject Code : CM-603 Topic : Advanced database concepts Duration

CM603.2 7

Transaction Properties

All transactions must display Atomicity, Consistency, Isolation, Durability and Serializability.

• These properties are referred to as ACIDS test

Page 8: CM603.21 Name : p.rajesh Year/Semester : VI Semester Subject : Advanced database system Subject Code : CM-603 Topic : Advanced database concepts Duration

CM603.2 8

Atomicity

• Atomicity requires that all operations of a transaction must be completed. If not the transaction is aborted.

• If a transaction T1 has four SQL requests, all four requests must be successfully completed. Otherwise the entire transaction is aborted. – In other words, a transaction is treated as a

single, indivisible, logical unit of work.

Page 9: CM603.21 Name : p.rajesh Year/Semester : VI Semester Subject : Advanced database system Subject Code : CM-603 Topic : Advanced database concepts Duration

CM603.2 9

Consistency

• A transaction must transform the database from one consistent state to another consistent state.

• It is the responsibility of both the DBMS and the application programmers to ensure consistency.

• Consistency indicates the permanence of the database’s consistent state.

• When a transaction is completed the database reaches a consistent state.

Page 10: CM603.21 Name : p.rajesh Year/Semester : VI Semester Subject : Advanced database system Subject Code : CM-603 Topic : Advanced database concepts Duration

CM603.2 10

Isolation:• Transactions execute independently of one another. • The partial effects of a transaction should not be

visible to other transactions.• Isolation means that the data used during the

execution of a transaction cannot be used by a record transaction until the first one is completed.

• This property is useful in multi-user database environment because several different users can access and update the database at the same time

Page 11: CM603.21 Name : p.rajesh Year/Semester : VI Semester Subject : Advanced database system Subject Code : CM-603 Topic : Advanced database concepts Duration

CM603.2 11

Durability

• Once a transaction is completed successfully, its results are recorded permanently in the database .

• They should not be lost because of any subsequent failures

Page 12: CM603.21 Name : p.rajesh Year/Semester : VI Semester Subject : Advanced database system Subject Code : CM-603 Topic : Advanced database concepts Duration

CM603.2 12

Serializability

• A schedule is a list of operations by a set of concurrent transactions.

• A schedule is called serial when the operations of each transaction are executed consecutively without any interleaving.

• If there is any interleaving among the transaction then the schedule is non-serial.

Page 13: CM603.21 Name : p.rajesh Year/Semester : VI Semester Subject : Advanced database system Subject Code : CM-603 Topic : Advanced database concepts Duration

CM603.2 13

• When transactions are executed concurrently in

a non-serial schedule is producing the same results as a serial schedule then the schedule is called serializable.

• A serial schedule never leaves the database in inconsistent state.

• Serializability is to find non-serial schedules, which can allow transactions to run concurrently with no interference and can produce correct results

Serializability

Contd…

Page 14: CM603.21 Name : p.rajesh Year/Semester : VI Semester Subject : Advanced database system Subject Code : CM-603 Topic : Advanced database concepts Duration

CM603.2 14

Summary

We have discussed about

Transactions Properties- ACIDS

Page 15: CM603.21 Name : p.rajesh Year/Semester : VI Semester Subject : Advanced database system Subject Code : CM-603 Topic : Advanced database concepts Duration

CM603.2 15

1. Transaction properties are also known as---

(a) DBMS

(b) RDBMS

(c) ACIDS

(d) AIDS

QUIZ

Page 16: CM603.21 Name : p.rajesh Year/Semester : VI Semester Subject : Advanced database system Subject Code : CM-603 Topic : Advanced database concepts Duration

CM603.2 16

1. Transaction properties are also known as---

(a) DBMS

(b) RDBMS

(c) ACIDS

(d) AIDS

QUIZ

Page 17: CM603.21 Name : p.rajesh Year/Semester : VI Semester Subject : Advanced database system Subject Code : CM-603 Topic : Advanced database concepts Duration

CM603.2 17

2. The property that transaction completed successfully is --

(a) serial

(b) isolated

(c) durability

(d) atomicity

QUIZ

Page 18: CM603.21 Name : p.rajesh Year/Semester : VI Semester Subject : Advanced database system Subject Code : CM-603 Topic : Advanced database concepts Duration

CM603.2 18

(a) serial

(b) isolated

(c) durability

(d) atomicity

QUIZ

2. The property that transaction completed successfully is --

Page 19: CM603.21 Name : p.rajesh Year/Semester : VI Semester Subject : Advanced database system Subject Code : CM-603 Topic : Advanced database concepts Duration

CM603.2 19

3. Serial schedule is ------

(a) physical

(b) stream

(c) multi

(d) serializable

QUIZ

Page 20: CM603.21 Name : p.rajesh Year/Semester : VI Semester Subject : Advanced database system Subject Code : CM-603 Topic : Advanced database concepts Duration

CM603.2 20

3. Serial schedule is ------

(a) physical

(b) stream

(c) multi

(d) serializable

QUIZ

Page 21: CM603.21 Name : p.rajesh Year/Semester : VI Semester Subject : Advanced database system Subject Code : CM-603 Topic : Advanced database concepts Duration

CM603.2 21

Questions

1. Explain Transaction properties?