SlideShare a Scribd company logo
Name Zahid Hussain
Roll no. 16717
Subject DBMS
Topic Concurrency & Distributed DBMS
Overview
1. Transaction
2. Concurrency
3. Resource locking
4. Deadlock
5. Types of Distributed DBMS
1.1 Transaction
logical unit of work it consist of one or more operations that must be completed
together.It either be successfully complete or fail.
1.1.1 Commit
A transaction is committed if it is completely successful and makes changes in
data.
1.1.2 Rollback
if transaction failed and leave the data unchanged it is said the data has rolled
back.
1.2 Transaction properties(ACID properties)
1.2.1 Atomicity
A transaction must completely succeed or completely fail. If any statement fail
the entire transaction fails completely.
1.2.2 Consistency
After completion the transaction leaves the data in a consistent state. For example
money should never be “created “ or “deleted” without an deposit or withdrawal.
1.2.3 Isolation
All transactions that modify the data are isolated from each other. A modifying
transaction can access the data only after the completion of other transaction
1.2.4 Durability
Durability means that the modifications made by a transaction are permanent
and persistent.
1.3 Concurrency
Concurrency is a situation in which two users access the same piece of data at
the same time. It occurs very commonly but sometimes create some problems.
1.3.1 Lost update problem
Problem arises when two or more transactions update the same data. Each
transaction unaware of other transactions . The last update overwrites.
TIME TEAM A STOCK TABLE TEAM B
9:00 Qty=100
10:30 Retrieve Qty
Qty=100
Retrieve Qty
Qty=100
10:31 Update=Qty-90
10:32 Qty=10
10:33 Update=Qty+30
Qty=130
1.3.2. Uncommitted Dependency Problem
In above example team B update the quantity 100 to 150
at time T1 and team A retrieve this update value at t2.Team
B rollbacks the action while making quantity 100 again .So,
the value of Team A becomes wrong at T3.
TIME TEAM A TEAM B
T1 - Update qty
T2 Retrieve qty -
T3 - Rollback
1.3.3 Inconsistent Analysis Problems
problem occurs when one transaction reading the several values from the
DB but another transaction update these some of them during the executing
of the first transaction.
TIME TEAM A TEAM B
T1 Retrieve acc-1:Sum=40 -
T2 Retrieve acc-2:Sum=90 -
T3 Retrieve acc-3
T4 Update acc-3=0
T5 Retrieve acc-1
T6 Update acc-1=50
T7 Commit
T8 Retrieve acc-3:Sum=90
Three accounts Acc-1:40 Acc-2: 50 Acc-3: 30
1.4 Resource locking
When a user access the data the second user has to wait until the first user
has finishes his work.
For example
USER 1 USER 2
1 Lock the item
2 retrieve the item
3 reduce item by 10
4 update the item
5 unlock the item
1 Lock the item
2 retrieve the item
3 reduce item by 10
4 update the item
5 unlock the item
Sequence of processing commands
by CPU
1 Lock the item user 1
2 retrieve the item user 1
3 lock the item for user 2.
already locked so user 2 has to wait
until user 1 unlock
4 reduce item by 10 for user 1
5 update the item for user 1
6 unlock the item for user 1
7 lock the item for user 2
8 retrieve item for user 2
9 reduce item by 20 for user 2
10 update the item for user 2
11 Unlock the item for user 2
1.4.1 Lock terminology
1. Implicit lock
Type of lock placed automatically by DBMS.
2. Explicit lock
Placed by application program by issuing a command.
3. Exclusive lock
Type of lock that locks item for any type of access no other can read or update.
4. Shared lock
Locks an item from change but not from read is called share lock.
5. Lock Granularity
The level of lock applied on an item is known as lock granularity
Levels
a. Row level(smallest lock granularity)
b. Page level
c. Table level
d. Database level(largest lock granularity)
5. Deadlock
Deadlock is a situation in which two transaction wait for completion of each
other.
USER 1 USER 2
1 Lock item A
2 Retrieve item A
3 Lock the item B
1 Lock item B
2 Retrieve item B
3 Lock the item A
Sequence processing by command in CPU
1 Lock the item A for user 1.
2 Lock the item B for user 2.
3 Retrieve A for user 1.
4 Retrieve item B for user 2.
5 Put user 1 in wait for user 2.
6 Put user 2 in wait for user 1
5.1 Solution of deadlock
1 Deadlock prevention
In this type users allow to issue only one lock request at a time.If user A and B
at once in the first line deadlock will not occurs.
2 Deadlock detection & recovery
If one transaction of user 2 is aborted then the item will be released from the lock
and the user 1 will be able to complete his work.
When a transaction is aborted then all changes made by that transaction should
be undone.
6. Types of Distributed DBMS
6.1 Homogeneous DDBMS
Means that the DB technology is the same or at least compatible to each .
It simplify the data sharing among different users.
Characteristics of Homogeneous DDBMS
i. Data distributed across all the nodes.
ii. The same DBMS used.
iii. All date manage by the DDBMS there is no exclusively local data.
iv. All users access the DB through database definition.
v. The global schema is the union of local DB schemas.
6.2 Heterogeneous DDBMS
Different DBMS used at each node. Much more difficult to manage.
Characteristics of Heterogeneous DDBMS
i. Data distributed across all the nodes.
ii. Different DBMS used at each location.
iii. A global schema exist which allow local user to access the data
iv. Some users require only local access to databases which cab be accomplished
using only local data DBMS and schema.
Any Question?
Thank you

