SlideShare a Scribd company logo
2
Most read
7
Most read
11
Most read
Concurrency Control
Techniques
UNIT-V
Concurrency Control
In a multiprogramming environment where multiple transactions can be executed
simultaneously, it is highly important to control the concurrency of transactions. We have
concurrency control protocols to ensure atomicity, isolation, and serializability of concurrent
transactions. Concurrency control protocols can be broadly divided into two categories −
• Lock based protocols
• Time stamp based protocols
Lock-based Protocols
Database systems equipped with lock-based protocols use a mechanism by which any
transaction cannot read or write data until it acquires an appropriate lock on it. Locks are of two
kinds –
• Binary Locks − A lock on a data item can be in two states; it is either locked or unlocked.
• Shared/exclusive − This type of locking mechanism differentiates the locks based on their uses.
If a lock is acquired on a data item to perform a write operation, it is an exclusive lock. Allowing
more than one transaction to write on the same data item would lead the database into an
inconsistent state. Read locks are shared because no data value is being changed.
Lock Protocols
There are four types of lock of protocol-
• Simplistic Lock Protocol
• Pre-claiming Lock Protocol
• Two-Phase Locking 2PL
• Strict Two Phase Locking
Simplistic Lock Protocol
Simplistic lock-based protocols allow transactions to obtain a lock on every object before a
'write' operation is performed. Transactions may unlock the data item after completing the
‘write’ operation.
Pre-claiming Lock Protocol
• Pre-claiming protocols evaluate their operations and
create a list of data items on which they need locks.
• Before initiating an execution, the transaction
requests the system for all the locks it needs
beforehand.
• If all the locks are granted, the transaction executes
and releases all the locks when all its operations are
over.
• If all the locks are not granted, the transaction rolls
back and waits until all the locks are granted.
Two-phase Locking 2PL
• This locking protocol divides the execution phase of a transaction into three parts.
• In the first part, when the transaction starts executing, it seeks permission for the locks it
requires.
• The second part is where the transaction acquires all the locks. As soon as the transaction
releases its first lock, the third phase starts.
• In third part, the transaction cannot demand any new locks; it only releases the acquired locks.
• Two-phase locking has two phases, one is growing, where all the locks are being acquired by
the transaction; and the second phase is shrinking, where the locks held by the transaction are
being released.
• To claim an exclusive (write) lock, a transaction must first acquire a shared (read) lock and then
upgrade it to an exclusive lock.
Strict Two-Phase Locking
• The first phase of Strict-2PL is same as 2PL. After acquiring all the locks in the first phase, the
transaction continues to execute normally.
• In contrast to 2PL, Strict-2PL does not release a lock after using it.
• Strict-2PL holds all the locks until the commit point and releases all the locks at a time.
Timestamp based Protocols
• Lock-based protocols manage the order between the conflicting pairs among transactions at the
time of execution, whereas timestamp-based protocols start working as soon as a transaction is
created.
• Every transaction has a timestamp associated with it, and the ordering is determined by the age
of the transaction.
• A transaction created at 0002 clock time would be older than all other transactions that come
after it. For example, any transaction 'y' entering the system at 0004 is two seconds younger and
the priority would be given to the older one.
• In addition, every data item is given the latest read and write-timestamp. This lets the system
know when the last ‘read and write’ operation was performed on the data item.
Timestamp Ordering Protocol
The timestamp-ordering protocol ensures serializability among transactions in their conflicting
read and write operations. This is the responsibility of the protocol system that the conflicting
pair of tasks should be executed according to the timestamp values of the transactions.
• The timestamp of transaction Ti is denoted as TS(Ti).
• Read time-stamp of data-item X is denoted by R-timestamp(X).
• Write time-stamp of data-item X is denoted by W-timestamp(X)
If a transaction Ti issues a read(X)
operation −
◦ If TS(Ti) < W-timestamp(X)
◦ Operation rejected. (TS(Ti) is a
younger transaction)
◦ If TS(Ti) >= W-timestamp(X)
◦ Operation executed. (TS(Ti) is an older
transaction)
◦ All data-item timestamps updated.
If a transaction Ti issues a write(X)
operation −
• If TS(Ti) < R-timestamp(X)
• Operation rejected.
• If TS(Ti) < W-timestamp(X)
• Operation rejected and Ti
rolled back. (Thomas Write Rule)
• Otherwise, operation executed.
Timestamp ordering protocol works as follows −
Multiple Granularity
Multiple Granularity is the hierarchically breaking up the database into portions which are
lockable and maintaining the track of what to be lock and how much to be lock so that it can be
decided very quickly either to lock a data item or to unlock a data item.
Recovery with Concurrent Transaction
Checkpoint
Keeping and maintaining logs in real time and in real environment may fill out all the memory
space available in the system. As time passes, the log file may grow too big to be handled at all.
Checkpoint is a mechanism where all the previous logs are removed from the system and stored
permanently in a storage disk. Checkpoint declares a point before which the DBMS was in
consistent state, and all the transactions were committed.
Recovery
When a system with concurrent transactions crashes and recovers, it behaves in the following
manner −
• The recovery system reads the logs backwards from the end to the last checkpoint.
• It maintains two lists, an undo-list and a redo-list.
• If the recovery system sees a log with <Tn, Start> and <Tn, Commit> or just <Tn, Commit>, it
puts the transaction in the redo-list.
• If the recovery system sees a log with <Tn, Start> but no commit or abort log found, it puts the
transaction in undo-list.
Transaction Processing in Distributed
Systems
A transaction is a logical unit of work constituted by one or more SQL statements executed by a
single user. A transaction begins with the user's first executable SQL statement and ends when it
is committed or rolled back by that user.
A remote transaction contains only statements that access a single remote node. A distributed
transaction contains statements that access more than one node.
SELECT * FROM scott.dept@sales.us.americas.acme_auto.com;
Remote Select SQL Statement
UPDATE scott.dept@mktng.us.americas.acme_auto.com SET loc = 'NEW YORK' WHERE deptno = 10;
Remote Update SQL Statement
Distributed SQL Statement
SELECT ename, dname FROM scott.emp e, scott.dept@sales.us.americas.acme_auto.com d WHERE e.deptno = d.deptno;
BEGIN
UPDATE scott.dept@sales.us.americas.acme_auto.com
SET loc = 'NEW YORK'
WHERE deptno = 10;
UPDATE scott.emp
SET deptno = 11
WHERE deptno = 10;
END;
COMMIT;
A distributed update statement modifies data on
two or more nodes.
A distributed update is possible using a PL/SQL
subprogram unit such as a procedure or trigger
that includes two or more remote updates that
access data on different nodes.
For example, the following PL/SQL program unit
updates tables on the local database and the
remote sales database:
Data Replication and Allocation
Replication is useful in in improving the availability of data.
This can improve availability remarkably because the system can continue to operate as long as
at least one site is up. It also improves performance of retrieval for global queries, because the
result of such a query can be obtained locally from any one site.
The disadvantage of full Replication is that it can slow down update operations drastically, since
a single logical update must be performed on every copy of the database to keep the copies
consistent.
THANKS

