SlideShare une entreprise Scribd logo
1  sur  65
 
PASS Community Summit - Seattle November 18-22, 2002 S231/S348 - Resolving Deadlocks in SQL Server 2000 Ron Talmage - Prospice, LLC
Agenda:  Troubleshooting Deadlocks in SQL Server 2000 ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Troubleshooting Deadlocks in SQL Server 2000 ,[object Object],[object Object],[object Object],[object Object],[object Object]
[object Object],[object Object],[object Object],Deadlocking Defined
Lock-Based Deadlocking Structure GRANT T3 Request(WAIT on Tran1) T5 Blocked (blocking removed) Deadlock Victim T6 Commit T7 Request (WAIT on Tran2) T4 Blocked GRANT T2 Begin Tran Begin Tran T1 Tran 2 Tran 1 Time
Deadlocking Illustrated Thread 1 Thread 2 Grant Wait Blocked request Resource Resource
SQL Server Resource Waits ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Deadlocks Involving Locks ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Deadlocking is more than Blocking ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
How SQL Server handles a Deadlock ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Error 1205 Notes ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
SQL Server Deadlocking Factors ,[object Object],[object Object],[object Object],[object Object]
1. Lock Modes Used with bulk copy into a table with either TABLOCK hint or table lock option is set BU Bulk Update Have update lock with intent to acquire exclusive lock at a finer level UIX Update Intent Exclusive Have shared lock with intent to acquire exclusive lock at a finer level SIX Shared Intent Exclusive Have shared lock with intent to acquire update lock at a finer level SIU Shared Intent Update Have or intend to request exclusive lock(s) at a finer level IX Intent Exclusive Have or intend to request update lock(s) at a finer level IU Intent Update Have or intend to request shared lock(s) at a finer level IS Intent Shared Used for writing (insert, update, delete) X Exclusive Used to evaluate prior to writing (may become exclusive) U Update Used for reading (read lock) S Shared Used for DDL operations (ALTER or DROP) on a table schema Sch-M Schema Modification Used when compiling queries Sch-S Schema-Stability Description Abbreviation Lock Mode
Lock Compatibility Matrix (default isolation level) Lock Mode Already Granted BU Sch-M Sch-S X SIX IX U S IS Lock Mode Requested No No Yes No Yes Yes Yes Yes Yes IS No No Yes No No No Yes Yes Yes S No No Yes No No No No Yes Yes U No No Yes No No Yes No No Yes IX No No Yes No No No No No Yes SIX No No Yes No No No No No No X Yes No Yes No No No No No No BU No No No No No No No No No Sch-M Yes No Yes Yes Yes Yes Yes Yes Yes Sch-S
2. Transaction Timing ,[object Object],[object Object],[object Object]
3. Order of Lock Requests ,[object Object],[object Object]
4. Isolation Level ,[object Object],[object Object],[object Object],[object Object]
Isolation Level and Lock Accumulation Held until end of transaction Held until end of transaction unless promoted to exclusive or released  Held until data read and processed Read Un-committed Held until end of transaction Held until end of transaction unless promoted to exclusive Held until end of transaction Repeatable Read Held until end of transaction Held until end of transaction Exclusive Held until end of transaction unless promoted to exclusive Held until end of transaction unless promoted to exclusive or released Update Held until end of transaction Held until data read and processed Shared Serializable Read Committed Lock Mode
Troubleshooting Deadlocks in SQL Server 2000 ,[object Object],[object Object],[object Object],[object Object],[object Object]
Types of Lock Deadlocks ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
[object Object],[object Object],[object Object],[object Object],[object Object]
Single-Resource  Deadlock Illustrated  Resource Thread 1 Thread 2 Grant Wait Blocked request
Single-Resource Deadlock   Select *  From Authors With (HOLDLOCK)  Where au_id = '172-32-1176' T3 GRANT Update Authors  Set contract = 1  Where au_id = '172-32-1176' T5 Blocked (blocking removed) Deadlock Victim T6 Commit T7 Update Authors  Set contract = 0  Where au_id = '172-32-1176' T4 Blocked Select *  From Authors With (HOLDLOCK)  Where au_id = '172-32-1176' T2 GRANT Begin Tran Begin Tran T1 Tran 2 Tran 1 Time
Single-Resource Deadlock Notes ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
2. Multi-Resource Deadlocks  Overview ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
MR  Deadlock Illustrated Res 1 Thread 1 Thread 2 Res 2 Grant Wait Blocked request
X-only MR Deadlock Variation ,[object Object],[object Object],[object Object],[object Object]
X-only MR Deadlock Update Titles  Set ytd_sales = 0  Where title_id = ‘BU1032' T3 GRANT Update Authors  Set contract = 0  Where au_id = '172-32-1176' T5 Blocked (blocking removed) Deadlock Victim T6 Commit T7 Update Titles  Set ytd_sales = 0  Where title_id = ‘BU1032' T4 Blocked Update Authors  Set contract = 0  Where au_id = '172-32-1176' T2 GRANT Begin Tran Begin Tran T1 Tran 2 Tran 1 Time
X-only MR Deadlock Notes ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Mixed X-S MR Deadlock Variation ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Mixed X-S MR Example #1 Update Titles  Set ytd_sales = 0  Where title_id = ‘BU1032' T3 GRANT Select * From Authors  Where au_id = '172-32-1176' T5 Blocked (blocking removed) Deadlock Victim T6 Commit T7 Select * From Titles  Where title_id = ‘BU1032' T4 Blocked Update Authors  Set contract = 0  Where au_id = '172-32-1176' T2 GRANT Begin Tran Begin Tran T1 Tran 2 Tran 1 Time
Mixed X-S MR Example #2 Insert Authors Values  ('111-11-1112', 'test2', '', '', '', '', '', '11111', 0) T3 GRANT Select * From Authors  T5 Blocked (blocking removed) Deadlock Victim T6 Commit T7 Select *  From Authors  T4 Blocked Insert Authors Values  ('111-11-1111', 'test1', '', '', '', '', '', '11111', 0) T2 GRANT Begin Tran Begin Tran T1 Tran 2 Tran 1 Time
Mixed X-S MR Deadlock Notes ,[object Object],[object Object],[object Object],[object Object],[object Object]
Troubleshooting Deadlocks in SQL Server 2000 ,[object Object],[object Object],[object Object],[object Object],[object Object]
Gathering Deadlock Information ,[object Object],[object Object],[object Object],[object Object]
1. Use the Deadlocks/sec Sysmon (Perfmon) counter ,[object Object],[object Object]
Adding the Deadlock Counter
2. Use the 1204 Trace Flag ,[object Object],[object Object],[object Object],[object Object],[object Object]
Retrieving 1204 Output ,[object Object],[object Object],[object Object],[object Object]
Sample Trace Flag 1204 Output ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Locked resource (leaf node of clustered key, I.e. row) Spid owning the lock Current input buffer Type of lock granted Requesting spid and lock type requested Deadlock victim spid Hash of key value
Interpreting Trace Flag 1204 Output ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Trace Flag 1204 Output Notes ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
3. Use SQL Trace with Profiler ,[object Object],[object Object],[object Object],[object Object],[object Object]
Configuring SQL Trace/Profiler ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
SQL Trace and SP2 ,[object Object],[object Object]
Viewing Deadlocks in Profiler Deadlock spids now cross-referenced in SP2
SQL Trace Output Notes ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Troubleshooting Deadlocks in SQL Server 2000 ,[object Object],[object Object],[object Object],[object Object],[object Object]
Isolating the Cause ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Steps for Reproducing a Complex Deadlock ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Extracting a Transaction History
Reproducing the Deadlock
Observing Locks ,[object Object],[object Object],[object Object],[object Object],[object Object]
Identifying the query
Identifying the locks KEY: 7:1977058079:1 (f600d547433a) (from trace flag 1204 output)
Troubleshooting Deadlocks in SQL Server 2000 ,[object Object],[object Object],[object Object],[object Object],[object Object]
Resolution Techniques  ,[object Object],[object Object],[object Object],[object Object]
1. Remove incompatible lock requests ,[object Object],[object Object],[object Object],[object Object],[object Object]
2. Change the timing of transactions ,[object Object],[object Object],[object Object],[object Object]
3. Change the order of resource requests ,[object Object],[object Object]
4. Change the Isolation Level ,[object Object],[object Object],[object Object],[object Object],[object Object]
Additional Resources ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Thank you! Thank you for attending this session and PASS Community Summit - Seattle! Please help us improve the quality of our conference by completing your session evaluation form.  Completed evaluation forms may be given to the room monitor as you exit or to staff at the registration desk.
Produced by In association with

