SlideShare a Scribd company logo
k.Sivapriya
II-M.Sc(IT)
Nadar Saraswathi College Of Arts and Science
Theni
 A deadlock is a condition where two or more
transactions are waiting indefinitely for one
another to give up locks. Deadlock is said to
be one of the most feared complications in
DBMS as no task ever gets finished and is in
waiting state forever.
 For example: In the student table, transaction T1 holds a lock
on some rows and needs to update some rows in the grade
table. Simultaneously, transaction T2 holds locks on some
rows in the grade table and needs to update the rows in the
Student table held by Transaction T1.
 Now, the main problem arises. Now Transaction T1 is waiting
for T2 to release its lock and similarly, transaction T2 is
waiting for T1 to release its lock. All activities come to a halt
state and remain at a standstill. It will remain in a standstill
until the DBMS detects the deadlock and aborts one of the
transactions.

When a database is stuck in a deadlock state, then it is
better to avoid the database rather than aborting or
restating the database. This is a waste of time and
resource.
Deadlock avoidance mechanism is used to detect any
deadlock situation in advance. A method like "wait for
graph" is used for detecting the deadlock situation but
this method is suitable only for the smaller database.
For the larger database, deadlock prevention method
can be used.
 In a database, when a transaction waits indefinitely to
obtain a lock, then the DBMS should detect whether the
transaction is involved in a deadlock or not. The lock
manager maintains a Wait for the graph to detect the
deadlock cycle in the database.
 This is the suitable method for deadlock detection. In
this method, a graph is created based on the
transaction and their lock. If the created graph has a
cycle or closed loop, then there is a deadlock.
 The wait for the graph is maintained by the system for
every transaction which is waiting for some data held
by the others. The system keeps checking the graph if
there is any cycle in the graph.
Deadlock prevention method is suitable for a
large database. If the resources are allocated
in such a way that deadlock never occurs,
then the deadlock can be prevented.
The Database management system analyzes the
operations of the transaction whether they
can create a deadlock situation or not. If they
do, then the DBMS never allowed that
transaction to be executed.
 In this scheme, if a transaction requests for a
resource which is already held with a
conflicting lock by another transaction then
the DBMS simply checks the timestamp of
both transactions. It allows the older
transaction to wait until the resource is
available for execution.
 In wound wait scheme, if the older transaction
requests for a resource which is held by the
younger transaction, then older transaction forces
younger one to kill the transaction and release the
resource. After the minute delay, the younger
transaction is restarted but with the same
timestamp.
 If the older transaction has held a resource which
is requested by the Younger transaction, then the
younger transaction is asked to wait until older
releases it.
 Shadow Paging is recovery technique that is used to
recover database. In this recovery technique, database
is considered as made up of fixed size of logical units
of storage which are referred as pages.
 pages are mapped into physical blocks of storage, with
help of the page table which allow one entry for each
logical page of database.
 This method uses two page tables named current page
table and shadow page table.
 The entries which are present in current page table
are used to point to most recent database pages on
disk. Another table i.e., Shadow page table is used
when the transaction starts which is copying current
page table.
 After this, shadow page table gets saved on disk and
current page table is going to be used for transaction.
Entries present in current page table may be changed
during execution but in shadow page table it never
get changed. After transaction, both tables become
identical.

More Related Content

Similar to Deadlock and shadow paging

Rdbms
RdbmsRdbms
Rdbms
RdbmsRdbms
Unit 5 rdbms study_material
Unit 5  rdbms study_materialUnit 5  rdbms study_material
Unit 5 rdbms study_material
gayaramesh
 
Rdbms
RdbmsRdbms
Concurrency control ms neeti
Concurrency control ms neetiConcurrency control ms neeti
Concurrency control ms neeti
neeti arora
 
Concurrency control ms neeti
Concurrency control ms neetiConcurrency control ms neeti
Concurrency control ms neeti
neeti arora
 
