15 Copyright © 2004, Oracle. All rights reserved. Monitoring and Managing Memory.

Slides:



Advertisements
Similar presentations
13 Copyright © 2005, Oracle. All rights reserved. Monitoring and Improving Performance.
Advertisements

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.
INTRODUCTION TO ORACLE DATABASE ADMINISTRATION Lynnwood Brown System Managers LLC Introduction – Lecture 1 Copyright System Managers LLC 2007 all rights.
12 Copyright © 2005, Oracle. All rights reserved. Proactive Maintenance.
1 - Oracle Server Architecture Overview
Oracle Architectural Components
10 Copyright © 2006, Oracle. All rights reserved. Automatic Shared Memory Management.
10 Copyright © 2009, Oracle. All rights reserved. Managing Undo Data.
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.
13 Copyright © 2004, Oracle. All rights reserved. Oracle Shared Servers.
1 Copyright © 2009, Oracle. All rights reserved. Exploring the Oracle Database Architecture.
Oracle Database Workshop 1 Presented to IBRI CAS 27-Nov-2011 By Abdullah Alkalbani.
12 Copyright © 2007, Oracle. All rights reserved. Database Maintenance.
15 Copyright © 2004, Oracle. All rights reserved. Proactive Maintenance.
Oracle Documentation Oracle DBA Course (9i, 10g, 11g) Lecture 1: Oracle Architectural Components.
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
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.
CSE 781 – DATABASE MANAGEMENT SYSTEMS Introduction To Oracle 10g Rajika Tandon.
Chapter 20 Other Memory Management Topics
Database Systems Slide 1 Database Systems Lecture 5 Overview of Oracle Database Architecture - Concept Manual : Chapters 1,8 Lecturer : Dr Bela Stantic.
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.
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.
13 Copyright © 2006, Oracle. All rights reserved. Tuning PGA and Temporary Space.
15 Copyright © 2006, Oracle. All rights reserved. Performance Tuning: Summary.
The Self-Managing Database: Automatic SGA Memory Management Tirthankar Lahiri Senior Manager, Distributed Cache & Memory Management Oracle Corporation.
Outline Introduction to Oracle Memory Structures SGA, PGA, SCA The Specifics of the System Global Area (SGA) Structures Overview of Program Global Areas.
Process Architecture Process Architecture - A portion of a program that can run independently of and concurrently with other portions of the program. Some.
14 Copyright © 2005, Oracle. All rights reserved. Backup and Recovery Concepts.
1 Copyright © 2005, Oracle. All rights reserved. Introduction.
11 Copyright © 2006, Oracle. All rights reserved. Checkpoint and Redo Tuning.
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.
Preface 1Performance Tuning Methodology: A Review Course Structure 1-2 Lesson Objective 1-3 Concepts 1-4 Determining the Worst Bottleneck 1-5 Understanding.
E Copyright © 2006, Oracle. All rights reserved. Oracle Shared Servers.
2 Copyright © 2006, Oracle. All rights reserved. Configuring Recovery Manager.
3 Copyright © 2004, Oracle. All rights reserved. Creating an Oracle Database.
7 Copyright © Oracle Corporation, All rights reserved. Instance and Media Recovery Structures.
5 Copyright © Oracle Corporation, All rights reserved. Usage and Configuration of the Oracle Shared Server.
14 Copyright © 2005, Oracle. All rights reserved. Backup and Recovery Concepts.
Usage and Configuration of the Oracle Shared Server Supinfo Oracle Lab. 5.
8 Copyright © 2006, Oracle. All rights reserved. Tuning the Shared Pool.
3 Copyright © 2004, Oracle. All rights reserved. Database Architecture Comparison.
1 Copyright © 2006, Oracle. All rights reserved. Introduction.
9 Copyright © 2004, Oracle. All rights reserved. Incomplete Recovery.
Dr. Stephan Bühne SAP Solution Center Walldorf Oracle 9i: Features for SAP Which new Oracle 9i features are helpful for a SAP customer? Dr. Stephan Bühne.
14 Copyright © 2007, Oracle. All rights reserved. Backup and Recovery Concepts.
4 Copyright © 2004, Oracle. All rights reserved. Managing the Oracle Instance.
5 Copyright © 2005, Oracle. All rights reserved. Managing the Oracle Instance.
Oracle Database Architectural Components
10 Copyright © 2007, Oracle. All rights reserved. Managing Undo Data.
Chapter 21 SGA Architecture and Wait Event Summarized & Presented by Yeon JongHeum IDS Lab., Seoul National University.
3 Copyright © Oracle Corporation, All rights reserved. 管理数据库事例.
Initialization Parameters
Oracle Architectural Components
Monitoring and Managing Memory
Oracle Memory Internals
Managing Memory.
Oracle Architectural Components
Index Index.
Presentation transcript:

15 Copyright © 2004, Oracle. All rights reserved. Monitoring and Managing Memory

15-2 Copyright © 2004, Oracle. All rights reserved. Objectives After completing this lesson, you should be able to: Describe the memory components in the SGA Implement Automatic Shared Memory Management Manually configure SGA parameters Use automatic PGA memory management

15-3 Copyright © 2004, Oracle. All rights reserved. Oracle Memory Structures Java pool Database buffer cache Shared pool Redo log buffer Large pool SGA Streams pool Server process 1 PGA Server process 2 PGA Back- ground process PGA Keep buffer cache Recycle buffer cache nK Block Size buffer caches

15-4 Copyright © 2004, Oracle. All rights reserved. Oracle Memory Structures Full Notes Page

15-5 Copyright © 2004, Oracle. All rights reserved. Buffer Cache Data files SGA Checkpoint queue DBWn Server DB_BLOCK_SIZE DB_CACHE_SIZE DB_RECYCLE_CACHE_SIZE DB_KEEP_CACHE_SIZE LRU lists DB buffer cache

15-6 Copyright © 2004, Oracle. All rights reserved.

15-7 Copyright © 2004, Oracle. All rights reserved. Using Multiple Buffer Pools SGA DB buffer caches Keep pool Recycle pool Default pool

15-8 Copyright © 2004, Oracle. All rights reserved. Using Multiple Buffer Pools CREATE INDEX cust_idx … STORAGE (BUFFER_POOL KEEP …); ALTER TABLE oe.customers STORAGE (BUFFER_POOL RECYCLE); ALTER INDEX oe.cust_lname_ix STORAGE (BUFFER_POOL KEEP);

15-9 Copyright © 2004, Oracle. All rights reserved. Shared pool Library cache Data dictionary cache UGA Shared pool Defined by SHARED_POOL_SIZE Library cache contains statement text, parsed code, and execution plan. Data dictionary cache contains definitions for tables, columns, and privileges from the data dictionary tables. UGA contains session information for Oracle Shared Server users when a large pool is not configured. Shared Pool

15-10 Copyright © 2004, Oracle. All rights reserved. Shared pool Database buffer cache Redo log buffer Large pool Large Pool Library cache Dictionary cache User global area Can be configured as a separate memory area in the SGA Is sized by the LARGE_POOL_SIZE parameter Is used to store data in memory for: –Backup and restore operations –Session data for the shared servers –Parallel query messaging

15-11 Copyright © 2004, Oracle. All rights reserved. UGA and Oracle Shared Server Shared pool PGA Shared pool or large pool Stack space PGA Stack space Cursor state User session data UGA Dedicated server configuration Shared server configuration User session data Cursor state UGA

15-12 Copyright © 2004, Oracle. All rights reserved. Java Pool Can be configured as a separate memory area in the SGA Is sized by the JAVA_POOL_SIZE parameter Is used to store data in memory for all session- specific Java code and data within the JVM Shared pool Database buffer cache Redo log buffer Large pool Library cache Dictionary cache User global area

15-13 Copyright © 2004, Oracle. All rights reserved. The Redo Log Buffer SQL> UPDATE employees 2 SET salary=salary*1.1 3 WHERE employee_id=736; Server process LGWR Control files ARCn Archived log files Redo log files Data files Shared pool Redo log buffer Library cache Dictionary cache User global area Database buffer cache

15-14 Copyright © 2004, Oracle. All rights reserved. Automatic Shared Memory Management: Overview Automatically adapts to workload changes Maximizes memory utilization Helps eliminate out-of-memory errors Buffer cache Large pool Shared pool Java pool Buffer cache Large pool Shared pool Java pool Online usersBatch jobs

15-15 Copyright © 2004, Oracle. All rights reserved. Benefits of Automatic Shared Memory Management DB_CACHE_SIZE SHARED_POOL_SIZE LARGE_POOL_SIZE JAVA_POOL_SIZE Total SGA size SGA_TARGET

15-16 Copyright © 2004, Oracle. All rights reserved. SGA Tuning Principles Based on workload information, MMAN captures statistics periodically in the background. MMAN uses the different memory advisories. Memory is moved to where it is most needed. Using an SPFILE is recommended: –Component sizes saved across shutdowns –Saved values used to bootstrap component sizes –Avoids having to relearn optimal values