Contenu connexe

Similaire à Troubleshooting Deadlocks in SQL Server 2000

The nightmare of locking, blocking and isolation levels
The nightmare of locking, blocking and isolation levelsThe nightmare of locking, blocking and isolation levels
The nightmare of locking, blocking and isolation levelsBoris Hristov
 
The nightmare of locking, blocking and isolation levels
The nightmare of locking, blocking and isolation levelsThe nightmare of locking, blocking and isolation levels
The nightmare of locking, blocking and isolation levelsBoris Hristov
 
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
 
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
 
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
 
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
 
lock, block & two smoking barrels
lock, block & two smoking barrelslock, block & two smoking barrels
lock, block & two smoking barrelsMark Broadbent
 
Intro to tsql unit 12
Intro to tsql   unit 12Intro to tsql   unit 12
Intro to tsql unit 12Syed Asrarali
 
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
 
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 managementDAGEOP LTD
 
Look inside the locking mechanism
Look inside the locking mechanismLook inside the locking mechanism
Look inside the locking mechanismLiron Amitzi
 
Variations Of Two Phase Locking
Variations Of Two Phase LockingVariations Of Two Phase Locking
Variations Of Two Phase LockingMohammed Twaha
 
The Nightmare of Locking, Blocking and Isolation Levels
The Nightmare of Locking, Blocking and Isolation LevelsThe Nightmare of Locking, Blocking and Isolation Levels
The Nightmare of Locking, Blocking and Isolation LevelsBoris Hristov
 
