6 Copyright © 2006, Oracle. All rights reserved. Using Automatic Workload Repository.

Slides:



Advertisements
Similar presentations
DB-Time-based Oracle Performance Tuning: Theory and Practice
Advertisements

Be an Effective DBA using Oracle 10g Automatic Database Diagnostic Monitor Edward Hayrabedian Semantec Bulgaria OOD.
Presentation Date Top Down Performance Management with OEM Grid Control Or how I learned to stop worrying and love OEM Grid Control 10/1/2010 John Darrah.
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.
1 Wait Event Enhancements in Oracle 10g Terry Sutton and Roger Schrag Database Specialists, Inc.
4 Copyright © 2005, Oracle. All rights reserved. Managing the Oracle Instance.
Royal London Group A group of specialist businesses where the bottom line is always financial sense Oracle Statistics – with a little bit extra on top.
13 Copyright © 2005, Oracle. All rights reserved. Performance Management.
15 Copyright © 2004, Oracle. All rights reserved. Monitoring and Managing Memory.
Automatic Performance Diagnosis and Tuning in Oracle 10g Graham Wood Oracle Corporation.
Oracle 10.2 for z/OS and z/Linux Performance Update.
12 Copyright © 2005, Oracle. All rights reserved. Proactive Maintenance.
The Self-managing Database: Automatic Performance Diagnosis Graham Wood Kyle Hailey Oracle Corporation Session id:
Database Systems: Design, Implementation, and Management Eighth Edition Chapter 11 Database Performance Tuning and Query Optimization.
10 Copyright © 2009, Oracle. All rights reserved. Managing Undo Data.
9 Copyright © Oracle Corporation, All rights reserved. Oracle Recovery Manager Overview and Configuration.
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.
ASH – Active Session History Kyle Hailey Embarcadero Technologies
It’s time to do ASH! Tuesday, Februrary 8 th 2005 Gaja Krishna Vaidyanatha Principal, DBPerfMan LLC
Module 15: Monitoring. Overview Formulate requirements and identify resources to monitor in a database environment Types of monitoring that can be carried.
Module 18 Monitoring SQL Server 2008 R2. Module Overview Monitoring Activity Capturing and Managing Performance Data Analyzing Collected Performance Data.
12 Copyright © 2004, Oracle. All rights reserved. Automatic Management.
Database Advisors Automatic Database Diagnostic Monitor ( ADDM )
Introduction and simple using of Oracle Logistics Information System Yaxian Yao
12 Copyright © 2007, Oracle. All rights reserved. Database Maintenance.
15 Copyright © 2004, Oracle. All rights reserved. Proactive Maintenance.
2 Copyright © 2006, Oracle. All rights reserved. Performance Tuning: Overview.
#.1 Oracle Wait Interface in Oracle 10g. #.2 Today’s Session  Twelve wait event interface enhancements in Oracle 10g that we really like.  Documentation.
Part II : Waits Events Kyle Hailey
Oracle Administration and Monitoring Tools for Windows Administering and Monitoring Oracle with Windows Tools.
Oracle9i Performance Tuning Chapter 1 Performance Tuning Overview.
1.
Oracle Tuning Considerations. Agenda Why Tune ? Why Tune ? Ways to Improve Performance Ways to Improve Performance Hardware Hardware Software Software.
Copyright © Oracle Corporation, All rights reserved. 1 Oracle Architectural Components.
13 Copyright © 2006, Oracle. All rights reserved. Tuning PGA and Temporary Space.
1 Session S317114: What Else Can I Do with System and Session Performance Data Thomas Kyte
Oracle9i Performance Tuning Chapter 12 Tuning Tools.
ASH – Active Session History Feel the Power Kyle Hailey
11 Copyright © 2004, Oracle. All rights reserved. Dealing with Database Corruption.
Average Active Sessions (AAS) The Golden Metric ? Kyle Hailey
11 Copyright © 2006, Oracle. All rights reserved. Checkpoint and Redo Tuning.
10G - New Manageability Features Presented by Lenka Vanek
#.1 ASH – Active Session History Feel the Power Kyle Hailey
#.1 SASH – Simulated ASH and other tools. #.2 OEMDB Optimizer Lab 128SASH performance$100,000$1500$500free SQL Tuning$100,000includedN/A Both$200,000$1500N/A.
3 Copyright © 2006, Oracle. All rights reserved. Statistics and Wait Events.
1 Copyright © 2005, Oracle. All rights reserved. Following a Tuning Methodology.
#.1 Average Active Sessions (AAS) The Golden Metric ? Kyle Hailey
21 Copyright © 2008, Oracle. All rights reserved. Enabling Usage Tracking.
An overview of AWR, ASH and ADDM. Learning About AWR Real-World Performance Day with Tom Kyte The Independent Oracle Users Groups presents “A Day of Real-World.
3 Copyright © 2004, Oracle. All rights reserved. Database Architecture Comparison.
13 Copyright © 2007, Oracle. All rights reserved. Using the Data Recovery Advisor.
3 Copyright © 2006, Oracle. All rights reserved. Designing and Developing for Performance.
6 Copyright © 2005, Oracle. All rights reserved. Managing Database Storage Structures.
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
Performance Tuning Methodology Approach to Attacking Oracle Performance Problems.
10 Copyright © 2007, Oracle. All rights reserved. Managing Undo Data.
Introduction.
How To Pass Oracle 1z0-060 Exam In First Attempt?
Automatic Performance Management
Introduction of Week 10 Assignment Discussion
One Picture is Worth a Thousand Words
Proactive Maintenance
RAC Performance Lab.
Index Index.
Wait Event Enhancements in Oracle 10g
Presentation transcript:

6 Copyright © 2006, Oracle. All rights reserved. Using Automatic Workload Repository

6-2 Copyright © 2006, Oracle. All rights reserved. Objectives After completing this lesson, you should be able to do the following: Create and manage Automatic Workload Repository (AWR) snapshots Generate AWR reports Create snapshot sets and compare periods Generate ADDM reports Generate ASH reports

6-3 Copyright © 2006, Oracle. All rights reserved. Automatic Workload Repository: Overview SGA V$DBA_* ADDM Self-tuning component … Internal clients External clients EMSQL*Plus … Efficient in-memory statistics collection AWR snapshots MMON

6-4 Copyright © 2006, Oracle. All rights reserved. Automatic Workload Repository Data Base statistics: –SQL and optimizer statistics –OS statistics –Wait classes –Time statistics Metrics Active Session History Advisor results Snapshot statistics Database feature usage V$SYSSTAT V$SQL V$SEGMENT_STATISTICS V$SYS_TIME_MODEL V$SYSMETRIC_HISTORY V$SYSTEM_WAIT_CLASS V$OSSTAT V$ACTIVE_SESSION_HISTORY DBA_ADVISOR_* DBA_HIST_* DBA_FEATURE_* DBA_HIGH_WATER_MARK_* DBA_TAB_STATS_HISTORY

6-5 Copyright © 2006, Oracle. All rights reserved. Workload Repository SYSAUX SGA In-memory statistics 6:00 a.m. 7:00 a.m. 8:00 a.m. Snapshot 1 Snapshot 2 Snapshot 3 Snapshot 4 9:00 a.m. 9:30 a.m. ADDM finds top problems. MMON

6-6 Copyright © 2006, Oracle. All rights reserved. AWR Snapshot Sets DBMS_WORKLOAD_REPOSITORY.CREATE_BASELINE ( - start_snap_id IN NUMBER, end_snap_id IN NUMBER, baseline_name IN VARCHAR2); Relevant period in the past

6-7 Copyright © 2006, Oracle. All rights reserved. AWR Snapshot Purging Policy SYSAUX tablespace sys schema Snapshot 7 days Snapshot MMON Every night 60 min

6-8 Copyright © 2006, Oracle. All rights reserved. AWR Snapshot Settings DBMS_WORKLOAD_REPOSITORY.MODIFY_SNAPSHOT_SETTINGS ( - retention IN NUMBER DEFAULT NULL, interval IN NUMBER DEFAULT NULL, topnsql IN NUMBER DEFAULT NULL);

6-9 Copyright © 2006, Oracle. All rights reserved. Database Control and AWR

6-10 Copyright © 2006, Oracle. All rights reserved. Generating AWR Reports in EM

6-11 Copyright © 2006, Oracle. All rights reserved. Generating AWR Reports in SQL*Plus

6-12 Copyright © 2006, Oracle. All rights reserved. Snapshot Sets and Period Comparisons

6-13 Copyright © 2006, Oracle. All rights reserved. Compare Periods: Benefits DBA ≠ ≠