15-17 Copyright © 2004, Oracle. All rights reserved. Database Control and Automatic Shared Memory Management

15-18 Copyright © 2004, Oracle. All rights reserved. Manual Configuration SGA_TARGET = 8G Total SGA size = 8 GB Java pool Database buffer cache Redo log buffer Shared pool Large pool Fixed SGA STATISTICS_LEVEL = TYPICAL Auto-tuned Streams pool Keep buffer pool

15-19 Copyright © 2004, Oracle. All rights reserved. Behavior of Auto-Tuned SGA Parameters When SGA_TARGET is not set or is set to zero: –Auto-tuned parameters behave as previously. – SHARED_POOL_SIZE may need to be increased from settings used on earlier database versions. When SGA_TARGET is set to a non-zero value: –Default value of auto-tuned parameters is zero. –If set to a non-zero value, the specified value is used as a minimum size. SELECT SUM(bytes)/1024/1024 FROM v$sgastat WHERE pool = 'shared pool'; SELECT component,current_size/1024/1024||'M' FROM v$sga_dynamic_components;

15-20 Copyright © 2004, Oracle. All rights reserved. Behavior of Manually Tuned SGA Parameters Some components are not auto-tuned. – KEEP and RECYCLE buffer caches –Multiple block size caches –Log buffer –Streams pool These components must be manually configured using database parameters. The memory used by these components reduces the amount of memory available for auto-tuning the SGA.

15-21 Copyright © 2004, Oracle. All rights reserved. Using the V$PARAMETER View SGA_TARGET = 8G SELECT name, value, isdefault FROM v$parameter WHERE name LIKE '%size'; DB_CACHE_SIZE = 0 JAVA_POOL_SIZE = 0 LARGE_POOL_SIZE = 0 SHARED_POOL_SIZE = 0

15-22 Copyright © 2004, Oracle. All rights reserved. Resizing SGA_TARGET The SGA_TARGET initialization parameter: –Is dynamic –Can be increased up to SGA_MAX_SIZE –Can be reduced until all components reach their minimum size A change in the value of SGA_TARGET affects only automatically sized components.

15-23 Copyright © 2004, Oracle. All rights reserved. SGA size = 8 GB Disabling Automatic Shared Memory Management Setting SGA_TARGET to zero disables auto-tuning. Auto parameters are set to their current sizes. SGA size as a whole is unaffected. Parameters: sga_target = 8G shared_pool_size=1G Parameters: sga_target = 0 db_cache_size = 4G shared_pool_size = 2G large_pool_size = 512M java_pool_size = 512M SGA size = 8 GB Original values

15-24 Copyright © 2004, Oracle. All rights reserved. Manually Resizing Dynamic SGA Parameters For auto-tuned parameters, manual resizing: –Results in immediate component resize if the new value is greater than the current size –Changes the minimum size if the new value is smaller than the current size Manually tuned parameter resizing affects only the tunable portion of the SGA.

15-25 Copyright © 2004, Oracle. All rights reserved. Program Global Area (PGA) PGA Server process PGA Shared pool or large pool PGA Dedicated connections Shared server PGA Shared server connections Private SQL areas Cursor and SQL area Session memory Work area

15-26 Copyright © 2004, Oracle. All rights reserved.

15-27 Copyright © 2004, Oracle. All rights reserved. Automatic PGA Memory Management Dynamically adjusts the amount of PGA memory dedicated to work areas Memory allocated to work areas is derived from the PGA_AGGREGATE_TARGET parameter Helps to maximize the performance of all the memory-intensive SQL operations Enabled by default

15-28 Copyright © 2004, Oracle. All rights reserved. PGA Management Resources Statistics to manage the PGA_AGGREGATE_TARGET initialization parameter, such as PGA cache hit percentage Views for monitoring the PGA work area include: – v$sql_workarea_histogram – v$pgastat – v$sql_workarea_active – v$sql_workarea – v$tempseg_usage Views to assist in sizing the PGA work area are: – v$pga_target_advice – v$pga_target_advice_histogram

15-29 Copyright © 2004, Oracle. All rights reserved. Using the Memory Advisor

15-30 Copyright © 2004, Oracle. All rights reserved. Summary In this lesson, you should have learned how to: Describe the memory components in the SGA Implement Automatic Shared Memory Management Manually configure SGA parameters Use automatic PGA memory management

15-31 Copyright © 2004, Oracle. All rights reserved. Practice 15 Overview: Automatic Shared Memory Management This practice covers using Automatic Shared Memory Management to avoid long running query issues.

15-32 Copyright © 2004, Oracle. All rights reserved.