Concurrency Control in Database Management System
Concurrency Control in Database Management SystemConcurrency Control in Database Management System
Concurrency Control in Database Management SystemJanki Shah
 
Locking and concurrency
Locking and concurrencyLocking and concurrency
Locking and concurrencyRumeysaDinsoy
 
SQL Server Blocking Analysis
SQL Server Blocking AnalysisSQL Server Blocking Analysis
SQL Server Blocking AnalysisHậu Võ Tấn
 
Database security
Database securityDatabase security
Database securityJaved Khan
 

Similaire à Troubleshooting Deadlocks in SQL Server 2000 (20)

The nightmare of locking, blocking and isolation levels
The nightmare of locking, blocking and isolation levelsThe 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 levelsThe 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!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!The Nightmare of Locking, Blocking and Isolation Levels!
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!
Welcome to 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!
The Nightmare of Locking, Blocking and Isolation Levels!
 
lock, block & two smoking barrels
lock, block & two smoking barrelslock, block & two smoking barrels
lock, block & two smoking barrels
 
Intro to tsql unit 12
Intro to tsql   unit 12Intro to tsql   unit 12
Intro to tsql unit 12
 
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!
 
Locking And Concurrency
Locking And ConcurrencyLocking And Concurrency
Locking And Concurrency
 
concurrency control
concurrency controlconcurrency control
concurrency control
 
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
 
Look inside the locking mechanism
Look inside the locking mechanismLook inside the locking mechanism
Look inside the locking mechanism
 
Variations Of Two Phase Locking
Variations Of Two Phase LockingVariations Of Two Phase Locking
Variations Of Two Phase Locking
 
The Nightmare of Locking, Blocking and Isolation Levels
The Nightmare of Locking, Blocking and Isolation LevelsThe Nightmare of Locking, Blocking and Isolation Levels
The Nightmare of Locking, Blocking and Isolation Levels
 
Concurrency Control in Database Management System
Concurrency Control in Database Management SystemConcurrency Control in Database Management System
Concurrency Control in Database Management System
 
Locking and concurrency
Locking and concurrencyLocking and concurrency
Locking and concurrency
 
SQL Server Blocking Analysis
SQL Server Blocking AnalysisSQL Server Blocking Analysis
SQL Server Blocking Analysis
 
Database security
Database securityDatabase security
Database security
 
Introducing Vault
Introducing VaultIntroducing Vault
Introducing Vault
 

Plus de elliando dias

Clojurescript slides
Clojurescript slidesClojurescript slides
Clojurescript slideselliando dias
 
Why you should be excited about ClojureScript
Why you should be excited about ClojureScriptWhy you should be excited about ClojureScript
Why you should be excited about ClojureScriptelliando dias
 
Functional Programming with Immutable Data Structures
Functional Programming with Immutable Data StructuresFunctional Programming with Immutable Data Structures
Functional Programming with Immutable Data Structureselliando dias
 