More Related Content

PPTX
Concurrency control
Subhasish Pati
 
PDF
Serializability
Pyingkodi Maran
 
PPTX
System components (os)
snegacmr
 
PPTX
Timestamp protocols
Prashant Saini
 
PPTX
Critical section problem in operating system.
MOHIT DADU
 
PPTX
Concurrency Control in Database Management System
Janki Shah
 
PPTX
Deadlock dbms
Vardhil Patel
 
PPT
16. Concurrency Control in DBMS
koolkampus
 
Concurrency control
Subhasish Pati
 
Serializability
Pyingkodi Maran
 
System components (os)
snegacmr
 
Timestamp protocols
Prashant Saini
 
Critical section problem in operating system.
MOHIT DADU
 
Concurrency Control in Database Management System
Janki Shah
 
Deadlock dbms
Vardhil Patel
 
16. Concurrency Control in DBMS
koolkampus
 

What's hot (20)

PPTX
Transactions and Concurrency Control
Dilum Bandara
 
PPTX
Analysis and Design of Algorithms
Bulbul Agrawal
 
PPTX
Page replacement algorithms
Piyush Rochwani
 
PPTX
Distributed concurrency control
Binte fatima
 
ODP
Distributed operating system(os)
Dinesh Modak
 
PPTX
Concurrency control
Javed Khan
 