More Related Content

Similar to transaction ,concurrency , and DDBMS

Chapter 5 Database Transaction Management
Chapter 5 Database Transaction ManagementChapter 5 Database Transaction Management
Chapter 5 Database Transaction Management
Eddyzulham Mahluzydde
 
DBMS UNIT IV.pptx
DBMS UNIT IV.pptxDBMS UNIT IV.pptx
DBMS UNIT IV.pptx
Janagi Raman S
 
Welcome to the nightmare of locking, blocking and isolation levels!
Welcome to the nightmare of locking, blocking and isolation levels!Welcome to the nightmare of locking, blocking and isolation levels!
Welcome to the nightmare of locking, blocking and isolation levels!
Boris Hristov
 
Tybsc cs dbms2 notes
Tybsc cs dbms2 notesTybsc cs dbms2 notes
Tybsc cs dbms2 notes
Niraj Bharambe
 
Transaction management transparencies
Transaction management transparenciesTransaction management transparencies
Transaction management transparencies
Mohamed Zeinelabdeen Abdelgader Farh jber
 
Dartabase Transaction.pptx
Dartabase Transaction.pptxDartabase Transaction.pptx
Dartabase Transaction.pptx
Bibus Poudel
 
Advanced DBMS presentation
Advanced DBMS presentationAdvanced DBMS presentation
Advanced DBMS presentation
Hindustan Petroleum
 
Lec08
Lec08Lec08
Lec08
saryu2011
 
DBMS Transaction course
DBMS Transaction courseDBMS Transaction course
DBMS Transaction course
GermainSIGETY1
 
The Nightmare of Locking, Blocking and Isolation Levels!
The Nightmare of Locking, Blocking and Isolation Levels!The Nightmare of Locking, Blocking and Isolation Levels!
The Nightmare of Locking, Blocking and Isolation Levels!
Boris Hristov
 
Multi version Concurrency Control and its applications in Advanced database s...
Multi version Concurrency Control and its applications in Advanced database s...Multi version Concurrency Control and its applications in Advanced database s...
Multi version Concurrency Control and its applications in Advanced database s...
GauthamSK4
 
CH09.ppt
CH09.pptCH09.ppt
CH09.ppt
ssuser5c874e
 
Managing Memory & Locks - Series 2 Transactions & Lock management
Managing  Memory & Locks - Series 2 Transactions & Lock managementManaging  Memory & Locks - Series 2 Transactions & Lock management
Managing Memory & Locks - Series 2 Transactions & Lock management
DAGEOP LTD
 
Locking unit 1 topic 3
Locking unit 1 topic 3Locking unit 1 topic 3
Locking unit 1 topic 3
avniS
 
Transactions
TransactionsTransactions
Transactions
kalyan_bu
 
17855584.ppt
17855584.ppt17855584.ppt
17855584.ppt
NoorEjaz1
 
7. transaction mang
7. transaction mang7. transaction mang
7. transaction mang
khoahuy82
 
Transaction
TransactionTransaction
Chapter 13
Chapter 13Chapter 13
Chapter 13
AbDul ThaYyal
 
concurrency control.ppt
concurrency control.pptconcurrency control.ppt
concurrency control.ppt
BikalAdhikari4
 

Similar to transaction ,concurrency , and DDBMS (20)

Chapter 5 Database Transaction Management
Chapter 5 Database Transaction ManagementChapter 5 Database Transaction Management
Chapter 5 Database Transaction Management
 
DBMS UNIT IV.pptx
DBMS UNIT IV.pptxDBMS UNIT IV.pptx
DBMS UNIT IV.pptx
 