Nomenclatura e peças de container
Nomenclatura  e peças de containerNomenclatura  e peças de container
Nomenclatura e peças de containerelliando dias
 
Polyglot and Poly-paradigm Programming for Better Agility
Polyglot and Poly-paradigm Programming for Better AgilityPolyglot and Poly-paradigm Programming for Better Agility
Polyglot and Poly-paradigm Programming for Better Agilityelliando dias
 
Javascript Libraries
Javascript LibrariesJavascript Libraries
Javascript Librarieselliando dias
 
How to Make an Eight Bit Computer and Save the World!
How to Make an Eight Bit Computer and Save the World!How to Make an Eight Bit Computer and Save the World!
How to Make an Eight Bit Computer and Save the World!elliando dias
 
A Practical Guide to Connecting Hardware to the Web
A Practical Guide to Connecting Hardware to the WebA Practical Guide to Connecting Hardware to the Web
A Practical Guide to Connecting Hardware to the Webelliando dias
 
Introdução ao Arduino
Introdução ao ArduinoIntrodução ao Arduino
Introdução ao Arduinoelliando dias
 
Incanter Data Sorcery
Incanter Data SorceryIncanter Data Sorcery
Incanter Data Sorceryelliando dias
 
Fab.in.a.box - Fab Academy: Machine Design
Fab.in.a.box - Fab Academy: Machine DesignFab.in.a.box - Fab Academy: Machine Design
Fab.in.a.box - Fab Academy: Machine Designelliando dias
 
The Digital Revolution: Machines that makes
The Digital Revolution: Machines that makesThe Digital Revolution: Machines that makes
The Digital Revolution: Machines that makeselliando dias
 
Hadoop - Simple. Scalable.
Hadoop - Simple. Scalable.Hadoop - Simple. Scalable.
Hadoop - Simple. Scalable.elliando dias
 
Hadoop and Hive Development at Facebook
Hadoop and Hive Development at FacebookHadoop and Hive Development at Facebook
Hadoop and Hive Development at Facebookelliando dias
 
Multi-core Parallelization in Clojure - a Case Study
Multi-core Parallelization in Clojure - a Case StudyMulti-core Parallelization in Clojure - a Case Study
Multi-core Parallelization in Clojure - a Case Studyelliando dias
 

Plus de elliando dias (20)

Clojurescript slides
Clojurescript slidesClojurescript slides
Clojurescript slides
 
Why you should be excited about ClojureScript
Why you should be excited about ClojureScriptWhy you should be excited about ClojureScript
Why you should be excited about ClojureScript
 
Functional Programming with Immutable Data Structures
Functional Programming with Immutable Data StructuresFunctional Programming with Immutable Data Structures
Functional Programming with Immutable Data Structures
 
Nomenclatura e peças de container
Nomenclatura  e peças de containerNomenclatura  e peças de container
Nomenclatura e peças de container
 
Geometria Projetiva
Geometria ProjetivaGeometria Projetiva
Geometria Projetiva
 
Polyglot and Poly-paradigm Programming for Better Agility
Polyglot and Poly-paradigm Programming for Better AgilityPolyglot and Poly-paradigm Programming for Better Agility
Polyglot and Poly-paradigm Programming for Better Agility
 
Javascript Libraries
Javascript LibrariesJavascript Libraries
Javascript Libraries
 
How to Make an Eight Bit Computer and Save the World!
How to Make an Eight Bit Computer and Save the World!How to Make an Eight Bit Computer and Save the World!
How to Make an Eight Bit Computer and Save the World!
 
Ragel talk
Ragel talkRagel talk
Ragel talk
 
A Practical Guide to Connecting Hardware to the Web
A Practical Guide to Connecting Hardware to the WebA Practical Guide to Connecting Hardware to the Web
A Practical Guide to Connecting Hardware to the Web
 
Introdução ao Arduino
Introdução ao ArduinoIntrodução ao Arduino
Introdução ao Arduino
 
Minicurso arduino
Minicurso arduinoMinicurso arduino
Minicurso arduino
 
Incanter Data Sorcery
Incanter Data SorceryIncanter Data Sorcery
Incanter Data Sorcery
 
Rango
RangoRango
Rango
 
