SlideShare a Scribd company logo
1 of 10
Solving Oracle enq: TM Contention
Wait Events: A Case Study
Dean Richards, Sr. DBA
Confio Software

11/22/2013

1
Case study: Customer
experienceing enq: TM waits
• Sessions blocked on customer’s database
• enq: TM – contention wait events
• Executing simple INSERT statements similar
to:
INSERT INTO supplier VALUES (:1, :2, :3);

11/22/2013

2
What’s going on?
• Reviewed the SUPPLIER table
– Found a foreign key constraint referencing the
PRODUCT table that didn’t have an associated
index

• Confirmed by reviewing Top Objects in Ignite
– All the wait time was associated with the
PRODUCT table

11/22/2013

3
How did we fix it?
• Added index on the column referencing the
PRODUCT table
• Found the blocking sessions using Ignite—
what was happening?
– Periodically, the company reviewed its vendor list
and "cleaned up” SUPPLIER table
– As a result, rows from SUPPLIER table were
deleted
– Those DELETE statements then cascaded to the
PRODUCT table and took out TM locks on it
11/22/2013

4
What’s really happening under
the covers?
• Reproduced customer’s issue to see what happens under the
covers
– Created a subset of the tables from this customer and loaded them
with sample data

11/22/2013

5
What’s really happening under
the covers?
• Reproduced statements similar to original situation:

• User 1 and User 2 hung with enq: TM – contention wait
events

11/22/2013

6
What’s really happening under
the covers?
• Reviewed V$SESSION:

11/22/2013

7
Reproducing the solution
• Added an index for the foreign key constraint on the
SUPPLIER table back to the PRODUCT table
• Re-ran the test case and everything worked fine
– No exclusive locks acquired, no hanging
– Oracle takes out exclusive locks on the child table (the
PRODUCT table in our example) when a foreign key
constraint is not indexed

• Conclusion: unindexed foreign key constraints can
cause severe problems!

11/22/2013

8
Sample query to find unindexed
foreign key constraints
SELECT *
FROM ( SELECT c.table_name, cc.column_name, cc.position
column_position
FROM user_constraints c, user_cons_columns cc
WHERE c.constraint_name = cc.constraint_name
AND c.constraint_type = 'R'
MINUS
SELECT i.table_name, ic.column_name, ic.column_position
FROM user_indexes i, user_ind_columns ic
WHERE i.index_name = ic.index_name )
ORDER BY table_name, column_position;

11/22/2013

9
With Confio Ignite, You Find
Blocks Quickly
• Improve database performance by 65% with
Confio Ignite
– Installs in minutes
– Puts no load on monitored servers
– Identify bottlenecks and root causes of blocks like
these in minutes

Download Ignite trial for free
www.confio.com/freetrial
11/22/2013

10

More Related Content

Similar to Confio oracle enq tm contention wait

(Lab Project) (2)Table of ContentsIntroduction.docx
 (Lab Project) (2)Table of ContentsIntroduction.docx (Lab Project) (2)Table of ContentsIntroduction.docx
(Lab Project) (2)Table of ContentsIntroduction.docx
aryan532920
 

Similar to Confio oracle enq tm contention wait (20)

(Lab Project) (2)Table of ContentsIntroduction.docx
 (Lab Project) (2)Table of ContentsIntroduction.docx (Lab Project) (2)Table of ContentsIntroduction.docx
(Lab Project) (2)Table of ContentsIntroduction.docx
 
Presentation online application upgrade of oracle's bug db with edition-ba...
Presentation    online application upgrade of oracle's bug db with edition-ba...Presentation    online application upgrade of oracle's bug db with edition-ba...
Presentation online application upgrade of oracle's bug db with edition-ba...
 
Monitoring Based Commissioning - A Must in The World of High Energy Efficiency
Monitoring Based Commissioning - A Must in The World of High Energy EfficiencyMonitoring Based Commissioning - A Must in The World of High Energy Efficiency
Monitoring Based Commissioning - A Must in The World of High Energy Efficiency
 
Final report reflow process control
Final report reflow process controlFinal report reflow process control
Final report reflow process control
 
The 5S Approach to Performance Tuning by Chuck Ezell
The 5S Approach to Performance Tuning by Chuck EzellThe 5S Approach to Performance Tuning by Chuck Ezell
The 5S Approach to Performance Tuning by Chuck Ezell
 
Site Verification for Self-Contained Hot Socket Detection
Site Verification for Self-Contained Hot Socket DetectionSite Verification for Self-Contained Hot Socket Detection
Site Verification for Self-Contained Hot Socket Detection
 
Lec11
Lec11Lec11
Lec11
 
