12 copyright © 2005, oracle. all rights reserved. proactive maintenance

35
12 Copyright © 2005, Oracle. All rights reserved. Proactive Maintenance

Upload: elizabeth-manning

Post on 18-Dec-2015

223 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: 12 Copyright © 2005, Oracle. All rights reserved. Proactive Maintenance

12Copyright © 2005, Oracle. All rights reserved.

Proactive Maintenance

Page 2: 12 Copyright © 2005, Oracle. All rights reserved. Proactive Maintenance

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

Page 3: 12 Copyright © 2005, Oracle. All rights reserved. Proactive Maintenance

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

Proactive Maintenance

AutomaticWorkload

Repository

Serveralerts

Automatedtasks

Advisoryframework

Data warehouseof the database

Automatic collection of important statistics

Direct memoryaccess

Automatic Proactive

Efficient

Page 4: 12 Copyright © 2005, Oracle. All rights reserved. Proactive Maintenance

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

> BaselineAlertAWRADDMAdvisorsAutoTasks

Page 5: 12 Copyright © 2005, Oracle. All rights reserved. Proactive Maintenance

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 metric values are compared

Page 6: 12 Copyright © 2005, Oracle. All rights reserved. Proactive Maintenance

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

Page 7: 12 Copyright © 2005, Oracle. All rights reserved. Proactive Maintenance

12-7 Copyright © 2005, Oracle. All rights reserved.

Overview of Thresholds and Metric Baselines: Fixed Thresholds

Fixedthresholds

OLTP DW

Metric

Time

Value

Deviations missed

Critical

Warning

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

Page 8: 12 Copyright © 2005, Oracle. All rights reserved. Proactive Maintenance

12-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

Page 9: 12 Copyright © 2005, Oracle. All rights reserved. Proactive Maintenance

12-9 Copyright © 2005, Oracle. All rights reserved.

Metric Baselines and Thresholds: Concepts

Baseline period

Staticbaseline

Movingwindow

Metric threshold

FixedAdaptive

Timegrouped

Percent ofMAX

Significancelevel

Automaticallycomputedbaselinestatistics

Page 10: 12 Copyright © 2005, Oracle. All rights reserved. Proactive Maintenance

12-11 Copyright © 2005, Oracle. All rights reserved.

Editing Thresholds

Page 11: 12 Copyright © 2005, Oracle. All rights reserved. Proactive Maintenance

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

Enabling Metric Baselining

Page 12: 12 Copyright © 2005, Oracle. All rights reserved. Proactive Maintenance

12-13 Copyright © 2005, Oracle. All rights reserved.

Creating Static Metric Baselines

Page 13: 12 Copyright © 2005, Oracle. All rights reserved. Proactive Maintenance

12-14 Copyright © 2005, Oracle. All rights reserved.

Server-Generated Alerts

Serveralerts

queue.

Metric exceeds

threshold.

AWR

Enterprise Manager

Oracle instance

Baseline> Alert

AWRADDMAdvisorsAutoTasks

Page 14: 12 Copyright © 2005, Oracle. All rights reserved. Proactive Maintenance

12-15 Copyright © 2005, Oracle. All rights reserved.

Server-Generated Alert Types

MMON

85% Warning

97% Critical Cleared

Cleared

Alert

SnapshotToo Old

ResumableSession

Suspended

Recovery Area Low On

Free Space

Metric based

Event based

Threshold(stateful)

alerts

Nonthreshold (stateless)

alerts

DBA_OUTSTANDING_ALERTS DBA_ALERT_HISTORY

Page 15: 12 Copyright © 2005, Oracle. All rights reserved. Proactive Maintenance

12-16 Copyright © 2005, Oracle. All rights reserved.

Default Server-Generated Alerts

ResumableSession

Suspended

SnapshotToo Old

Recovery AreaLow On

Free Space

85% Warning97% Critical

Tablespacespace usage

Database Control:SYSTEM metrics

Tablespace

Page 16: 12 Copyright © 2005, Oracle. All rights reserved. Proactive Maintenance

12-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.

21

3

Page 17: 12 Copyright © 2005, Oracle. All rights reserved. Proactive Maintenance

12-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