Fab.in.a.box - Fab Academy: Machine Design
Fab.in.a.box - Fab Academy: Machine DesignFab.in.a.box - Fab Academy: Machine Design
Fab.in.a.box - Fab Academy: Machine Design
 
The Digital Revolution: Machines that makes
The Digital Revolution: Machines that makesThe Digital Revolution: Machines that makes
The Digital Revolution: Machines that makes
 
Hadoop + Clojure
Hadoop + ClojureHadoop + Clojure
Hadoop + Clojure
 
Hadoop - Simple. Scalable.
Hadoop - Simple. Scalable.Hadoop - Simple. Scalable.
Hadoop - Simple. Scalable.
 
Hadoop and Hive Development at Facebook
Hadoop and Hive Development at FacebookHadoop and Hive Development at Facebook
Hadoop and Hive Development at Facebook
 
Multi-core Parallelization in Clojure - a Case Study
Multi-core Parallelization in Clojure - a Case StudyMulti-core Parallelization in Clojure - a Case Study
Multi-core Parallelization in Clojure - a Case Study
 

Dernier

Free and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
Free and Effective: Making Flows Publicly Accessible, Yumi IbrahimzadeFree and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
Free and Effective: Making Flows Publicly Accessible, Yumi IbrahimzadeCzechDreamin
 
Structuring Teams and Portfolios for Success
Structuring Teams and Portfolios for SuccessStructuring Teams and Portfolios for Success
Structuring Teams and Portfolios for SuccessUXDXConf
 
Syngulon - Selection technology May 2024.pdf
Syngulon - Selection technology May 2024.pdfSyngulon - Selection technology May 2024.pdf
Syngulon - Selection technology May 2024.pdfSyngulon
 
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...FIDO Alliance
 
Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)
Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)
Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)Julian Hyde
 
AI revolution and Salesforce, Jiří Karpíšek
AI revolution and Salesforce, Jiří KarpíšekAI revolution and Salesforce, Jiří Karpíšek
AI revolution and Salesforce, Jiří KarpíšekCzechDreamin
 
IESVE for Early Stage Design and Planning
IESVE for Early Stage Design and PlanningIESVE for Early Stage Design and Planning
IESVE for Early Stage Design and PlanningIES VE
 
What's New in Teams Calling, Meetings and Devices April 2024
What's New in Teams Calling, Meetings and Devices April 2024What's New in Teams Calling, Meetings and Devices April 2024
What's New in Teams Calling, Meetings and Devices April 2024Stephanie Beckett
 
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdf
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdfLinux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdf
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdfFIDO Alliance
 
The Metaverse: Are We There Yet?
The  Metaverse:    Are   We  There  Yet?The  Metaverse:    Are   We  There  Yet?
The Metaverse: Are We There Yet?Mark Billinghurst
 
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdf
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdfIntroduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdf
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdfFIDO Alliance
 
Top 10 Symfony Development Companies 2024
Top 10 Symfony Development Companies 2024Top 10 Symfony Development Companies 2024
Top 10 Symfony Development Companies 2024TopCSSGallery
 
AI presentation and introduction - Retrieval Augmented Generation RAG 101
AI presentation and introduction - Retrieval Augmented Generation RAG 101AI presentation and introduction - Retrieval Augmented Generation RAG 101
AI presentation and introduction - Retrieval Augmented Generation RAG 101vincent683379
 
WSO2CONMay2024OpenSourceConferenceDebrief.pptx
WSO2CONMay2024OpenSourceConferenceDebrief.pptxWSO2CONMay2024OpenSourceConferenceDebrief.pptx
WSO2CONMay2024OpenSourceConferenceDebrief.pptxJennifer Lim
 
How we scaled to 80K users by doing nothing!.pdf
How we scaled to 80K users by doing nothing!.pdfHow we scaled to 80K users by doing nothing!.pdf
How we scaled to 80K users by doing nothing!.pdfSrushith Repakula
 
Demystifying gRPC in .Net by John Staveley
Demystifying gRPC in .Net by John StaveleyDemystifying gRPC in .Net by John Staveley
Demystifying gRPC in .Net by John StaveleyJohn Staveley
 
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...FIDO Alliance
 
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdf
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdfSimplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdf
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdfFIDO Alliance
 
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...CzechDreamin
 
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...FIDO Alliance
 

Dernier (20)

Free and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
Free and Effective: Making Flows Publicly Accessible, Yumi IbrahimzadeFree and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
Free and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
 