PPTX
Distributed Database Management System
AAKANKSHA JAIN
 
PPTX
protocols of concurrency control
MOHIT DADU
 
PPTX
Paging and segmentation
Piyush Rochwani
 
PPTX
Acid properties
NomitaKumawat
 
PPTX
Distributed Shared Memory
Prakhar Rastogi
 
DOCX
Concurrency Control Techniques
Raj vardhan
 
PPTX
Concurrency control
Soumyajit Dutta
 
PPT
fault-tolerance-slide.ppt
Shailendra61
 
PPT
Synchronization in distributed systems
SHATHAN
 
PPT
Lecture 5 sorting and searching
Nada G.Youssef
 
PPTX
Memory Management in OS
Kumar Pritam
 
PDF
Feng’s classification
Narayan Kandel
 
PPT
File models and file accessing models
ishmecse13
 
PDF
CS9222 ADVANCED OPERATING SYSTEMS
Kathirvel Ayyaswamy
 
Transactions and Concurrency Control
Dilum Bandara
 
Analysis and Design of Algorithms
Bulbul Agrawal
 
Page replacement algorithms
Piyush Rochwani
 
Distributed concurrency control
Binte fatima
 
Distributed operating system(os)
Dinesh Modak
 
Concurrency control
Javed Khan
 
Distributed Database Management System
AAKANKSHA JAIN
 
protocols of concurrency control
MOHIT DADU
 
Paging and segmentation
Piyush Rochwani
 
Acid properties
NomitaKumawat
 
Distributed Shared Memory
Prakhar Rastogi
 
Concurrency Control Techniques
Raj vardhan
 
Concurrency control
Soumyajit Dutta
 
fault-tolerance-slide.ppt
Shailendra61
 
Synchronization in distributed systems
SHATHAN
 
Lecture 5 sorting and searching
Nada G.Youssef
 
Memory Management in OS
Kumar Pritam
 
Feng’s classification
Narayan Kandel
 
File models and file accessing models
ishmecse13
 
CS9222 ADVANCED OPERATING SYSTEMS
Kathirvel Ayyaswamy
 
Ad

Similar to Concurrency Control (20)

PDF
Concurrency note.pdf
BijayNag1
 
PPTX
Transaction management
janani thirupathi
 
PDF
F017213747
IOSR Journals
 
PDF
Design & Development of an Advanced Database Management System Using Multiver...
IOSR Journals
 
PDF
F017213747
IOSR Journals
 
PPTX
Concurrency control PPT
ShushrutGupta
 
PPTX
DBMS Pravin concurrency control technique.pptx
PravinBhargav1
 
PPTX
Unit 5 dbms
Sweta Singh
 
PPTX
Unit 4 Concurrency control.pptx dbms lovely
PritishMajumdar3
 
PPTX
Unit 4 Concurrency control.pptx dbms lovely
PritishMajumdar3
 
PPTX
DBMS Presentation.pptx
PravinBhargav1
 
PDF
concurrencycontrol from power pint pdf a
MdAyanParwez
 
PPTX
Concurrency control
Jaya Jeswani
 
