Oracle9i Performance Tuning Chapter 4 Tuning the Shared Pool Memory.

Slides:



Advertisements
Similar presentations
Office of the Accountant General (A&E) Andhra Pradesh Hyderabad
Advertisements

13 Copyright © 2005, Oracle. All rights reserved. Monitoring and Improving Performance.
The Architecture of Oracle
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.
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)
Page Footer Keed Education Oracle Database Administration Basic Copyright 2009 Keed Education BV Version Concept.
15 Copyright © 2004, Oracle. All rights reserved. Monitoring and Managing Memory.
1 - Oracle Server Architecture Overview
Harvard University Oracle Database Administration Session 2 System Level.
Oracle Architectural Components
Database Systems: Design, Implementation, and Management Eighth Edition Chapter 11 Database Performance Tuning and Query Optimization.
Oracle Architecture Client Computer Application Server Oracle Database Lan Or Internet Lan Or Internet Client Server Environment Application By Java or.Net.
Module 8: Monitoring SQL Server for Performance. Overview Why to Monitor SQL Server Performance Monitoring and Tuning Tools for Monitoring SQL Server.
1 Copyright © 2005, Oracle. All rights reserved. Introduction.
Module 8: Server Management. Overview Server-level and instance-level resources such as memory and processes Database-level resources such as logical.
Database Systems: Design, Implementation, and Management Tenth Edition Chapter 11 Database Performance Tuning and Query Optimization.
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.
Chapter Oracle Server An Oracle Server consists of an Oracle database (stored data, control and log files.) The Server will support SQL to define.
Oracle on Windows Server Introduction to Oracle10g on Microsoft Windows Server.
Basic Oracle Architecture
CSE 781 – DATABASE MANAGEMENT SYSTEMS Introduction To Oracle 10g Rajika Tandon.
1 Robert Wijnbelt Health Check your Database A Performance Tuning Methodology.
Chapter 20 Other Memory Management Topics
March 19981© Dennis Adams Associates Tuning Oracle: Key Considerations Dennis Adams 25 March 1998.
Oracle9i Performance Tuning Chapter 1 Performance Tuning Overview.
Database Systems Slide 1 Database Systems Lecture 5 Overview of Oracle Database Architecture - Concept Manual : Chapters 1,8 Lecturer : Dr Bela Stantic.
The Persistence of Memory (Issues) Brian Hitchcock OCP 8, 8i, 9i DBA Sun Microsystems NoCOUG Brian Hitchcock April.
7202ICT – Database Administration
Oracle9i Performance Tuning Chapter 2 Tuning the Buffer Cache.
1 Oracle Architectural Components. 1-2 Objectives Listing the structures involved in connecting a user to an Oracle server Listing the stages in processing.
Copyright  Oracle Corporation, All rights reserved. 1 Oracle Architectural Components.
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.
Anton TopurovIT-DB 23 April 2013 Introduction to Oracle2.
Oracle9i Performance Tuning Chapter 12 Tuning Tools.
Using Procedures & Functions Oracle Database PL/SQL 10g Programming Chapter 9.
Introduction to Oracle. Oracle History 1979 Oracle Release client/server relational database 1989 Oracle Oracle 8 (object relational) 1999.
Chapter 15 Introduction to PL/SQL. Chapter Objectives  Explain the benefits of using PL/SQL blocks versus several SQL statements  Identify the sections.
Outline Introduction to Oracle Memory Structures SGA, PGA, SCA The Specifics of the System Global Area (SGA) Structures Overview of Program Global Areas.
D Copyright © Oracle Corporation, All rights reserved. Loading Data into a Database.
Process Architecture Process Architecture - A portion of a program that can run independently of and concurrently with other portions of the program. Some.
Instance and Media Recovery Structures Supinfo Oracle Lab. 7.
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.
Oracle9i Performance Tuning Chapter 11 Advanced Tuning Topics.
3 Copyright © 2004, Oracle. All rights reserved. Creating an Oracle Database.
7 Copyright © Oracle Corporation, All rights reserved. Instance and Media Recovery Structures.
Oracle9i Developer: PL/SQL Programming Chapter 11 Performance Tuning.
8 Copyright © 2006, Oracle. All rights reserved. Tuning the Shared Pool.
13 Copyright © 2007, Oracle. All rights reserved. Using the Data Recovery Advisor.
3 Copyright © 2006, Oracle. All rights reserved. Designing and Developing for Performance.
Oracle Database Architectural Components
Chapter 21 SGA Architecture and Wait Event Summarized & Presented by Yeon JongHeum IDS Lab., Seoul National University.
SQL Trace and TKPROF.
Oracle Architectural Components
Database Performance Tuning and Query Optimization
SQL Statement Processing
Oracle Memory Internals
Oracle Architectural Components
Index Index.
Chapter 11 Database Performance Tuning and Query Optimization
Presentation transcript:

Oracle9i Performance Tuning Chapter 4 Tuning the Shared Pool Memory

Chapter 4: Tuning the Shared Pool Memory2 Chapter Objectives Understand the role of the Shared Pool Memory Learn Shared Pool Advice terms Learn terms for the internal structures of the Shared Pool Memory Learn the role of the library cache and data dictionary cache Configure the Shared Pool Memory Use the Shared Pool Size Advice feature

Chapter 4: Tuning the Shared Pool Memory3 Chapter Objectives (continued) Diagnose the Shared Pool Memory configuration Look inside the Shared Pool Memory using performance dynamic views Flush the Shared Pool Memory Pin objects in Shared Pool Memory Understand and configure the Large Pool Understand and configure Java Pool

Chapter 4: Tuning the Shared Pool Memory4 Oracle Architecture

Chapter 4: Tuning the Shared Pool Memory5 Data Classification User and system data is stored and retrieved in a data file and cached in the buffer cacheUser and system data is stored and retrieved in a data file and cached in the buffer cache Transaction data consists of all the DMLs and DDLs issued against the databaseTransaction data consists of all the DMLs and DDLs issued against the database Data is cached in the log buffer and ultimately stored in the redo log filesData is cached in the log buffer and ultimately stored in the redo log files SQL statements and PL/SQL blocks data consists of the SQL and PL/SQL code issued against the databaseSQL statements and PL/SQL blocks data consists of the SQL and PL/SQL code issued against the database It is cached in shared pool memoryIt is cached in shared pool memory

Chapter 4: Tuning the Shared Pool Memory6 Data Classification (continued) Database objects definition data is retrieved from system data files and cached in the shared poolDatabase objects definition data is retrieved from system data files and cached in the shared pool Database objects definition data contains metadata about the database object structures and privilegesDatabase objects definition data contains metadata about the database object structures and privileges Java code data consists of Java-related code, which is loaded and executed by different sessionsJava code data consists of Java-related code, which is loaded and executed by different sessions It is cached in the Java poolIt is cached in the Java pool Buffered data can be from any of the above classifications, but is buffered in the large poolBuffered data can be from any of the above classifications, but is buffered in the large pool

Chapter 4: Tuning the Shared Pool Memory7 Data Classification (continued)

Chapter 4: Tuning the Shared Pool Memory8 Processing SQL Statements

Chapter 4: Tuning the Shared Pool Memory9 Processing PL/SQL Blocks

Chapter 4: Tuning the Shared Pool Memory10 SQL Statement Processing Tasks