Structuring Teams and Portfolios for Success
Structuring Teams and Portfolios for SuccessStructuring Teams and Portfolios for Success
Structuring Teams and Portfolios for Success
 
Syngulon - Selection technology May 2024.pdf
Syngulon - Selection technology May 2024.pdfSyngulon - Selection technology May 2024.pdf
Syngulon - Selection technology May 2024.pdf
 
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
 
Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)
Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)
Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)
 
AI revolution and Salesforce, Jiří Karpíšek
AI revolution and Salesforce, Jiří KarpíšekAI revolution and Salesforce, Jiří Karpíšek
AI revolution and Salesforce, Jiří Karpíšek
 
IESVE for Early Stage Design and Planning
IESVE for Early Stage Design and PlanningIESVE for Early Stage Design and Planning
IESVE for Early Stage Design and Planning
 
What's New in Teams Calling, Meetings and Devices April 2024
What's New in Teams Calling, Meetings and Devices April 2024What's New in Teams Calling, Meetings and Devices April 2024
What's New in Teams Calling, Meetings and Devices April 2024
 
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdf
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdfLinux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdf
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdf
 
The Metaverse: Are We There Yet?
The  Metaverse:    Are   We  There  Yet?The  Metaverse:    Are   We  There  Yet?
The Metaverse: Are We There Yet?
 
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdf
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdfIntroduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdf
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdf
 
Top 10 Symfony Development Companies 2024
Top 10 Symfony Development Companies 2024Top 10 Symfony Development Companies 2024
Top 10 Symfony Development Companies 2024
 
AI presentation and introduction - Retrieval Augmented Generation RAG 101
AI presentation and introduction - Retrieval Augmented Generation RAG 101AI presentation and introduction - Retrieval Augmented Generation RAG 101
AI presentation and introduction - Retrieval Augmented Generation RAG 101
 
WSO2CONMay2024OpenSourceConferenceDebrief.pptx
WSO2CONMay2024OpenSourceConferenceDebrief.pptxWSO2CONMay2024OpenSourceConferenceDebrief.pptx
WSO2CONMay2024OpenSourceConferenceDebrief.pptx
 
How we scaled to 80K users by doing nothing!.pdf
How we scaled to 80K users by doing nothing!.pdfHow we scaled to 80K users by doing nothing!.pdf
How we scaled to 80K users by doing nothing!.pdf
 
Demystifying gRPC in .Net by John Staveley
Demystifying gRPC in .Net by John StaveleyDemystifying gRPC in .Net by John Staveley
Demystifying gRPC in .Net by John Staveley
 
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
 
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdf
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdfSimplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdf
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdf
 
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
 
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...
 