PPTX
Concurrency Control in Distributed Systems.pptx
MArshad35
 
PDF
Transaction Management, Concurrency Control and Deadlocks.pdf
beshahashenafe20
 
PPTX
Overview of Concurrency Control & Recovery in Distributed Databases
Meghaj Mallick
 
PPTX
DBMS Session 6 Transactions Management and Concurrency Control.pptx
kimwesther86
 
PPTX
Vani dbms
SangeethaSasi1
 
PDF
PPT-concurrency Control database management system DBMS concurrent control (U...
PratikshaSatpute8
 
PDF
Advanced Database Chapter 4.pdf shnsbxlajmndm woweosmkl m,xcnkl C NOOxcx xcbnxc
alemunuruhak9
 
Concurrency note.pdf
BijayNag1
 
Transaction management
janani thirupathi
 
F017213747
IOSR Journals
 
Design & Development of an Advanced Database Management System Using Multiver...
IOSR Journals
 
F017213747
IOSR Journals
 
Concurrency control PPT
ShushrutGupta
 
DBMS Pravin concurrency control technique.pptx
PravinBhargav1
 
Unit 5 dbms
Sweta Singh
 
Unit 4 Concurrency control.pptx dbms lovely
PritishMajumdar3
 
Unit 4 Concurrency control.pptx dbms lovely
PritishMajumdar3
 
DBMS Presentation.pptx
PravinBhargav1
 
concurrencycontrol from power pint pdf a
MdAyanParwez
 
Concurrency control
Jaya Jeswani
 
Concurrency Control in Distributed Systems.pptx
MArshad35
 
Transaction Management, Concurrency Control and Deadlocks.pdf
beshahashenafe20
 
Overview of Concurrency Control & Recovery in Distributed Databases
Meghaj Mallick
 
DBMS Session 6 Transactions Management and Concurrency Control.pptx
kimwesther86
 
Vani dbms
SangeethaSasi1
 
PPT-concurrency Control database management system DBMS concurrent control (U...
PratikshaSatpute8
 
Advanced Database Chapter 4.pdf shnsbxlajmndm woweosmkl m,xcnkl C NOOxcx xcbnxc
alemunuruhak9
 
Ad

More from Nishant Munjal (20)

PPTX
Database Management System
Nishant Munjal
 
PPTX
Functions & Recursion
Nishant Munjal
 
PPTX
Array, string and pointer
Nishant Munjal
 
PPTX
Programming in C
Nishant Munjal
 
PPTX
Introduction to computers
Nishant Munjal
 
PPTX
Unix Administration
Nishant Munjal
 
PPTX
Shell Programming Concept
Nishant Munjal
 
PPTX
VI Editor
Nishant Munjal
 
PPTX
Introduction to Unix
Nishant Munjal
 
PPTX
Routing Techniques
Nishant Munjal
 
PPTX
Asynchronous Transfer Mode
Nishant Munjal
 
PPTX
Overview of Cloud Computing
Nishant Munjal
 
PPTX
SQL Queries Information
Nishant Munjal
 
PPTX
Database Design and Normalization Techniques
Nishant Munjal
 
PPTX
Transaction Processing Concept
Nishant Munjal
 
PPTX
Database Management System
Nishant Munjal
 
PPTX
Relational Data Model Introduction
Nishant Munjal
 
PPTX
Virtualization, A Concept Implementation of Cloud
Nishant Munjal
 
PPTX
Technical education benchmarks
Nishant Munjal
 
PPSX
Bluemix Introduction
Nishant Munjal
 
Database Management System
Nishant Munjal
 
Functions & Recursion
Nishant Munjal
 
Array, string and pointer
Nishant Munjal
 
Programming in C
Nishant Munjal
 
Introduction to computers
Nishant Munjal
 
Unix Administration
Nishant Munjal
 
Shell Programming Concept
Nishant Munjal
 
VI Editor
Nishant Munjal
 
Introduction to Unix
Nishant Munjal
 
Routing Techniques
Nishant Munjal
 
Asynchronous Transfer Mode
Nishant Munjal
 
Overview of Cloud Computing
Nishant Munjal
 
SQL Queries Information
Nishant Munjal
 
Database Design and Normalization Techniques
Nishant Munjal
 
Transaction Processing Concept
Nishant Munjal
 
Database Management System
Nishant Munjal
 
Relational Data Model Introduction
Nishant Munjal
 
Virtualization, A Concept Implementation of Cloud
Nishant Munjal
 
Technical education benchmarks
Nishant Munjal
 
Bluemix Introduction
Nishant Munjal
 

Recently uploaded (20)

PDF
Machine Learning All topics Covers In This Single Slides
AmritTiwari19
 
PPTX
Chapter_Seven_Construction_Reliability_Elective_III_Msc CM
SubashKumarBhattarai
 
PPTX
Inventory management chapter in automation and robotics.
atisht0104
 
PPTX
MULTI LEVEL DATA TRACKING USING COOJA.pptx
dollysharma12ab
 
PDF
FLEX-LNG-Company-Presentation-Nov-2017.pdf
jbloggzs
 
PPTX
IoT_Smart_Agriculture_Presentations.pptx
poojakumari696707
 
PDF
67243-Cooling and Heating & Calculation.pdf
DHAKA POLYTECHNIC
 
PPTX
Civil Engineering Practices_BY Sh.JP Mishra 23.09.pptx
bineetmishra1990
 
PPTX
MSME 4.0 Template idea hackathon pdf to understand
alaudeenaarish
 
PDF
Introduction to Ship Engine Room Systems.pdf
Mahmoud Moghtaderi
 
PPTX
quantum computing transition from classical mechanics.pptx
gvlbcy
 
PDF
2025 Laurence Sigler - Advancing Decision Support. Content Management Ecommer...
Francisco Javier Mora Serrano
 
PDF
AI-Driven IoT-Enabled UAV Inspection Framework for Predictive Maintenance and...
ijcncjournal019
 
PDF
LEAP-1B presedntation xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
hatem173148
 
PDF
The Effect of Artifact Removal from EEG Signals on the Detection of Epileptic...
Partho Prosad
 
PPTX
22PCOAM21 Session 2 Understanding Data Source.pptx
Guru Nanak Technical Institutions
 
PDF
20ME702-Mechatronics-UNIT-1,UNIT-2,UNIT-3,UNIT-4,UNIT-5, 2025-2026
Mohanumar S
 
PPTX
sunil mishra pptmmmmmmmmmmmmmmmmmmmmmmmmm
singhamit111
 
PPTX
Module2 Data Base Design- ER and NF.pptx
gomathisankariv2
 
PDF
Construction of a Thermal Vacuum Chamber for Environment Test of Triple CubeS...
2208441
 
Machine Learning All topics Covers In This Single Slides
AmritTiwari19
 
Chapter_Seven_Construction_Reliability_Elective_III_Msc CM
SubashKumarBhattarai
 
Inventory management chapter in automation and robotics.
atisht0104
 
MULTI LEVEL DATA TRACKING USING COOJA.pptx
dollysharma12ab
 
FLEX-LNG-Company-Presentation-Nov-2017.pdf
jbloggzs
 
IoT_Smart_Agriculture_Presentations.pptx
poojakumari696707
 
67243-Cooling and Heating & Calculation.pdf
DHAKA POLYTECHNIC
 
Civil Engineering Practices_BY Sh.JP Mishra 23.09.pptx
bineetmishra1990
 
MSME 4.0 Template idea hackathon pdf to understand
alaudeenaarish
 
Introduction to Ship Engine Room Systems.pdf
Mahmoud Moghtaderi
 
quantum computing transition from classical mechanics.pptx
gvlbcy
 
2025 Laurence Sigler - Advancing Decision Support. Content Management Ecommer...
Francisco Javier Mora Serrano
 
AI-Driven IoT-Enabled UAV Inspection Framework for Predictive Maintenance and...
ijcncjournal019
 
LEAP-1B presedntation xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
hatem173148
 
The Effect of Artifact Removal from EEG Signals on the Detection of Epileptic...
Partho Prosad
 
22PCOAM21 Session 2 Understanding Data Source.pptx
Guru Nanak Technical Institutions
 
20ME702-Mechatronics-UNIT-1,UNIT-2,UNIT-3,UNIT-4,UNIT-5, 2025-2026
Mohanumar S
 
sunil mishra pptmmmmmmmmmmmmmmmmmmmmmmmmm
singhamit111
 
Module2 Data Base Design- ER and NF.pptx
gomathisankariv2
 
Construction of a Thermal Vacuum Chamber for Environment Test of Triple CubeS...
2208441
 

Concurrency Control

  • 2. Concurrency Control In a multiprogramming environment where multiple transactions can be executed simultaneously, it is highly important to control the concurrency of transactions. We have concurrency control protocols to ensure atomicity, isolation, and serializability of concurrent transactions. Concurrency control protocols can be broadly divided into two categories − • Lock based protocols • Time stamp based protocols
  • 3. Lock-based Protocols Database systems equipped with lock-based protocols use a mechanism by which any transaction cannot read or write data until it acquires an appropriate lock on it. Locks are of two kinds – • Binary Locks − A lock on a data item can be in two states; it is either locked or unlocked. • Shared/exclusive − This type of locking mechanism differentiates the locks based on their uses. If a lock is acquired on a data item to perform a write operation, it is an exclusive lock. Allowing more than one transaction to write on the same data item would lead the database into an inconsistent state. Read locks are shared because no data value is being changed.
  • 4. Lock Protocols There are four types of lock of protocol- • Simplistic Lock Protocol • Pre-claiming Lock Protocol • Two-Phase Locking 2PL • Strict Two Phase Locking
  • 5. Simplistic Lock Protocol Simplistic lock-based protocols allow transactions to obtain a lock on every object before a 'write' operation is performed. Transactions may unlock the data item after completing the ‘write’ operation.
  • 6. Pre-claiming Lock Protocol • Pre-claiming protocols evaluate their operations and create a list of data items on which they need locks. • Before initiating an execution, the transaction requests the system for all the locks it needs beforehand. • If all the locks are granted, the transaction executes and releases all the locks when all its operations are over. • If all the locks are not granted, the transaction rolls back and waits until all the locks are granted.
  • 7. Two-phase Locking 2PL • This locking protocol divides the execution phase of a transaction into three parts. • In the first part, when the transaction starts executing, it seeks permission for the locks it requires. • The second part is where the transaction acquires all the locks. As soon as the transaction releases its first lock, the third phase starts. • In third part, the transaction cannot demand any new locks; it only releases the acquired locks. • Two-phase locking has two phases, one is growing, where all the locks are being acquired by the transaction; and the second phase is shrinking, where the locks held by the transaction are being released. • To claim an exclusive (write) lock, a transaction must first acquire a shared (read) lock and then upgrade it to an exclusive lock.
  • 8. Strict Two-Phase Locking • The first phase of Strict-2PL is same as 2PL. After acquiring all the locks in the first phase, the transaction continues to execute normally. • In contrast to 2PL, Strict-2PL does not release a lock after using it. • Strict-2PL holds all the locks until the commit point and releases all the locks at a time.
  • 9. Timestamp based Protocols • Lock-based protocols manage the order between the conflicting pairs among transactions at the time of execution, whereas timestamp-based protocols start working as soon as a transaction is created. • Every transaction has a timestamp associated with it, and the ordering is determined by the age of the transaction. • A transaction created at 0002 clock time would be older than all other transactions that come after it. For example, any transaction 'y' entering the system at 0004 is two seconds younger and the priority would be given to the older one. • In addition, every data item is given the latest read and write-timestamp. This lets the system know when the last ‘read and write’ operation was performed on the data item.
  • 10. Timestamp Ordering Protocol The timestamp-ordering protocol ensures serializability among transactions in their conflicting read and write operations. This is the responsibility of the protocol system that the conflicting pair of tasks should be executed according to the timestamp values of the transactions. • The timestamp of transaction Ti is denoted as TS(Ti). • Read time-stamp of data-item X is denoted by R-timestamp(X). • Write time-stamp of data-item X is denoted by W-timestamp(X)
  • 11. If a transaction Ti issues a read(X) operation − ◦ If TS(Ti) < W-timestamp(X) ◦ Operation rejected. (TS(Ti) is a younger transaction) ◦ If TS(Ti) >= W-timestamp(X) ◦ Operation executed. (TS(Ti) is an older transaction) ◦ All data-item timestamps updated. If a transaction Ti issues a write(X) operation − • If TS(Ti) < R-timestamp(X) • Operation rejected. • If TS(Ti) < W-timestamp(X) • Operation rejected and Ti rolled back. (Thomas Write Rule) • Otherwise, operation executed. Timestamp ordering protocol works as follows −
  • 12. Multiple Granularity Multiple Granularity is the hierarchically breaking up the database into portions which are lockable and maintaining the track of what to be lock and how much to be lock so that it can be decided very quickly either to lock a data item or to unlock a data item.
  • 13. Recovery with Concurrent Transaction Checkpoint Keeping and maintaining logs in real time and in real environment may fill out all the memory space available in the system. As time passes, the log file may grow too big to be handled at all. Checkpoint is a mechanism where all the previous logs are removed from the system and stored permanently in a storage disk. Checkpoint declares a point before which the DBMS was in consistent state, and all the transactions were committed. Recovery When a system with concurrent transactions crashes and recovers, it behaves in the following manner −
  • 14. • The recovery system reads the logs backwards from the end to the last checkpoint. • It maintains two lists, an undo-list and a redo-list. • If the recovery system sees a log with <Tn, Start> and <Tn, Commit> or just <Tn, Commit>, it puts the transaction in the redo-list. • If the recovery system sees a log with <Tn, Start> but no commit or abort log found, it puts the transaction in undo-list.
  • 15. Transaction Processing in Distributed Systems A transaction is a logical unit of work constituted by one or more SQL statements executed by a single user. A transaction begins with the user's first executable SQL statement and ends when it is committed or rolled back by that user. A remote transaction contains only statements that access a single remote node. A distributed transaction contains statements that access more than one node. SELECT * FROM [email protected]_auto.com; Remote Select SQL Statement UPDATE [email protected]_auto.com SET loc = 'NEW YORK' WHERE deptno = 10; Remote Update SQL Statement
  • 16. Distributed SQL Statement SELECT ename, dname FROM scott.emp e, [email protected]_auto.com d WHERE e.deptno = d.deptno; BEGIN UPDATE [email protected]_auto.com SET loc = 'NEW YORK' WHERE deptno = 10; UPDATE scott.emp SET deptno = 11 WHERE deptno = 10; END; COMMIT; A distributed update statement modifies data on two or more nodes. A distributed update is possible using a PL/SQL subprogram unit such as a procedure or trigger that includes two or more remote updates that access data on different nodes. For example, the following PL/SQL program unit updates tables on the local database and the remote sales database:
  • 17. Data Replication and Allocation Replication is useful in in improving the availability of data. This can improve availability remarkably because the system can continue to operate as long as at least one site is up. It also improves performance of retrieval for global queries, because the result of such a query can be obtained locally from any one site. The disadvantage of full Replication is that it can slow down update operations drastically, since a single logical update must be performed on every copy of the database to keep the copies consistent.