Page 18: 12 Copyright © 2005, Oracle. All rights reserved. Proactive Maintenance

12-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

BaselineAlert

> AWRADDMAdvisorsAutoTasks

Page 19: 12 Copyright © 2005, Oracle. All rights reserved. Proactive Maintenance

12-20 Copyright © 2005, Oracle. All rights reserved.

AWR Infrastructure

SGA

V$ DBA_*

ADDM Self-tuningcomponent

Self-tuningcomponent

…Internal clients

External clientsEM SQL*Plus …

Efficientin-memorystatisticscollection

AWRsnapshotsMMON

Page 20: 12 Copyright © 2005, Oracle. All rights reserved. Proactive Maintenance

12-21 Copyright © 2005, 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 periodin the past

Page 21: 12 Copyright © 2005, Oracle. All rights reserved. Proactive Maintenance

12-22 Copyright © 2005, Oracle. All rights reserved.

Enterprise Manager and AWR

Page 22: 12 Copyright © 2005, Oracle. All rights reserved. Proactive Maintenance

12-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)

Page 23: 12 Copyright © 2005, Oracle. All rights reserved. Proactive Maintenance

12-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

EMADDM results

BaselineAlertAWR

> ADDMAdvisorsAutoTasks

Page 24: 12 Copyright © 2005, Oracle. All rights reserved. Proactive Maintenance

12-25 Copyright © 2005, Oracle. All rights reserved.

ADDM Findings

1

2

3

Page 25: 12 Copyright © 2005, Oracle. All rights reserved. Proactive Maintenance

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

ADDM Recommendations

Page 26: 12 Copyright © 2005, Oracle. All rights reserved. Proactive Maintenance

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 CacheAdvisor

Library CacheAdvisor

PGA

Backup MTTR Advisor

BaselineAlertAWRADDM

> AdvisorsAutoTasks

Page 27: 12 Copyright © 2005, Oracle. All rights reserved. Proactive Maintenance

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

SQL Tuning and Access Advisors

DBA

Poorly performingSQL statement

SQL TuningAdvisor

RestructuredSQL statement

Add indexes or materialized views.

Rewrite the SQL statement.

Correct setup flaws.

How can I make it run

faster?

Page 28: 12 Copyright © 2005, Oracle. All rights reserved. Proactive Maintenance

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

Memory Advisors

• Shared pool

• Database buffer cache

• Program Global Area (PGA)

• Tip: Enable ASMM.

Page 29: 12 Copyright © 2005, Oracle. All rights reserved. Proactive Maintenance

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

Segment Advisor

• Entiretablespace

• Individualschemaobjects

Page 30: 12 Copyright © 2005, Oracle. All rights reserved. Proactive Maintenance

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

Enterprise Manager and Advisors

Page 31: 12 Copyright © 2005, Oracle. All rights reserved. Proactive Maintenance

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

The DBMS_ADVISOR Package

Procedure Description

CREATE_TASK Creates a new task in the repository

DELETE_TASK Deletes a task from the repository

EXECUTE_TASK Initiates execution of the task

INTERRUPT_TASK Suspends a task that is currently executing

GET_TASK_REPORT Creates and returns a text report for the specified task

RESUME_TASK Causes a suspended task to resume

UPDATE_TASK_ATTRIBUTES

Updates task attributes

SET_TASK_PARAMETER Modifies a task parameter

MARK_RECOMMENDATION Marks one or more recommendations as accepted, rejected, or ignored

GET_TASK_SCRIPT Creates a script of all the recommendations that are accepted

Page 32: 12 Copyright © 2005, Oracle. All rights reserved. Proactive Maintenance

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

BaselineAlertAWRADDMAdvisors

> AutoTasks

Page 33: 12 Copyright © 2005, Oracle. All rights reserved. Proactive Maintenance

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

Proactive Maintenance

A review of major elements working together:

AutomaticWorkload

Repository

Serveralerts

Automatedtasks

Advisoryframework

Automatic Proactive

Efficient

Page 34: 12 Copyright © 2005, Oracle. All rights reserved. Proactive Maintenance

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

Page 35: 12 Copyright © 2005, Oracle. All rights reserved. Proactive Maintenance

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