Troubleshooting Deadlocks in SQL Server 2000

  • 1.  
  • 2. PASS Community Summit - Seattle November 18-22, 2002 S231/S348 - Resolving Deadlocks in SQL Server 2000 Ron Talmage - Prospice, LLC
  • 3.
  • 4.
  • 5.
  • 6. Lock-Based Deadlocking Structure GRANT T3 Request(WAIT on Tran1) T5 Blocked (blocking removed) Deadlock Victim T6 Commit T7 Request (WAIT on Tran2) T4 Blocked GRANT T2 Begin Tran Begin Tran T1 Tran 2 Tran 1 Time
  • 7. Deadlocking Illustrated Thread 1 Thread 2 Grant Wait Blocked request Resource Resource
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14. 1. Lock Modes Used with bulk copy into a table with either TABLOCK hint or table lock option is set BU Bulk Update Have update lock with intent to acquire exclusive lock at a finer level UIX Update Intent Exclusive Have shared lock with intent to acquire exclusive lock at a finer level SIX Shared Intent Exclusive Have shared lock with intent to acquire update lock at a finer level SIU Shared Intent Update Have or intend to request exclusive lock(s) at a finer level IX Intent Exclusive Have or intend to request update lock(s) at a finer level IU Intent Update Have or intend to request shared lock(s) at a finer level IS Intent Shared Used for writing (insert, update, delete) X Exclusive Used to evaluate prior to writing (may become exclusive) U Update Used for reading (read lock) S Shared Used for DDL operations (ALTER or DROP) on a table schema Sch-M Schema Modification Used when compiling queries Sch-S Schema-Stability Description Abbreviation Lock Mode
  • 15. Lock Compatibility Matrix (default isolation level) Lock Mode Already Granted BU Sch-M Sch-S X SIX IX U S IS Lock Mode Requested No No Yes No Yes Yes Yes Yes Yes IS No No Yes No No No Yes Yes Yes S No No Yes No No No No Yes Yes U No No Yes No No Yes No No Yes IX No No Yes No No No No No Yes SIX No No Yes No No No No No No X Yes No Yes No No No No No No BU No No No No No No No No No Sch-M Yes No Yes Yes Yes Yes Yes Yes Yes Sch-S
  • 16.
  • 17.
  • 18.
  • 19. Isolation Level and Lock Accumulation Held until end of transaction Held until end of transaction unless promoted to exclusive or released Held until data read and processed Read Un-committed Held until end of transaction Held until end of transaction unless promoted to exclusive Held until end of transaction Repeatable Read Held until end of transaction Held until end of transaction Exclusive Held until end of transaction unless promoted to exclusive Held until end of transaction unless promoted to exclusive or released Update Held until end of transaction Held until data read and processed Shared Serializable Read Committed Lock Mode
  • 20.
  • 21.
  • 22.
  • 23. Single-Resource Deadlock Illustrated Resource Thread 1 Thread 2 Grant Wait Blocked request
  • 24. Single-Resource Deadlock Select * From Authors With (HOLDLOCK) Where au_id = '172-32-1176' T3 GRANT Update Authors Set contract = 1 Where au_id = '172-32-1176' T5 Blocked (blocking removed) Deadlock Victim T6 Commit T7 Update Authors Set contract = 0 Where au_id = '172-32-1176' T4 Blocked Select * From Authors With (HOLDLOCK) Where au_id = '172-32-1176' T2 GRANT Begin Tran Begin Tran T1 Tran 2 Tran 1 Time
  • 25.
  • 26.
  • 27. MR Deadlock Illustrated Res 1 Thread 1 Thread 2 Res 2 Grant Wait Blocked request
  • 28.
  • 29. X-only MR Deadlock Update Titles Set ytd_sales = 0 Where title_id = ‘BU1032' T3 GRANT Update Authors Set contract = 0 Where au_id = '172-32-1176' T5 Blocked (blocking removed) Deadlock Victim T6 Commit T7 Update Titles Set ytd_sales = 0 Where title_id = ‘BU1032' T4 Blocked Update Authors Set contract = 0 Where au_id = '172-32-1176' T2 GRANT Begin Tran Begin Tran T1 Tran 2 Tran 1 Time
  • 30.
  • 31.
  • 32. Mixed X-S MR Example #1 Update Titles Set ytd_sales = 0 Where title_id = ‘BU1032' T3 GRANT Select * From Authors Where au_id = '172-32-1176' T5 Blocked (blocking removed) Deadlock Victim T6 Commit T7 Select * From Titles Where title_id = ‘BU1032' T4 Blocked Update Authors Set contract = 0 Where au_id = '172-32-1176' T2 GRANT Begin Tran Begin Tran T1 Tran 2 Tran 1 Time
  • 33. Mixed X-S MR Example #2 Insert Authors Values ('111-11-1112', 'test2', '', '', '', '', '', '11111', 0) T3 GRANT Select * From Authors T5 Blocked (blocking removed) Deadlock Victim T6 Commit T7 Select * From Authors T4 Blocked Insert Authors Values ('111-11-1111', 'test1', '', '', '', '', '', '11111', 0) T2 GRANT Begin Tran Begin Tran T1 Tran 2 Tran 1 Time
  • 34.
  • 35.
  • 36.
  • 37.
  • 39.
  • 40.
  • 41.
  • 42.
  • 43.
  • 44.
  • 45.
  • 46.
  • 47. Viewing Deadlocks in Profiler Deadlock spids now cross-referenced in SP2
  • 48.
  • 49.
  • 50.
  • 51.
  • 54.
  • 56. Identifying the locks KEY: 7:1977058079:1 (f600d547433a) (from trace flag 1204 output)
  • 57.
  • 58.
  • 59.
  • 60.
  • 61.
  • 62.
  • 63.
  • 64. Thank you! Thank you for attending this session and PASS Community Summit - Seattle! Please help us improve the quality of our conference by completing your session evaluation form. Completed evaluation forms may be given to the room monitor as you exit or to staff at the registration desk.
  • 65. Produced by In association with