6-14 Copyright © 2006, Oracle. All rights reserved. Compare Periods: General

6-15 Copyright © 2006, Oracle. All rights reserved. Compare Periods: Report

6-16 Copyright © 2006, Oracle. All rights reserved. AWR Data Advisor results AWR SQL statistics Base statistics MetricsASH

6-17 Copyright © 2006, Oracle. All rights reserved. DBMS_WORKLOAD_REPOSITORY Package Procedure to modify the snapshot settings MODIFY_SNAPSHOT_SETTINGS Procedure to drop a single AWR baseline DROP_BASELINE Procedure to create a single AWR baseline CREATE_BASELINE Procedure to drop a range of snapshots DROP_SNAPSHOT_RANGE Procedure to create a manual snapshot immediately CREATE_SNAPSHOT DescriptionProcedure Name

6-18 Copyright © 2006, Oracle. All rights reserved. ADDM Performance Monitoring Snapshots ADDM In-memory statistics AWR SGA 60 minutes ADDM results MMON

6-19 Copyright © 2006, Oracle. All rights reserved. ADDM and Database Time Wide area network Application server Local area network Oracle database User sends a request. User gets a response. User 1 User 2 User n Connect Execute Fetch Execute Database time Wall-clock time

6-20 Copyright © 2006, Oracle. All rights reserved. DBTime-graph and ADDM Methodology User connect Root node SQL optimization SQL execution Undersized buffer cache I/O capacity Database locks Insufficient I/O bandwidth CPU capacity Dimension 1 Dimension 2 Symptoms Root causes

6-21 Copyright © 2006, Oracle. All rights reserved. Notes only slide

6-22 Copyright © 2006, Oracle. All rights reserved. Top Performance Issues Detected Excessive logon/logoff Memory undersizing Hot blocks and objects w/SQL RAC service issues Locks and ITL contention Checkpointing causes PL/SQL, Java time Streams, AQ, and RMAN Top SQL I/O issues Parsing Configuration issues Application usage Not detected by Statspack ADDM identifies top issues.

6-23 Copyright © 2006, Oracle. All rights reserved. Database Control and ADDM Findings

6-24 Copyright © 2006, Oracle. All rights reserved. ADDM Analysis Results 1 2 3

6-25 Copyright © 2006, Oracle. All rights reserved. ADDM Recommendations

6-26 Copyright © 2006, Oracle. All rights reserved. Database Control and ADDM Task

6-27 Copyright © 2006, Oracle. All rights reserved. Changing ADDM Attributes 1.Ensure that STATISTICS_LEVEL is set to TYPICAL or ALL. 2.ADDM analysis of I/O performance depends on the expected speed of the I/O subsystem: a.Measure your I/O subsystem speed. b.Set the expected speed. SQL> exec DBMS_ADVISOR.SET_DEFAULT_TASK_PARAMETER(- 'ADDM', 'DBIO_EXPECTED', 8000); SELECT parameter_value, is_default FROM dba_advisor_def_parameters WHERE advisor_name = 'ADDM' AND parameter_name = 'DBIO_EXPECTED';

6-28 Copyright © 2006, Oracle. All rights reserved. Retrieving ADDM Reports by Using SQL SELECT dbms_advisor.GET_TASK_REPORT(task_name) FROM dba_advisor_tasks WHERE task_id = ( SELECT max(t.task_id) FROM dba_advisor_tasks t, dba_advisor_log l WHERE t.task_id = l.task_id AND t.advisor_name = 'ADDM' AND l.status = 'COMPLETED'); … Enter value for begin_snap: 8 Enter value for end_snap: 10 … Enter value for report_name: Generating the ADDM report for this analysis...

6-29 Copyright © 2006, Oracle. All rights reserved. Active Session History: Overview Stores the history of database time Samples session activity in the system including: –SQL identifier of a SQL statement –Object number, file number, and block number –Wait event identifier and parameters –Session identifier and session serial number –Module and action name –Client identifier of the session –Service hash identifier –Blocking session Is always on for first fault analysis No need to replay the workload

6-30 Copyright © 2006, Oracle. All rights reserved. Active Session History: Mechanics SGA Statistics V$SESSION ASH Recent history Rolling buffer Workload repository 1sec Every 60 minutes MMON MMNL When 66% full V$ACTIVE_SESSION_HISTORY WRH$_ACTIVE_SESSION_HISTORY (partitioned) No use of SQL Direct path inserts DBA_HIST_ACTIVE_SESSION_HISTORY 1 out of 10 Viewers go unlatched.