Chapter 4: Tuning the Shared Pool Memory11 Shared Pool Memory Performance Terms Hard parse: When a statement is submitted and is not found in memory, a hard parse is performedHard parse: When a statement is submitted and is not found in memory, a hard parse is performed Hard parses use considerably more resources than soft parsesHard parses use considerably more resources than soft parses Soft parse: Occurs when a SQL statement is found in memory and can be reusedSoft parse: Occurs when a SQL statement is found in memory and can be reused Execute call: A call to execute a SQL statement.Execute call: A call to execute a SQL statement. If the statement is already parsed, a soft parse occurs, but if the statement has been aged out from memory, a hard parse occursIf the statement is already parsed, a soft parse occurs, but if the statement has been aged out from memory, a hard parse occurs Parse call: A call to parse a SQL statement because it was not found in memoryParse call: A call to parse a SQL statement because it was not found in memory Bind variable: The process of passing a variable from the calling environment such as SQL*Plus, Oracle Forms, Oracle Reports, and other Oracle development toolsBind variable: The process of passing a variable from the calling environment such as SQL*Plus, Oracle Forms, Oracle Reports, and other Oracle development tools

Chapter 4: Tuning the Shared Pool Memory12 Shared Pool Memory Performance Terms Hash function: An algorithm used to convert the submitted SQL statement to a hash value, which can be compared to hash values stored in memory to determine if the statement is already in memoryHash function: An algorithm used to convert the submitted SQL statement to a hash value, which can be compared to hash values stored in memory to determine if the statement is already in memory Reloads: The number of times a cached SQL statement was reloaded or reparsed because the statement was aged outReloads: The number of times a cached SQL statement was reloaded or reparsed because the statement was aged out Invalidations: The number of times a cached SQL statement became invalid and could not be shared because there was a modification to the database objects used by the statementInvalidations: The number of times a cached SQL statement became invalid and could not be shared because there was a modification to the database objects used by the statement Library cache hit: Synonymous with soft parseLibrary cache hit: Synonymous with soft parse Library cache miss: Synonymous with hard parseLibrary cache miss: Synonymous with hard parse

Chapter 4: Tuning the Shared Pool Memory13 Shared Pool Memory Internal Structure Library cache: A major memory space of the shared pool memory used to cache SQL statements, PL/SQL blocks, and other object code used by the applicationLibrary cache: A major memory space of the shared pool memory used to cache SQL statements, PL/SQL blocks, and other object code used by the application Data dictionary cache: A major memory space of the shared pool memory used to store database object definitions temporarilyData dictionary cache: A major memory space of the shared pool memory used to store database object definitions temporarily Character set structure: A space in memory used to store the character set used by the Oracle instanceCharacter set structure: A space in memory used to store the character set used by the Oracle instance Locks structures: Data structures used to synchronize and coordinate access to database objectsLocks structures: Data structures used to synchronize and coordinate access to database objects Latches structures: Data structures used as mechanisms to protect memory while it is in useLatches structures: Data structures used as mechanisms to protect memory while it is in use Enqueues structures: Data structures used for serial access to the database in a Real Application Cluster (RAC) or in a standalone instanceEnqueues structures: Data structures used for serial access to the database in a Real Application Cluster (RAC) or in a standalone instance

Chapter 4: Tuning the Shared Pool Memory14 Shared Pool Memory Internal Structure

Chapter 4: Tuning the Shared Pool Memory15V$LIBRARY_CACHE_MEMORY

Chapter 4: Tuning the Shared Pool Memory16 V$LIBRARY_CACHE_MEMORY (continued)

Chapter 4: Tuning the Shared Pool Memory17 Shared Pool Size Advice Provides advisory statistics for the shared pool memoryProvides advisory statistics for the shared pool memory Use the dynamic performance view V$SHARED_POOL_ADVICEUse the dynamic performance view V$SHARED_POOL_ADVICE

Chapter 4: Tuning the Shared Pool Memory18V$LIBRARYCACHE

Chapter 4: Tuning the Shared Pool Memory19 Library Cache Hit Ratio

Chapter 4: Tuning the Shared Pool Memory20 Library Cache Diagnosis

Chapter 4: Tuning the Shared Pool Memory21 Library Cache Diagnosis (continued) GETHITRATIO value:GETHITRATIO value: PINHITRATIO value:PINHITRATIO value: RELOADS Ratio:RELOADS Ratio:

Chapter 4: Tuning the Shared Pool Memory22 Library Cache Diagnosis (continued) INVALIDATIONS Ratio:INVALIDATIONS Ratio: RELOADS to PINS Ratio:RELOADS to PINS Ratio:

Chapter 4: Tuning the Shared Pool Memory23 Data Dictionary Diagnosis

Chapter 4: Tuning the Shared Pool Memory24 Data Dictionary Diagnosis (continued)

Chapter 4: Tuning the Shared Pool Memory25 Shared Pool Memory Usage

Chapter 4: Tuning the Shared Pool Memory26 Shared Pool Memory Usage (continued)

Chapter 4: Tuning the Shared Pool Memory27 Shared Pool Free Memory

Chapter 4: Tuning the Shared Pool Memory28 Shared Pool Free Memory (continued)

Chapter 4: Tuning the Shared Pool Memory29 Shared Pool Free Memory (continued)

Chapter 4: Tuning the Shared Pool Memory30 Using Oracle Enterprise Manager

Chapter 4: Tuning the Shared Pool Memory31TopSQL

Chapter 4: Tuning the Shared Pool Memory32 Looking Inside Shared Pool Memory Using V$DB_OBJECT_CACHE

Chapter 4: Tuning the Shared Pool Memory33 Looking Inside Shared Pool Memory Using V$DB_OBJECT_CACHE (continued)

Chapter 4: Tuning the Shared Pool Memory34 Looking Inside Shared Pool Memory V$OBJECT_USAGEV$OBJECT_USAGE V$SQLV$SQL V$SQLAREAV$SQLAREA V$SQLTEXTV$SQLTEXT V$SQLTEXT_WITH_NEWLINESV$SQLTEXT_WITH_NEWLINES

Chapter 4: Tuning the Shared Pool Memory35 Managing Shared Pool Memory Flushing the Shared Pool Memory Pinning Objects

Chapter 4: Tuning the Shared Pool Memory36 CURSOR_SHARING Parameter

Chapter 4: Tuning the Shared Pool Memory37 CURSOR_SPACE_FOR_TIME Parameter

Chapter 4: Tuning the Shared Pool Memory38 Large Pool Memory The large pool memory is an optional structure of the SGA It is configured by the LARGE_POOL_SIZE parameter It is used as a temporary placeholder for special programs and functionality as follows:It is used as a temporary placeholder for special programs and functionality as follows: Recovery Manager (RMAN)Recovery Manager (RMAN) Shared server, formerly known as Multithreaded server (MTS)Shared server, formerly known as Multithreaded server (MTS) PARALLEL_AUTOMATIC_TUNING optionPARALLEL_AUTOMATIC_TUNING option Parallel queryParallel query

Chapter 4: Tuning the Shared Pool Memory39 Java Pool The Java pool is an optional structure of the SGA It is configured by the JAVA_POOL_SIZE parameter It is used to cache executed Java programs, Java classes, and other Java-related objects

Chapter 4: Tuning the Shared Pool Memory40Summary The shared pool memory is an important structure of the SGA used to cache SQL statements, PL/SQL blocks, and other memory objects to reduce CPU consumption and I/O trips to data files SQL statements are processed in three steps: 1.The statements are parsed for syntax validity, user privileges are verified, and a plan for retrieving data is created 2.The plan created in the first step is executed 3.The data is retrieved and submitted to the user The parsing process comprises six main tasks that ensure the validity of the statement as well as the validity of the selected columns and determines the best method for retrieving the data

Chapter 4: Tuning the Shared Pool Memory41 Summary (continued) The library cache is a major structure of the shared pool and is used to store application code that is in use The library cache is divided into pieces of memory structures called namespaces You can look at the library cache namespaces by displaying the contents of the V$LIBRARYCACHE performance dynamic view You can use V$SESSION_OBJECT_CACHE to get a full statistics report on cached objects for the current session