Deadlock in database
Deadlock in databaseDeadlock in database
Deadlock in database
Tayyab Hussain
 
Vani dbms
Vani dbmsVani dbms
Vani dbms
SangeethaSasi1
 
DBMS (Deadlock, deadlock prevention, 2phase locking)
DBMS (Deadlock, deadlock prevention, 2phase locking)DBMS (Deadlock, deadlock prevention, 2phase locking)
DBMS (Deadlock, deadlock prevention, 2phase locking)
Gaurav Solanki
 
concurrency control.ppt
concurrency control.pptconcurrency control.ppt
concurrency control.ppt
BikalAdhikari4
 
Concurrency note.pdf
Concurrency note.pdfConcurrency note.pdf
Concurrency note.pdf
BijayNag1
 
Os presentation final.pptxjjjjjdakajwsjjdhdfjff
Os presentation final.pptxjjjjjdakajwsjjdhdfjffOs presentation final.pptxjjjjjdakajwsjjdhdfjff
Os presentation final.pptxjjjjjdakajwsjjdhdfjff
ZeelGoyani
 
Transaction management
Transaction managementTransaction management
Transaction management
ArchanaMani2
 
Rt databases vs general purpose tsp
Rt databases vs general purpose  tspRt databases vs general purpose  tsp
Rt databases vs general purpose tsp
Pradeep Kumar TS
 
Real time database
Real time databaseReal time database
Real time database
arvinthsaran
 
Distributed deadlock
Distributed deadlockDistributed deadlock
Distributed deadlock
Md. Mahedi Mahfuj
 
Transaction Management, Concurrency Control and Deadlocks.pdf
Transaction Management, Concurrency Control and Deadlocks.pdfTransaction Management, Concurrency Control and Deadlocks.pdf
Transaction Management, Concurrency Control and Deadlocks.pdf
beshahashenafe20
 
Sql server concurrency
Sql server concurrencySql server concurrency
Sql server concurrency
Mahabubur Rahaman
 
Transaction Processing Concept
Transaction Processing ConceptTransaction Processing Concept
Transaction Processing Concept
Nishant Munjal
 
Shadow paging
Shadow pagingShadow paging
Shadow paging
GowriLatha1
 

Similar to Deadlock and shadow paging (20)

Rdbms
RdbmsRdbms
Rdbms
 
Rdbms
RdbmsRdbms
Rdbms
 
Unit 5 rdbms study_material
Unit 5  rdbms study_materialUnit 5  rdbms study_material
Unit 5 rdbms study_material
 
Rdbms
RdbmsRdbms
Rdbms
 
Concurrency control ms neeti
Concurrency control ms neetiConcurrency control ms neeti
Concurrency control ms neeti
 
Concurrency control ms neeti
Concurrency control ms neetiConcurrency control ms neeti
Concurrency control ms neeti
 
Deadlock in database
Deadlock in databaseDeadlock in database
Deadlock in database
 
Vani dbms
Vani dbmsVani dbms
Vani dbms
 
DBMS (Deadlock, deadlock prevention, 2phase locking)
DBMS (Deadlock, deadlock prevention, 2phase locking)DBMS (Deadlock, deadlock prevention, 2phase locking)
DBMS (Deadlock, deadlock prevention, 2phase locking)
 
concurrency control.ppt
concurrency control.pptconcurrency control.ppt
concurrency control.ppt
 
Concurrency note.pdf
Concurrency note.pdfConcurrency note.pdf
Concurrency note.pdf
 
Os presentation final.pptxjjjjjdakajwsjjdhdfjff
Os presentation final.pptxjjjjjdakajwsjjdhdfjffOs presentation final.pptxjjjjjdakajwsjjdhdfjff
Os presentation final.pptxjjjjjdakajwsjjdhdfjff
 
Transaction management
Transaction managementTransaction management
Transaction management
 
