less12 advisors mb

Upload: yairr

Post on 30-May-2018

213 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/14/2019 Less12 Advisors Mb

    1/38

    12Copyright 2005, Oracle. All rights reserved.

    Proactive Maintenance

  • 8/14/2019 Less12 Advisors Mb

    2/38

    12-2 Copyright 2005, Oracle. All rights reserved.

    Objectives

    After completing this lesson, you should be able to do

    the following:

    Set warning and critical alert thresholds

    Use server-generated alerts Collect and use baseline metrics

    Manage the Automatic Workload Repository

    (AWR)

    Use the Automatic Database Diagnostic Monitor Describe the advisory framework

  • 8/14/2019 Less12 Advisors Mb

    3/38

    12-3 Copyright 2005, Oracle. All rights reserved.

    Proactive Maintenance

    Automatic

    Workload

    Repository

    Server

    alerts

    Automated

    tasks

    Advisory

    framework

    Data warehouse

    of the databaseAutomatic collection

    of important statistics

    Direct memory

    access

    Automatic Proactive

    Efficient

  • 8/14/2019 Less12 Advisors Mb

    4/38

    12-4 Copyright 2005, Oracle. All rights reserved.

    Introduction of Concepts and Related

    Tasks

    Thresholds and metric baselines

    Enabling metric baselining

    Server-generated alerts

    Creating and testing an alert Automatic Workload Repository (AWR)

    Managing the AWR

    Automatic Database Diagnostic Monitor (ADDM)

    Advisory framework Automated maintenance tasks

    > Baseline

    Alert

    AWRADDM

    Advisors

    AutoTasks

  • 8/14/2019 Less12 Advisors Mb

    5/38

    12-5 Copyright 2005, Oracle. All rights reserved.

    Introducing Terminology

    Baseline: Data gathered of a normal running

    database for performance comparison

    Metric: Rate of change in a cumulative statistic

    Threshold: A boundary value against which metricvalues are compared

  • 8/14/2019 Less12 Advisors Mb

    6/38

    12-6 Copyright 2005, Oracle. All rights reserved.

    Cyclic Nature of Workloads

    End of day 1

    OLTP DW

    Metric

    Time

    ValueEnd of day 2 End of day 3

  • 8/14/2019 Less12 Advisors Mb

    7/3812-7 Copyright 2005, Oracle. All rights reserved.

    Overview of Thresholds and Metric

    Baselines: Fixed Thresholds

    Fixed

    thresholds

    OLTP DW

    Metric

    Time

    Value

    Deviations missed

    Critical

    Warning

    End of day 1 End of day 2 End of day 3

  • 8/14/2019 Less12 Advisors Mb

    8/3812-8 Copyright 2005, Oracle. All rights reserved.

    Overview of Thresholds and Metric

    Baselines: Adaptive Thresholds

    Adaptive thresholdsEnd ofbaseline

    Metric

    Time

    Value

    Deviations captured

    Critical

    Warning

    Normal

    Grouping

  • 8/14/2019 Less12 Advisors Mb

    9/3812-9 Copyright 2005, Oracle. All rights reserved.

    Metric Baselines and Thresholds:

    Concepts

    Baseline period

    Static

    baseline

    Moving

    window

    Metric threshold

    FixedAdaptive

    Time

    grouped

    Percent of

    MAX

    Significance

    level

    Automaticallycomputed

    baseline

    statistics

  • 8/14/2019 Less12 Advisors Mb

    10/3812-10 Copyright 2005, Oracle. All rights reserved.

    Metric Baseline and Threshold

    Full Notes Page

  • 8/14/2019 Less12 Advisors Mb

    11/3812-11 Copyright 2005, Oracle. All rights reserved.

    Editing Thresholds

  • 8/14/2019 Less12 Advisors Mb

    12/3812-12 Copyright 2005, Oracle. All rights reserved.

    Enabling Metric Baselining

  • 8/14/2019 Less12 Advisors Mb

    13/3812-13 Copyright 2005, Oracle. All rights reserved.

    Creating Static Metric Baselines

  • 8/14/2019 Less12 Advisors Mb

    14/3812-14 Copyright 2005, Oracle. All rights reserved.

    Server-Generated Alerts

    Server

    alerts

    queue.

    Metric exceeds

    threshold.

    AWR

    Enterprise Manager

    Oracle

    instance

    Baseline

    > Alert

    AWR

    ADDM

    Advisors

    AutoTasks

  • 8/14/2019 Less12 Advisors Mb

    15/3812-15 Copyright 2005, Oracle. All rights reserved.

    Server-Generated Alert Types

    MMON

    85% Warning

    97% Critical Cleared

    Cleared

    Alert

    SnapshotToo Old

    Resumable

    SessionSuspended

    Recovery Area

    Low OnFree Space

    Metric based

    Event based

    Threshold

    (stateful)

    alerts

    Nonthreshold

    (stateless)

    alerts

    DBA_OUTSTANDING_ALERTS DBA_ALERT_HISTORY

  • 8/14/2019 Less12 Advisors Mb

    16/3812-16 Copyright 2005, Oracle. All rights reserved.

    Default Server-Generated Alerts

    Resumable

    Session

    Suspended

    Snapshot

    Too Old

    Recovery Area

    Low On

    Free Space

    85% Warning

    97% Critical

    Tablespace

    space usage

    Database Control:

    SYSTEMmetrics

    Tablespace

  • 8/14/2019 Less12 Advisors Mb

    17/3812-17 Copyright 2005, Oracle. All rights reserved.

    Creating and Testing an Alert

    1. Specify a threshold.

    2. Create a test case.

    3. Check for an alert.

    2 1

    3

  • 8/14/2019 Less12 Advisors Mb

    18/3812-18 Copyright 2005, Oracle. All rights reserved.

    Where We Are

    Thresholds and metric baselines

    Enabling metric baselining

    Server-generated alerts

    Creating and testing an alert Automatic Workload Repository (AWR)

    Managing the AWR

    Automatic Database Diagnostic Monitor (ADDM)

    Advisory framework Automated maintenance tasks

  • 8/14/2019 Less12 Advisors Mb

    19/3812-19 Copyright 2005, Oracle. All rights reserved.

    Automatic Workload Repository (AWR)

    Built-in repository of performance

    information

    Snapshots of database metrics taken every

    60 minutes and retained for 7 days

    Foundation for all self-management

    functions

    MMONIn-memorystatistics Snapshots

    AWRSGA

    60 minutes

    Baseline

    Alert

    > AWRADDM

    Advisors

    AutoTasks

  • 8/14/2019 Less12 Advisors Mb

    20/3812-20 Copyright 2005, Oracle. All rights reserved.

    AWR Infrastructure

    SGA

    V$ DBA_*

    ADDMSelf-tuning

    component

    Self-tuning

    component

    Internal clients

    External clients

    EM SQL*Plus

    Efficient

    in-memory

    statistics

    collection

    AWR

    snapshotsMMON

  • 8/14/2019 Less12 Advisors Mb

    21/3812-21 Copyright 2005, Oracle. All rights reserved.

    AWR Snapshot Sets

    DBMS_WORKLOAD_REPOSITORY.CREATE_BASELINE ( - start_snap_idIN NUMBER ,

    end_snap_id IN NUMBER ,

    baseline_name IN VARCHAR2);

    Relevant periodin the past

  • 8/14/2019 Less12 Advisors Mb

    22/3812-22 Copyright 2005, Oracle. All rights reserved.

    Enterprise Manager and AWR

  • 8/14/2019 Less12 Advisors Mb

    23/3812-23 Copyright 2005, Oracle. All rights reserved.

    Managing the AWR

    Retention period:

    The default is 7 days.

    Consider storage needs.

    Collection interval: The default is

    60 minutes.

    Consider storage needs and performance impact.

    Collection level:

    Basic (disables most of ADDM functionality)

    Typical (recommended)

    All (adds additional SQL tuning information to

    snapshots)

  • 8/14/2019 Less12 Advisors Mb

    24/3812-24 Copyright 2005, Oracle. All rights reserved.

    Automatic Database Diagnostic Monitor

    (ADDM)

    Runs after each AWR snapshot

    Monitors the instance; detects bottlenecks

    Stores results within the AWR

    Snapshots

    ADDM

    AWR

    EM

    ADDM results

    BaselineAlert

    AWR> ADDMAdvisorsAutoTasks

  • 8/14/2019 Less12 Advisors Mb

    25/3812-25 Copyright 2005, Oracle. All rights reserved.

    ADDM Findings

    1

    2

    3

  • 8/14/2019 Less12 Advisors Mb

    26/38

    12-26 Copyright 2005, Oracle. All rights reserved.

    ADDM Recommendations

  • 8/14/2019 Less12 Advisors Mb

    27/38

    12-27 Copyright 2005, Oracle. All rights reserved.

    Advisory Framework

    ADDM

    SQL Tuning

    Advisor

    SQL Access

    Advisor

    Memory

    Space

    PGA Advisor

    SGA

    Segment Advisor

    Undo Advisor

    Buffer Cache

    Advisor

    Library Cache

    Advisor

    PGA

    Backup MTTR Advisor

    Baseline

    Alert

    AWR

    ADDM

    > AdvisorsAutoTasks

  • 8/14/2019 Less12 Advisors Mb

    28/38

    12-28 Copyright 2005, Oracle. All rights reserved.

    Advisors

    Full Notes Page

  • 8/14/2019 Less12 Advisors Mb

    29/38

    12-29 Copyright 2005, Oracle. All rights reserved.

    SQL Tuning and Access Advisors

    DBA

    Poorly performing

    SQL statement

    SQL Tuning

    Advisor

    Restructured

    SQL statement

    Correct setup flaws.

    Rewrite the SQL

    statement.

    Add indexes or

    materialized views.

    How can I

    make it run

    faster?

  • 8/14/2019 Less12 Advisors Mb

    30/38

    12-30 Copyright 2005, Oracle. All rights reserved.

    Memory Advisors

    Shared pool

    Database buffer cache

    Program Global Area (PGA)

    Tip: Enable ASMM.

  • 8/14/2019 Less12 Advisors Mb

    31/38

    12-31 Copyright 2005, Oracle. All rights reserved.

    Segment Advisor

    Entire

    tablespace

    Individual

    schema

    objects

  • 8/14/2019 Less12 Advisors Mb

    32/38

    12-32 Copyright 2005, Oracle. All rights reserved.

    Enterprise Manager and Advisors

  • 8/14/2019 Less12 Advisors Mb

    33/38

    12-33 Copyright 2005, Oracle. All rights reserved.

    The DBMS_ADVISORPackage

    Creates a script of all the recommendations

    that are acceptedGET_TASK_SCRIPT

    Marks one or more recommendations as

    accepted, rejected, or ignoredMARK_RECOMMENDATION

    Modifies a task parameterSET_TASK_PARAMETER

    Updates task attributesUPDATE_TASK_ATTRIBUTE

    S

    Causes a suspended task to resumeRESUME_TASK

    Creates and returns a text report for the

    specified taskGET_TASK_REPORT

    Suspends a task that is currently executingINTERRUPT_TASK

    Initiates execution of the taskEXECUTE_TASK

    Deletes a task from the repositoryDELETE_TASK

    Creates a new task in the repositoryCREATE_TASKDescriptionProcedure

  • 8/14/2019 Less12 Advisors Mb

    34/38

    12-34 Copyright 2005, Oracle. All rights reserved.

    Automated Maintenance Tasks

    Scheduler initiates jobs.

    Jobs run in default maintenance window.

    Limit maintenance impact on normal

    operation by using Resource Manager.Maintenance examples:

    Gathering optimizer statistics

    Gathering segment information

    Backing up database

    Baseline

    Alert

    AWR

    ADDM

    Advisors

    > AutoTasks

  • 8/14/2019 Less12 Advisors Mb

    35/38

    12-35 Copyright 2005, Oracle. All rights reserved.

    Proactive Maintenance

    A review of major elements working together:

    AutomaticWorkload

    Repository

    Server

    alerts

    Automated

    tasks

    Advisory

    framework

    Automatic Proactive

    Efficient

  • 8/14/2019 Less12 Advisors Mb

    36/38

    12-36 Copyright 2005, Oracle. All rights reserved.

    Summary

    In this lesson, you should have learned how to:

    Set warning and critical alert thresholds

    Use server-generated alerts

    Collect and use baseline metrics Manage the Automatic Workload Repository

    (AWR)

    Use the Automatic Database Diagnostic Monitor

    Describe the advisory framework

  • 8/14/2019 Less12 Advisors Mb

    37/38

    12-37 Copyright 2005, Oracle. All rights reserved.

    Practice Overview:

    Proactive Maintenance

    This practice covers configuring your database for

    proactive maintenance by:

    Configuring an alert and testing it

    Enabling metric baselines Creating a static metric baseline to compute

    statistics

    Deleting the baseline

  • 8/14/2019 Less12 Advisors Mb

    38/38