GECon2017_Building scalable application with cqrs and event sourcing (a. hars...
GECon2017_Building scalable application with cqrs and event sourcing (a. hars...GECon2017_Building scalable application with cqrs and event sourcing (a. hars...
GECon2017_Building scalable application with cqrs and event sourcing (a. hars...
 
Database development unit test with tSQLt
Database development unit test with tSQLtDatabase development unit test with tSQLt
Database development unit test with tSQLt
 
Customer Perceptions of New AMI Meters
Customer Perceptions of New AMI MetersCustomer Perceptions of New AMI Meters
Customer Perceptions of New AMI Meters
 
Test cases and bug report v3.2
Test cases and bug report v3.2Test cases and bug report v3.2
Test cases and bug report v3.2
 
MSSQL Queries.pdf
MSSQL Queries.pdfMSSQL Queries.pdf
MSSQL Queries.pdf
 
REQUIREMENT ENGINEERING
REQUIREMENT ENGINEERINGREQUIREMENT ENGINEERING
REQUIREMENT ENGINEERING
 
Requirementengg
RequirementenggRequirementengg
Requirementengg
 
The Core of Testing – Dynamic Testing Process – According to ISO 29119 with...
The Core of Testing  – Dynamic Testing Process –  According to ISO 29119 with...The Core of Testing  – Dynamic Testing Process –  According to ISO 29119 with...
The Core of Testing – Dynamic Testing Process – According to ISO 29119 with...
 
Exploratory Testing As Code Eurostar23
Exploratory Testing As Code Eurostar23Exploratory Testing As Code Eurostar23
Exploratory Testing As Code Eurostar23
 
Exploratory Testing As Code
Exploratory Testing As CodeExploratory Testing As Code
Exploratory Testing As Code
 
Arizona State University Test Lecture
Arizona State University Test LectureArizona State University Test Lecture
Arizona State University Test Lecture
 
Meter Operations During and After AMI Deployment
Meter Operations During and After AMI DeploymentMeter Operations During and After AMI Deployment
Meter Operations During and After AMI Deployment
 
Using Metrics for Fun, Developing with the KV Store + Javascript & News from ...
Using Metrics for Fun, Developing with the KV Store + Javascript & News from ...Using Metrics for Fun, Developing with the KV Store + Javascript & News from ...
Using Metrics for Fun, Developing with the KV Store + Javascript & News from ...
 

Recently uploaded

CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
giselly40
 

Recently uploaded (20)

CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 

Confio oracle enq tm contention wait

  • 1. Solving Oracle enq: TM Contention Wait Events: A Case Study Dean Richards, Sr. DBA Confio Software 11/22/2013 1
  • 2. Case study: Customer experienceing enq: TM waits • Sessions blocked on customer’s database • enq: TM – contention wait events • Executing simple INSERT statements similar to: INSERT INTO supplier VALUES (:1, :2, :3); 11/22/2013 2
  • 3. What’s going on? • Reviewed the SUPPLIER table – Found a foreign key constraint referencing the PRODUCT table that didn’t have an associated index • Confirmed by reviewing Top Objects in Ignite – All the wait time was associated with the PRODUCT table 11/22/2013 3
  • 4. How did we fix it? • Added index on the column referencing the PRODUCT table • Found the blocking sessions using Ignite— what was happening? – Periodically, the company reviewed its vendor list and "cleaned up” SUPPLIER table – As a result, rows from SUPPLIER table were deleted – Those DELETE statements then cascaded to the PRODUCT table and took out TM locks on it 11/22/2013 4
  • 5. What’s really happening under the covers? • Reproduced customer’s issue to see what happens under the covers – Created a subset of the tables from this customer and loaded them with sample data 11/22/2013 5
  • 6. What’s really happening under the covers? • Reproduced statements similar to original situation: • User 1 and User 2 hung with enq: TM – contention wait events 11/22/2013 6
  • 7. What’s really happening under the covers? • Reviewed V$SESSION: 11/22/2013 7
  • 8. Reproducing the solution • Added an index for the foreign key constraint on the SUPPLIER table back to the PRODUCT table • Re-ran the test case and everything worked fine – No exclusive locks acquired, no hanging – Oracle takes out exclusive locks on the child table (the PRODUCT table in our example) when a foreign key constraint is not indexed • Conclusion: unindexed foreign key constraints can cause severe problems! 11/22/2013 8
  • 9. Sample query to find unindexed foreign key constraints SELECT * FROM ( SELECT c.table_name, cc.column_name, cc.position column_position FROM user_constraints c, user_cons_columns cc WHERE c.constraint_name = cc.constraint_name AND c.constraint_type = 'R' MINUS SELECT i.table_name, ic.column_name, ic.column_position FROM user_indexes i, user_ind_columns ic WHERE i.index_name = ic.index_name ) ORDER BY table_name, column_position; 11/22/2013 9
  • 10. With Confio Ignite, You Find Blocks Quickly • Improve database performance by 65% with Confio Ignite – Installs in minutes – Puts no load on monitored servers – Identify bottlenecks and root causes of blocks like these in minutes Download Ignite trial for free www.confio.com/freetrial 11/22/2013 10