1 Chapter 16 Latch and Mutex Contention. 2 Architecture Overview of Latches Protect Oracle’s SGA Prevent two processes from updating same area of SGA.

Slides:



Advertisements
Similar presentations
Database Tuning. Objectives Describe the roles associated with database tuning. Describe the dependency between tuning in different development phases.
Advertisements

Office of the Accountant General (A&E) Andhra Pradesh Hyderabad
9 Copyright © 2006, Oracle. All rights reserved. Automatic Performance Management.
13 Copyright © 2005, Oracle. All rights reserved. Monitoring and Improving Performance.
Module 13: Performance Tuning. Overview Performance tuning methodologies Instance level Database level Application level Overview of tools and techniques.
Overview of performance tuning strategies Oracle Performance Tuning Allan Young June 2008.
The Architecture of Oracle
1 Wait Event Enhancements in Oracle 10g Terry Sutton and Roger Schrag Database Specialists, Inc.
Enqueue Waits : Locks. #.2 Copyright 2006 Kyle Hailey Locks REDO Lib Cache Buffer Cache IO Locks Network.
4 Copyright © 2005, Oracle. All rights reserved. Managing the Oracle Instance.
Tuning Database Locks & Latches Hamid R. Minoui Fritz Companies Inc. NoCOUG May 16, 2001.
Buffer Cache Waits. #.2 Copyright 2006 Kyle Hailey Buffer Cache Waits Waits Disk I/O Buffer Busy Library Cache Enqueue SQL*Net Free Buffer Hot Blocks.
Acknowledgments Byron Bush, Scott S. Hilpert and Lee, JeongKyu
Overview of Database Administrator (DBA) Tools
Oracle9i Database Administrator: Implementation and Administration 1 Chapter 2 Overview of Database Administrator (DBA) Tools.
Oracle Architecture. Instances and Databases (1/2)
13 Copyright © 2005, Oracle. All rights reserved. Performance Management.
1 - Oracle Server Architecture Overview
Harvard University Oracle Database Administration Session 2 System Level.
Chapter 5 Data Manipulation and Transaction Control Oracle 10g: SQL
Oracle Architecture. Database instance When a database is started the current state of the database is given by the data files, a set of background (BG)
1 Copyright © 2005, Oracle. All rights reserved. Introduction.
Waits Defined Kyle Hailey #.2 Copyright 2006 Kyle Hailey Top 36 Foreground Waits write complete waits library cache.
Shared Pool Waits. #.2 Copyright 2006 Kyle Hailey Shared Pool Waits  Library Cache Latch  Shared Pool Latch  Library Cache Pin  Library Cache Lock.
Database Systems: Design, Implementation, and Management Eighth Edition Chapter 10 Database Performance Tuning and Query Optimization.
2 Copyright © 2006, Oracle. All rights reserved. Performance Tuning: Overview.
IT The Relational DBMS Section 06. Relational Database Theory Physical Database Design.
Chapter Oracle Server An Oracle Server consists of an Oracle database (stored data, control and log files.) The Server will support SQL to define.
Basic Oracle Architecture
By Lecturer / Aisha Dawood 1.  You can control the number of dispatcher processes in the instance. Unlike the number of shared servers, the number of.
1 Robert Wijnbelt Health Check your Database A Performance Tuning Methodology.
Part II : Waits Events Kyle Hailey
Chapter 20 Other Memory Management Topics
March 19981© Dennis Adams Associates Tuning Oracle: Key Considerations Dennis Adams 25 March 1998.
Cosc 4740 Chapter 6, Part 3 Process Synchronization.
Database Systems Slide 1 Database Systems Lecture 5 Overview of Oracle Database Architecture - Concept Manual : Chapters 1,8 Lecturer : Dr Bela Stantic.
7202ICT – Database Administration
Oracle Locking Michael Messina Principal Database Analyst Indiana University.
Oracle Tuning Considerations. Agenda Why Tune ? Why Tune ? Ways to Improve Performance Ways to Improve Performance Hardware Hardware Software Software.
1 Oracle Architectural Components. 1-2 Objectives Listing the structures involved in connecting a user to an Oracle server Listing the stages in processing.
Oracle Database 11g’s Result Cache Rob van Wijk 28 October 2010.
Oracle Tuning Ashok Kapur Hawkeye Technology, Inc.
Copyright © Oracle Corporation, All rights reserved. 1 Oracle Architectural Components.
An Oracle server:  Is a database management system that provides an open, comprehensive, integrated approach to information management.  Consists.
Backup and Recovery Overview Supinfo Oracle Lab. 6.
Oracle Data Integrator Procedures, Advanced Workflows.
Oracle9i Performance Tuning Chapter 12 Tuning Tools.
15 Copyright © 2006, Oracle. All rights reserved. Performance Tuning: Summary.
Outline Introduction to Oracle Memory Structures SGA, PGA, SCA The Specifics of the System Global Area (SGA) Structures Overview of Program Global Areas.
1 Chapter 17 Shared Memory Contention. 2 Overview Specifically talking about SGA – Buffer Cache – Redo Log Buffer Contention in these areas of SGA – Can.
Process Architecture Process Architecture - A portion of a program that can run independently of and concurrently with other portions of the program. Some.
11 Copyright © 2006, Oracle. All rights reserved. Checkpoint and Redo Tuning.
Chapter 1Oracle9i DBA II: Backup/Recovery and Network Administration 1 Chapter 1 Backup and Recovery Overview MSCD642 Backup and Recovery.
3 Copyright © 2006, Oracle. All rights reserved. Statistics and Wait Events.
Preface 1Performance Tuning Methodology: A Review Course Structure 1-2 Lesson Objective 1-3 Concepts 1-4 Determining the Worst Bottleneck 1-5 Understanding.
Oracle Architecture - Structure. Oracle Architecture - Structure The Oracle Server architecture 1. Structures are well-defined objects that store the.
Oracle9i Performance Tuning Chapter 4 Tuning the Shared Pool Memory.
Lock Tuning. Overview Data definition language (DDL) statements are considered harmful DDL is the language used to access and manipulate catalog or metadata.
1 11g NEW FEATURES ByVIJAY. 2 AGENDA  RESULT CACHE  INVISIBLE INDEXES  READ ONLY TABLES  DDL WAIT OPTION  ADDING COLUMN TO A TABLE WITH DEFAULT VALUE.
8 Copyright © 2006, Oracle. All rights reserved. Tuning the Shared Pool.
6 Copyright © Oracle Corporation, All rights reserved. Backup and Recovery Overview.
3 Copyright © 2004, Oracle. All rights reserved. Database Architecture Comparison.
4 Copyright © 2004, Oracle. All rights reserved. Managing the Oracle Instance.
Oracle Database Architectural Components
Chapter 21 SGA Architecture and Wait Event Summarized & Presented by Yeon JongHeum IDS Lab., Seoul National University.
Kyle Hailey Redo Waits Kyle Hailey
Oracle Memory Internals
Troubleshooting Techniques(*)
Presentation transcript:

1 Chapter 16 Latch and Mutex Contention

2 Architecture Overview of Latches Protect Oracle’s SGA Prevent two processes from updating same area of SGA Required to add new blocks of data to buffer cache “Lock” the buffers while they are being accessed Modified data written to latch protected redo buffer Each latch usually protects a group of blocks Can protect thousands of rows or dozens of SQL statements

3 Gets, Spins, and Sleeps Terminology of how Oracle obtains a latch – “Spinlock” - # of times tried before giving up – “Spins” - # of requests before sleeping – “Latch Get” – each attempt to obtain a latch – “Latch Miss” – each failed attempt to obtain a latch – “Latch Sleep” – sleeping after spinning on a latch Sessions awake either: – Automatically after a period of time – When a latch becomes available

4 Mutexes Similar to latches Operates in more fundamental OS calls Have lower memory & CPU overhead than latch More in quantity than latches Protects smaller number of objects Also use spinlock algorithm Unlike latches, can be held in shared mode

5 Latch / Mutex Contention Done via wait interface & time model Information found in V$SYSTEM_EVENT Latch sleeps recorded, latch misses are not Have their own wait event – Latch: cache buffers chains – Library cache: mutex X Also see – V$LATCH to see latch waits – ASH or AWR reports – V$SQL (CONCURRENCY_WAIT_TIME column)

6 Library Cache Mutex Waits New SQL statements: – Are most common reason to obtain mutex – Are also highest reason for “misses” in cache Caused by excessive hard parsing SQL – Failure to use bind variables – Shows as “library cache: mutex X” event In V$SQL – View FORCE_MATCHING_SIGNATURE column – Shows identical SQL NOT using bind variables Set CURSOR_SHARING=FORCE or SIMILAR

7 Library Cache Mutex Waits New SQL statements: – Are most common reason to obtain mutex – Are also highest reason for “misses” in cache Caused by excessive hard parsing SQL – Failure to use bind variables – Shows as “library cache: mutex X” event In V$SQL – View FORCE_MATCHING_SIGNATURE column – Shows identical SQL NOT using bind variables Set CURSOR_SHARING=FORCE or SIMILAR

8 Other Considerations Watch for Library Cache Pins Shared Pool Latch contention Periodically flush the shared pool Set shared pool to minimum value (if using automatic SGA management) Pin objects in memory Set the _SPIN_COUNT parameter

9 Cache Buffers Chains Latch Needed to access block from buffer cache Contention occurs with high logical read rate Reduce contention by tuning SQL – Turn unselective SQL to selective SQL – Proper index usage See V$LATCH_CHILDREN for details See X$BH (as ‘SYS’ user)

10 Other Latches to Watch Row cache objects latch Cache Buffers LRU chain latch Simulator LRU latch Redo allocation latch Session allocation latch Process allocation latch KKS stats latch In memory undo latch Result cache: Latch