Welcome to the nightmare of locking, blocking and isolation levels!
Welcome to the nightmare of locking, blocking and isolation levels!Welcome to the nightmare of locking, blocking and isolation levels!
Welcome to the nightmare of locking, blocking and isolation levels!
 
Tybsc cs dbms2 notes
Tybsc cs dbms2 notesTybsc cs dbms2 notes
Tybsc cs dbms2 notes
 
Transaction management transparencies
Transaction management transparenciesTransaction management transparencies
Transaction management transparencies
 
Dartabase Transaction.pptx
Dartabase Transaction.pptxDartabase Transaction.pptx
Dartabase Transaction.pptx
 
Advanced DBMS presentation
Advanced DBMS presentationAdvanced DBMS presentation
Advanced DBMS presentation
 
Lec08
Lec08Lec08
Lec08
 
DBMS Transaction course
DBMS Transaction courseDBMS Transaction course
DBMS Transaction course
 
The Nightmare of Locking, Blocking and Isolation Levels!
The Nightmare of Locking, Blocking and Isolation Levels!The Nightmare of Locking, Blocking and Isolation Levels!
The Nightmare of Locking, Blocking and Isolation Levels!
 
Multi version Concurrency Control and its applications in Advanced database s...
Multi version Concurrency Control and its applications in Advanced database s...Multi version Concurrency Control and its applications in Advanced database s...
Multi version Concurrency Control and its applications in Advanced database s...
 
CH09.ppt
CH09.pptCH09.ppt
CH09.ppt
 
Managing Memory & Locks - Series 2 Transactions & Lock management
Managing  Memory & Locks - Series 2 Transactions & Lock managementManaging  Memory & Locks - Series 2 Transactions & Lock management
Managing Memory & Locks - Series 2 Transactions & Lock management
 
Locking unit 1 topic 3
Locking unit 1 topic 3Locking unit 1 topic 3
Locking unit 1 topic 3
 
Transactions
TransactionsTransactions
Transactions
 
17855584.ppt
17855584.ppt17855584.ppt
17855584.ppt
 
7. transaction mang
7. transaction mang7. transaction mang
7. transaction mang
 
Transaction
TransactionTransaction
Transaction
 
Chapter 13
Chapter 13Chapter 13
Chapter 13
 
concurrency control.ppt
concurrency control.pptconcurrency control.ppt
concurrency control.ppt
 

Recently uploaded

PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.
Dr. Shivangi Singh Parihar
 
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptxChapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
Mohd Adib Abd Muin, Senior Lecturer at Universiti Utara Malaysia
 
writing about opinions about Australia the movie
writing about opinions about Australia the moviewriting about opinions about Australia the movie
writing about opinions about Australia the movie
Nicholas Montgomery
 
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
National Information Standards Organization (NISO)
 
How to Setup Warehouse & Location in Odoo 17 Inventory
How to Setup Warehouse & Location in Odoo 17 InventoryHow to Setup Warehouse & Location in Odoo 17 Inventory
How to Setup Warehouse & Location in Odoo 17 Inventory
Celine George
 
UGC NET Exam Paper 1- Unit 1:Teaching Aptitude
UGC NET Exam Paper 1- Unit 1:Teaching AptitudeUGC NET Exam Paper 1- Unit 1:Teaching Aptitude
UGC NET Exam Paper 1- Unit 1:Teaching Aptitude
S. Raj Kumar
 
spot a liar (Haiqa 146).pptx Technical writhing and presentation skills
spot a liar (Haiqa 146).pptx Technical writhing and presentation skillsspot a liar (Haiqa 146).pptx Technical writhing and presentation skills
spot a liar (Haiqa 146).pptx Technical writhing and presentation skills
haiqairshad
 
Main Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docxMain Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docx
adhitya5119
 
The Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collectionThe Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collection
Israel Genealogy Research Association
 
How to Create a More Engaging and Human Online Learning Experience
How to Create a More Engaging and Human Online Learning Experience How to Create a More Engaging and Human Online Learning Experience
How to Create a More Engaging and Human Online Learning Experience
Wahiba Chair Training & Consulting
 
How to Fix the Import Error in the Odoo 17
How to Fix the Import Error in the Odoo 17How to Fix the Import Error in the Odoo 17
How to Fix the Import Error in the Odoo 17
Celine George
 
RHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem students
RHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem studentsRHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem students
RHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem students
Himanshu Rai
 
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
PECB
 
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdfANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
Priyankaranawat4
 
Your Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective UpskillingYour Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective Upskilling
Excellence Foundation for South Sudan
 
NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptxNEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
iammrhaywood
 
How to Make a Field Mandatory in Odoo 17
How to Make a Field Mandatory in Odoo 17How to Make a Field Mandatory in Odoo 17
How to Make a Field Mandatory in Odoo 17
Celine George
 
