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

Proactive Maintenance

  • Upload
    len

  • View
    68

  • Download
    4

Embed Size (px)

DESCRIPTION

Proactive Maintenance. Objectives. After completing this lesson, you should be able to do the following: Use statistics Manage the Automatic Workload Repository (AWR) Use the Automatic Database Diagnostic Monitor (ADDM) Describe the advisory framework Set alert thresholds - PowerPoint PPT Presentation

Citation preview

Page 1: Proactive Maintenance

12Copyright © 2005, Oracle. All rights reserved.

Proactive Maintenance

Page 2: Proactive Maintenance

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

Objectives

After completing this lesson, you should be able to do the following:

• Use statistics

• Manage the Automatic Workload Repository (AWR)

• Use the Automatic Database Diagnostic Monitor (ADDM)

• Describe the advisory framework

• Set alert thresholds

• Use server-generated alerts

• Use automated tasks

Page 3: 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: Proactive Maintenance

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

Introducing Terminology

• Automatic Workload Repository (AWR): Infrastructure for data gathering, analysis, and solutions recommendations

• Baseline: Data gathered of a “normal running database” for performance comparison

• Metric: Rate of change in a cumulative statistic

• Statistics: Data collections used for optimizing internal operations, such as execution of a SQL statement

• Threshold: A boundary value against

which metric values are compared

Page 5: Proactive Maintenance

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

Optimizer Statistics

Optimizer statistics are:

• Not real time

• Persistent across instance restarts

• Collected automatically

SQL> SELECT COUNT(*) FROM hr.employees;

COUNT(*)

----------

214

SQL> SELECT num_rows FROM dba_tables

2 WHERE owner='HR' AND table_name = 'EMPLOYEES';

NUM_ROWS

----------

107

> StatisticsAWRADDMAdvisorsAlertsAutoTasks

Page 6: Proactive Maintenance

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

Using the Manage Optimizer Statistics Page

Page 7: Proactive Maintenance

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

Statistic Levels

STATISTICS_LEVEL

BASIC TYPICAL ALL

Recommendeddefault value

Additional statisticsfor manual

SQL diagnostics

Self-tuningcapabilities disabled

Page 8: Proactive Maintenance

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

Statistics> AWR

ADDMAdvisorsAlertsAutoTasks

Page 9: Proactive Maintenance

12-11 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 10: Proactive Maintenance

12-12 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 11: Proactive Maintenance

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

Enterprise Manager and AWR

Page 12: Proactive Maintenance

12-14 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 13: Proactive Maintenance

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

StatisticsAWR

> ADDMAdvisorsAlertsAutoTasks

Page 14: Proactive Maintenance

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

ADDM Findings

1

2

3

Page 15: Proactive Maintenance

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

ADDM Recommendations

Page 16: Proactive Maintenance

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

StatisticsAWRADDM

> AdvisorsAlertsAutoTasks

Page 17: Proactive Maintenance

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

Enterprise Manager and Advisors

Page 18: Proactive Maintenance

12-21 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 19: Proactive Maintenance

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

Server-Generated Alerts

Serveralerts

queue.

Metric exceeds

threshold.

AWR

Enterprise Manager

Oracle instance

StatisticsAWRADDMAdvisors

> AlertsAutoTasks

Page 20: Proactive Maintenance

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

Default Server-Generated Alerts

ResumableSession

Suspended

SnapshotToo Old

Recovery Area Low On

Free Space

85% Warning97% Critical

TablespaceSpace Usage

Database Control:SYSTEM metrics

Tablespace

Page 21: Proactive Maintenance

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

Setting Thresholds

Page 22: Proactive Maintenance

12-25 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 23: Proactive Maintenance

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

Alerts Notification

Page 24: Proactive Maintenance

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

Reacting to Alerts

• If needed, gather more input, for example, by running ADDM or another advisor.

• Take corrective measures.

• Acknowledge alerts, which are not automatically cleared.

Page 25: Proactive Maintenance

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

Alert Types and Clearing Alerts

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 26: Proactive Maintenance

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

Automated Maintenance Tasks .

• Scheduler initiates jobs

• Jobs run in the default maintenance window

• Limit maintenance impact on normal operation by using Resource Manager

Examples of maintenance:

• Gathering optimizer statistics

• Gathering segment information

• Backing up database

StatisticsAWRADDMAdvisorsAlerts

> AutoTasks

Page 27: Proactive Maintenance

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

Summary

In this lesson, you should have learned how to:

• Use statistics

• Manage the Automatic Workload Repository

• Use the Automatic Database Diagnostic Monitor

• Describe the advisory framework

• Set alert thresholds

• Use server-generated alerts

• Use automated tasks

Page 28: Proactive Maintenance

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

Practice Overview: Proactive Maintenance

This practice covers the following topics:

• Proactively managing your database by using ADDM– Setting up an issue for analysis– Reviewing your database performance– Implementing a solution