Rt databases vs general purpose tsp
Rt databases vs general purpose  tspRt databases vs general purpose  tsp
Rt databases vs general purpose tsp
 
Real time database
Real time databaseReal time database
Real time database
 
Distributed deadlock
Distributed deadlockDistributed deadlock
Distributed deadlock
 
Transaction Management, Concurrency Control and Deadlocks.pdf
Transaction Management, Concurrency Control and Deadlocks.pdfTransaction Management, Concurrency Control and Deadlocks.pdf
Transaction Management, Concurrency Control and Deadlocks.pdf
 
Sql server concurrency
Sql server concurrencySql server concurrency
Sql server concurrency
 
Transaction Processing Concept
Transaction Processing ConceptTransaction Processing Concept
Transaction Processing Concept
 
Shadow paging
Shadow pagingShadow paging
Shadow paging
 

More from Siva Priya

source code metrics and other maintenance tools and techniques
source code metrics and other maintenance tools and techniquessource code metrics and other maintenance tools and techniques
source code metrics and other maintenance tools and techniques
Siva Priya
 
Class properties
Class propertiesClass properties
Class properties
Siva Priya
 
Planning the development process
Planning the development processPlanning the development process
Planning the development process
Siva Priya
 
recovery management with concurrent controls
recovery management with concurrent controlsrecovery management with concurrent controls
recovery management with concurrent controls
Siva Priya
 
Web technology
Web technology Web technology
Web technology
Siva Priya
 
Retail of big data analytics
Retail of big data analyticsRetail of big data analytics
Retail of big data analytics
Siva Priya
 
Mobile IP
Mobile IPMobile IP
Mobile IP
Siva Priya
 
density based method and expectation maximization
density based method and expectation maximizationdensity based method and expectation maximization
density based method and expectation maximization
Siva Priya
 
Classification by backpropacation
Classification by backpropacationClassification by backpropacation
Classification by backpropacation
Siva Priya
 
Disk scheduling & Disk management
Disk scheduling & Disk managementDisk scheduling & Disk management
Disk scheduling & Disk management
Siva Priya
 
Routing algorithm
Routing algorithmRouting algorithm
Routing algorithm
Siva Priya
 
Servlets & jdbc
Servlets & jdbcServlets & jdbc
Servlets & jdbc
Siva Priya
 

More from Siva Priya (12)

source code metrics and other maintenance tools and techniques
source code metrics and other maintenance tools and techniquessource code metrics and other maintenance tools and techniques
source code metrics and other maintenance tools and techniques
 
Class properties
Class propertiesClass properties
Class properties
 
Planning the development process
Planning the development processPlanning the development process
Planning the development process
 
recovery management with concurrent controls
recovery management with concurrent controlsrecovery management with concurrent controls
recovery management with concurrent controls
 
Web technology
Web technology Web technology
Web technology
 
Retail of big data analytics
Retail of big data analyticsRetail of big data analytics
Retail of big data analytics
 
Mobile IP
Mobile IPMobile IP
Mobile IP
 
density based method and expectation maximization
density based method and expectation maximizationdensity based method and expectation maximization
density based method and expectation maximization
 
Classification by backpropacation
Classification by backpropacationClassification by backpropacation
Classification by backpropacation
 
Disk scheduling & Disk management
Disk scheduling & Disk managementDisk scheduling & Disk management
Disk scheduling & Disk management
 
Routing algorithm
Routing algorithmRouting algorithm
Routing algorithm
 
Servlets & jdbc
Servlets & jdbcServlets & jdbc
Servlets & jdbc
 

Recently uploaded

GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
Neo4j
 
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with SlackLet's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
shyamraj55
 
20240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 202420240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 2024
Matthew Sinclair
 
“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”
Claudio Di Ciccio
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
Alpen-Adria-Universität
 
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
Neo4j
 
Building Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and MilvusBuilding Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and Milvus
Zilliz
 
UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5
DianaGray10
 
Mind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AIMind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AI
Kumud Singh
 
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
Neo4j
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc
 
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
Neo4j
 
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdfUni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems S.M.S.A.
 
Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1
DianaGray10
 
RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
KAMESHS29
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
Kari Kakkonen
 
Microsoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdfMicrosoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdf
Uni Systems S.M.S.A.
 
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
Edge AI and Vision Alliance
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
Zilliz
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
Aftab Hussain
 

Recently uploaded (20)

GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
 
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with SlackLet's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
 
20240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 202420240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 2024
 
“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
 
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
 
Building Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and MilvusBuilding Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and Milvus
 
UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5
 
Mind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AIMind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AI
 
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
 
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
 
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdfUni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdf
 
Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1
 
RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
 
Microsoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdfMicrosoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdf
 
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
 

Deadlock and shadow paging

  • 2.  A deadlock is a condition where two or more transactions are waiting indefinitely for one another to give up locks. Deadlock is said to be one of the most feared complications in DBMS as no task ever gets finished and is in waiting state forever.
  • 3.  For example: In the student table, transaction T1 holds a lock on some rows and needs to update some rows in the grade table. Simultaneously, transaction T2 holds locks on some rows in the grade table and needs to update the rows in the Student table held by Transaction T1.  Now, the main problem arises. Now Transaction T1 is waiting for T2 to release its lock and similarly, transaction T2 is waiting for T1 to release its lock. All activities come to a halt state and remain at a standstill. It will remain in a standstill until the DBMS detects the deadlock and aborts one of the transactions. 
  • 4. When a database is stuck in a deadlock state, then it is better to avoid the database rather than aborting or restating the database. This is a waste of time and resource. Deadlock avoidance mechanism is used to detect any deadlock situation in advance. A method like "wait for graph" is used for detecting the deadlock situation but this method is suitable only for the smaller database. For the larger database, deadlock prevention method can be used.
  • 5.  In a database, when a transaction waits indefinitely to obtain a lock, then the DBMS should detect whether the transaction is involved in a deadlock or not. The lock manager maintains a Wait for the graph to detect the deadlock cycle in the database.
  • 6.  This is the suitable method for deadlock detection. In this method, a graph is created based on the transaction and their lock. If the created graph has a cycle or closed loop, then there is a deadlock.  The wait for the graph is maintained by the system for every transaction which is waiting for some data held by the others. The system keeps checking the graph if there is any cycle in the graph.
  • 7. Deadlock prevention method is suitable for a large database. If the resources are allocated in such a way that deadlock never occurs, then the deadlock can be prevented. The Database management system analyzes the operations of the transaction whether they can create a deadlock situation or not. If they do, then the DBMS never allowed that transaction to be executed.
  • 8.  In this scheme, if a transaction requests for a resource which is already held with a conflicting lock by another transaction then the DBMS simply checks the timestamp of both transactions. It allows the older transaction to wait until the resource is available for execution.
  • 9.  In wound wait scheme, if the older transaction requests for a resource which is held by the younger transaction, then older transaction forces younger one to kill the transaction and release the resource. After the minute delay, the younger transaction is restarted but with the same timestamp.  If the older transaction has held a resource which is requested by the Younger transaction, then the younger transaction is asked to wait until older releases it.
  • 10.  Shadow Paging is recovery technique that is used to recover database. In this recovery technique, database is considered as made up of fixed size of logical units of storage which are referred as pages.  pages are mapped into physical blocks of storage, with help of the page table which allow one entry for each logical page of database.  This method uses two page tables named current page table and shadow page table.
  • 11.  The entries which are present in current page table are used to point to most recent database pages on disk. Another table i.e., Shadow page table is used when the transaction starts which is copying current page table.  After this, shadow page table gets saved on disk and current page table is going to be used for transaction. Entries present in current page table may be changed during execution but in shadow page table it never get changed. After transaction, both tables become identical.