Reimagining Your Library Space: How to Increase the Vibes in Your Library No ...
Reimagining Your Library Space: How to Increase the Vibes in Your Library No ...Reimagining Your Library Space: How to Increase the Vibes in Your Library No ...
Reimagining Your Library Space: How to Increase the Vibes in Your Library No ...
Diana Rendina
 
A Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdfA Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdf
Jean Carlos Nunes Paixão
 
Walmart Business+ and Spark Good for Nonprofits.pdf
Walmart Business+ and Spark Good for Nonprofits.pdfWalmart Business+ and Spark Good for Nonprofits.pdf
Walmart Business+ and Spark Good for Nonprofits.pdf
TechSoup
 

Recently uploaded (20)

PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.
 
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptxChapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
 
writing about opinions about Australia the movie
writing about opinions about Australia the moviewriting about opinions about Australia the movie
writing about opinions about Australia the movie
 
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
 
How to Setup Warehouse & Location in Odoo 17 Inventory
How to Setup Warehouse & Location in Odoo 17 InventoryHow to Setup Warehouse & Location in Odoo 17 Inventory
How to Setup Warehouse & Location in Odoo 17 Inventory
 
UGC NET Exam Paper 1- Unit 1:Teaching Aptitude
UGC NET Exam Paper 1- Unit 1:Teaching AptitudeUGC NET Exam Paper 1- Unit 1:Teaching Aptitude
UGC NET Exam Paper 1- Unit 1:Teaching Aptitude
 
spot a liar (Haiqa 146).pptx Technical writhing and presentation skills
spot a liar (Haiqa 146).pptx Technical writhing and presentation skillsspot a liar (Haiqa 146).pptx Technical writhing and presentation skills
spot a liar (Haiqa 146).pptx Technical writhing and presentation skills
 
Main Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docxMain Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docx
 
The Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collectionThe Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collection
 
How to Create a More Engaging and Human Online Learning Experience
How to Create a More Engaging and Human Online Learning Experience How to Create a More Engaging and Human Online Learning Experience
How to Create a More Engaging and Human Online Learning Experience
 
How to Fix the Import Error in the Odoo 17
How to Fix the Import Error in the Odoo 17How to Fix the Import Error in the Odoo 17
How to Fix the Import Error in the Odoo 17
 
RHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem students
RHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem studentsRHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem students
RHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem students
 
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
 
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdfANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
 
Your Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective UpskillingYour Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective Upskilling
 
NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptxNEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
 
How to Make a Field Mandatory in Odoo 17
How to Make a Field Mandatory in Odoo 17How to Make a Field Mandatory in Odoo 17
How to Make a Field Mandatory in Odoo 17
 
Reimagining Your Library Space: How to Increase the Vibes in Your Library No ...
Reimagining Your Library Space: How to Increase the Vibes in Your Library No ...Reimagining Your Library Space: How to Increase the Vibes in Your Library No ...
Reimagining Your Library Space: How to Increase the Vibes in Your Library No ...
 
A Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdfA Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdf
 
Walmart Business+ and Spark Good for Nonprofits.pdf
Walmart Business+ and Spark Good for Nonprofits.pdfWalmart Business+ and Spark Good for Nonprofits.pdf
Walmart Business+ and Spark Good for Nonprofits.pdf
 