6-31 Copyright © 2006, Oracle. All rights reserved. ASH Sampling: Example Session1 Wait I/O Wait Lock Wait Block Wait I/O Wait Lock Wait I/O Wait Block … … Sess1 Wait I/O Sess1 Wait Block Session2 active Session3 active Session n active … Active Inactive sessions 1sec ASH … V$ACTIVE_SESSION_HISTORY Time

6-32 Copyright © 2006, Oracle. All rights reserved. Accessing ASH Data Dump to trace file V$ACTIVE_SESSION_HISTORY DBA_HIST_ACTIVE_SESS_HISTORY ASH report EM Diagnostic Pack performance pages ADDM

6-33 Copyright © 2006, Oracle. All rights reserved. Dump ASH to File The generated file contains ASH samples for the last number of minutes specified: SQL> oradebug setmypid SQL> oradebug dump ashdump 10 >> DBID, INSTANCE_NUMBER, SAMPLE_ID, SAMPLE_TIME, SESSION_ID, SESSION_SERIAL#, USER_ID, SQL_ID, SQL_CHILD_NUMBER, SQL_PLAN_HASH_VALUE, SERVICE_HASH, SESSION_TYPE, SQL_OPCODE, BLOCKING_SESSION, BLOCKING_SESSION_SERIAL# QC_SESSION_ID, QC_INSTANCE_ID, XID, CURRENT_OBJ#, CURRENT_FILE#, CURRENT_BLOCK#, EVENT_ID, SEQ#, P1, P2, P3, WAIT_TIME, TIME_WAITED, FORCE_MATCHING_SIGNATURE, PROGRAM, MODULE, ACTION, CLIENT_ID >> ,1, ," :11: ", 162, 1, 0, "", 0, 0, , 2, 0, , (CJQ0)","","","", ,1, ," :11: ", 142,20,24, "0hbv80w9ypy0n",0, , , 1,3, , 0,0,0,,8751, 3,2486, (TNS V1- (TNS V1-V3)","","" … >>

6-34 Copyright © 2006, Oracle. All rights reserved. Sifting the ASHes GROUP BY and COUNT –Proxy for nonidle elapsed time –Proportions of actual time spent Can analyze any time slice Example: Returns most active SQL in the past minute SELECT sql_id, count(*), round(count(*)/sum(count(*)) over (), 2) pctload FROM v$active_session_history WHERE sample_time > sysdate -1/24/60 and session_type <> 'BACKGROUND' GROUP BY sql_id ORDER BY count(*) desc;

6-35 Copyright © 2006, Oracle. All rights reserved. Generating ASH Reports

6-36 Copyright © 2006, Oracle. All rights reserved. ASH Report Script SQL> define dbid = ''; SQL> define inst_num = ''; SQL> define report_type = 'html'; SQL> define begin_time = '09:00'; SQL> define duration = 480; SQL> define report_name = '/tmp/sql_ashrpt.txt'; SQL> define slot_width = ''; SQL> define target_session_id = ''; SQL> define target_sql_id = 'abcdefghij123'; SQL> define target_wait_class = ''; SQL> define target_service_hash = ''; SQL> define target_module_name = ''; SQL> define target_action_name = ''; SQL> define target_client_id = '';

6-37 Copyright © 2006, Oracle. All rights reserved. ASH Report: General Section V$ACTIVE_SESSION_HISTORY DBA_HIST_ACTIVE_SESSION_HISTORY

6-38 Copyright © 2006, Oracle. All rights reserved. ASH Report Structure

6-39 Copyright © 2006, Oracle. All rights reserved. ASH Report: Activity Over Time

6-40 Copyright © 2006, Oracle. All rights reserved. Practice Overview: Use AWR-Based Tools This practice covers the following topics: Generate an AWR report Create a preserved set on snapshots Generate an ADDM report Generate an ASH Report

6-41 Copyright © 2006, Oracle. All rights reserved. Summary In this lesson, you should have learned how to: Create and manage AWR snapshots Generate AWR reports Create snapshot sets and compare periods Generate ADDM reports Generate ASH reports

6-42 Copyright © 2006, Oracle. All rights reserved.