transaction ,concurrency , and DDBMS

  • 1. Name Zahid Hussain Roll no. 16717 Subject DBMS Topic Concurrency & Distributed DBMS
  • 2. Overview 1. Transaction 2. Concurrency 3. Resource locking 4. Deadlock 5. Types of Distributed DBMS
  • 3. 1.1 Transaction logical unit of work it consist of one or more operations that must be completed together.It either be successfully complete or fail. 1.1.1 Commit A transaction is committed if it is completely successful and makes changes in data. 1.1.2 Rollback if transaction failed and leave the data unchanged it is said the data has rolled back. 1.2 Transaction properties(ACID properties) 1.2.1 Atomicity A transaction must completely succeed or completely fail. If any statement fail the entire transaction fails completely. 1.2.2 Consistency After completion the transaction leaves the data in a consistent state. For example money should never be “created “ or “deleted” without an deposit or withdrawal.
  • 4. 1.2.3 Isolation All transactions that modify the data are isolated from each other. A modifying transaction can access the data only after the completion of other transaction 1.2.4 Durability Durability means that the modifications made by a transaction are permanent and persistent.
  • 5. 1.3 Concurrency Concurrency is a situation in which two users access the same piece of data at the same time. It occurs very commonly but sometimes create some problems. 1.3.1 Lost update problem Problem arises when two or more transactions update the same data. Each transaction unaware of other transactions . The last update overwrites. TIME TEAM A STOCK TABLE TEAM B 9:00 Qty=100 10:30 Retrieve Qty Qty=100 Retrieve Qty Qty=100 10:31 Update=Qty-90 10:32 Qty=10 10:33 Update=Qty+30 Qty=130
  • 6. 1.3.2. Uncommitted Dependency Problem In above example team B update the quantity 100 to 150 at time T1 and team A retrieve this update value at t2.Team B rollbacks the action while making quantity 100 again .So, the value of Team A becomes wrong at T3. TIME TEAM A TEAM B T1 - Update qty T2 Retrieve qty - T3 - Rollback
  • 7. 1.3.3 Inconsistent Analysis Problems problem occurs when one transaction reading the several values from the DB but another transaction update these some of them during the executing of the first transaction. TIME TEAM A TEAM B T1 Retrieve acc-1:Sum=40 - T2 Retrieve acc-2:Sum=90 - T3 Retrieve acc-3 T4 Update acc-3=0 T5 Retrieve acc-1 T6 Update acc-1=50 T7 Commit T8 Retrieve acc-3:Sum=90 Three accounts Acc-1:40 Acc-2: 50 Acc-3: 30
  • 8. 1.4 Resource locking When a user access the data the second user has to wait until the first user has finishes his work. For example USER 1 USER 2 1 Lock the item 2 retrieve the item 3 reduce item by 10 4 update the item 5 unlock the item 1 Lock the item 2 retrieve the item 3 reduce item by 10 4 update the item 5 unlock the item Sequence of processing commands by CPU 1 Lock the item user 1 2 retrieve the item user 1 3 lock the item for user 2. already locked so user 2 has to wait until user 1 unlock 4 reduce item by 10 for user 1 5 update the item for user 1 6 unlock the item for user 1 7 lock the item for user 2 8 retrieve item for user 2 9 reduce item by 20 for user 2 10 update the item for user 2 11 Unlock the item for user 2
  • 9. 1.4.1 Lock terminology 1. Implicit lock Type of lock placed automatically by DBMS. 2. Explicit lock Placed by application program by issuing a command. 3. Exclusive lock Type of lock that locks item for any type of access no other can read or update. 4. Shared lock Locks an item from change but not from read is called share lock. 5. Lock Granularity The level of lock applied on an item is known as lock granularity Levels a. Row level(smallest lock granularity) b. Page level c. Table level d. Database level(largest lock granularity)
  • 10. 5. Deadlock Deadlock is a situation in which two transaction wait for completion of each other. USER 1 USER 2 1 Lock item A 2 Retrieve item A 3 Lock the item B 1 Lock item B 2 Retrieve item B 3 Lock the item A Sequence processing by command in CPU 1 Lock the item A for user 1. 2 Lock the item B for user 2. 3 Retrieve A for user 1. 4 Retrieve item B for user 2. 5 Put user 1 in wait for user 2. 6 Put user 2 in wait for user 1
  • 11. 5.1 Solution of deadlock 1 Deadlock prevention In this type users allow to issue only one lock request at a time.If user A and B at once in the first line deadlock will not occurs. 2 Deadlock detection & recovery If one transaction of user 2 is aborted then the item will be released from the lock and the user 1 will be able to complete his work. When a transaction is aborted then all changes made by that transaction should be undone.
  • 12. 6. Types of Distributed DBMS 6.1 Homogeneous DDBMS Means that the DB technology is the same or at least compatible to each . It simplify the data sharing among different users. Characteristics of Homogeneous DDBMS i. Data distributed across all the nodes. ii. The same DBMS used. iii. All date manage by the DDBMS there is no exclusively local data. iv. All users access the DB through database definition. v. The global schema is the union of local DB schemas.
  • 13. 6.2 Heterogeneous DDBMS Different DBMS used at each node. Much more difficult to manage. Characteristics of Heterogeneous DDBMS i. Data distributed across all the nodes. ii. Different DBMS used at each location. iii. A global schema exist which allow local user to access the data iv. Some users require only local access to databases which cab be accomplished using only local data DBMS and schema.

Editor's Notes

  1. Name Zahid Hussain Roll no. 16717 Subject DBMS
  2. Main heading
  3. Subject
  4. Subject
  5. Subject
  6. Subject
  7. Subject
  8. Subject
  9. Subject
  10. Subject
  11. Subject
  12. Main heading
  13. Main heading
  14. Any Question
  15. Say thanks to me to make your time valuable