`

Automatic Workload Repository (AWR) in Oracle Database 10g

阅读更多

Oracle have provided many performance gathering and reporting tools over the years. Originally the UTLBSTAT/UTLESTAT scripts were used to monitor performance metrics. Oracle8i introduced the Statspack functionality which Oracle9i extended. In Oracle 10g statspack has evolved into the Automatic Workload Repository (AWR).

AWR Features

The AWR is used to collect performance statistics including:

  • Wait events used to identify performance problems.
  • Time model statistics indicating the amount of DB time associated with a process from the V$SESS_TIME_MODEL and V$SYS_TIME_MODEL views.
  • Active Session History (ASH) statistics from the V$ACTIVE_SESSION_HISTORY view.
  • Some system and session statistics from the V$SYSSTAT and V$SESSTAT views.
  • Object usage statistics.
  • Resource intensive SQL statements.

The repository is a source of information for several other Oracle 10g features including:

  • Automatic Database Diagnostic Monitor
  • SQL Tuning Advisor
  • Undo Advisor
  • Segment Advisor

Snapshots

By default snapshots of the relevant data are taken every hour and retained for 7 days. The default values for these settings can be altered using:

BEGIN
  DBMS_WORKLOAD_REPOSITORY.modify_snapshot_settings(
    retention => 43200,        -- Minutes (= 30 Days). Current value retained if NULL.
    interval  => 30);          -- Minutes. Current value retained if NULL.
END;
/

The changes to the settings are reflected in the DBA_HIST_WR_CONTROL view. Typically the retention period should capture at least one complete workload cycle. If you system has monthly archive and loads a 1 month retention time would be more beneficial that the default 7 days. An interval of "0" switches off snapshot collection, which in turn stops much of the self-tuning functionality, hence this is not recommended. Automatic collection is only possible if the STATISTICS_LEVEL parameter is set to TYPICAL or ALL. If the value is set to BASIC manual snapshots can be taken, but they will be missing some statistics.

Extra snapshots can be taken and existing snapshots can be removed using:

EXEC DBMS_WORKLOAD_REPOSITORY.create_snapshot;

BEGIN
  DBMS_WORKLOAD_REPOSITORY.drop_snapshot_range (
    low_snap_id  => 22, 
    high_snap_id => 32);
END;
/

Snapshot information can be queried from the DBA_HIST_SNAPSHOT view.

Baselines

A baseline is a pair of snapshots that represents a specific period of usage. Once baselines are defined they can be used to compare current performance against similar periods in the past. You may wish to create baseline to represent a period of batch processing like:

BEGIN
  DBMS_WORKLOAD_REPOSITORY.create_baseline (
    start_snap_id => 210, 
    end_snap_id   => 220,
    baseline_name => 'batch baseline');
END;
/

The pair of snapshots associated with a baseline are retained until the baseline is explicitly deleted:

BEGIN
  DBMS_WORKLOAD_REPOSITORY.drop_baseline (
    baseline_name => 'batch baseline',
    cascade       => FALSE); -- Deletes associated snapshots if TRUE.
END;
/

Baseline information can be queried from the DBA_HIST_BASELINE view.

Workload Repository Views

The following workload repository views are available:

  • V$ACTIVE_SESSION_HISTORY - Displays the active session history (ASH) sampled every second.
  • V$METRIC - Displays metric information.
  • V$METRICNAME - Displays the metrics associated with each metric group.
  • V$METRIC_HISTORY - Displays historical metrics.
  • V$METRICGROUP - Displays all metrics groups.
  • DBA_HIST_ACTIVE_SESS_HISTORY - Displays the history contents of the active session history.
  • DBA_HIST_BASELINE - Displays baseline information.
  • DBA_HIST_DATABASE_INSTANCE - Displays database environment information.
  • DBA_HIST_SNAPSHOT - Displays snapshot information.
  • DBA_HIST_SQL_PLAN - Displays SQL execution plans.
  • DBA_HIST_WR_CONTROL - Displays AWR settings.

Workload Repository Reports

Oracle provide two scripts to produce workload repository reports (awrrpt.sql and awrrpti.sql). They are similar in format to the statspack reports and give the option of HTML or plain text formats. The two reports give essential the same output but the awrrpti.sql allows you to select a single instance. The reports can be generated as follows:

@$ORACLE_HOME/rdbms/admin/awrrpt.sql
@$ORACLE_HOME/rdbms/admin/awrrpti.sql

The scripts prompt you to enter the report format (html or text), the start snapshot id, the end snapshot id and the report filename. The resulting report can be opend in a browser or text editor accordingly.

Enterprise Manager

The automated workload repository administration tasks have been included in Enterprise Manager. The "Automatic Workload Repository" page is accessed from the main page by clicking on the "Administration" link, then the "Workload Repository" link under the "Workload" section. The page allows you to modify AWR settings or manage snapshots without using the PL/SQL APIs.

分享到:
评论

相关推荐

    oracle database 10g:administration workshop i

    为了提升性能,Oracle提供了各种工具和策略,如SQL*Plus用于查询分析,Automatic Workload Repository (AWR)用于收集性能数据,以及Automatic Memory Management (AMM) 自动化内存管理。 安全性是Oracle数据库的...

    Oracle Database 10g Administration Workshop I中文版

    Oracle 10g提供了许多工具和特性来提升系统性能,例如SQL Tuning Advisor用于分析和优化SQL语句,Database Buffer Cache和Shared Pool的管理,以及Automatic Workload Repository (AWR)报告,这些都帮助DBA识别并...

    Oracle Database 10g:New Features for Administrators

    5. **自动工作负载 repository(Automatic Workload Repository, AWR)**:AWR是自动收集系统性能数据的工具,用于性能监控和调优。它提供了详细的报告,帮助管理员识别性能瓶颈。 6. **SQL优化顾问(SQL Tuning ...

    Oracle Database 10g OCP Certification All-in-One Exam Guide

    《Oracle Database 10g OCP Certification All-in-One Exam Guide》是专为想要获取Oracle Certified Professional(OCP)认证的数据库管理员所准备的一本全面指南。这本书深入浅出地介绍了Oracle Database 10g的核心...

    Oracle Database 10g:Administration Workshop II

    在本教程中,你将学习如何使用SQL调优顾问、性能监视工具如AWR(Automatic Workload Repository)和ASH(Automatic Shared Memory Management)来分析和提升SQL查询性能。此外,你还会接触到数据库的分区技术,它能有效...

    Oracle Database 10g Administration Workshop II 官方原厂培训材料

    2. 性能管理:学习使用SQL监控和AWR(Automatic Workload Repository)来分析和优化数据库性能。理解数据库调优的基本步骤,包括执行计划分析、索引优化和统计信息收集。 3. 高可用性:探讨RAC(Real Application ...

    Oracle Database 10g Administration Workshop II中文版

    例如,通过SQL Tuning Advisor分析慢查询,使用Automatic Workload Repository (AWR) 和Statistic Gathering收集性能数据,以及调整初始化参数以优化数据库配置。学习这些技巧,能帮助你确保数据库高效运行,减少...

    Oracle Database 11g DBA手册

    Oracle Database 11g提供了许多性能监控工具,如SQL*Plus、Enterprise Manager Console、Automatic Workload Repository(AWR)和Statistical Sampling。DBA通过分析SQL语句执行计划、等待事件和资源使用情况,可以...

    Oracle Database 10g完全参考手册

    6. **Performance Enhancements**:Oracle 10g在性能方面有显著提升,如优化的查询执行计划、改进的并行执行机制、自动工作负载库(Automatic Workload Repository, AWR)和SQL Tuning Advisor,这些工具帮助管理员...

    Oracle Database 11g:初学者指南 (中文版)

    通过监控和分析SQL语句的执行计划,调整表分区、索引和内存设置,以及使用数据库诊断工具如AWR(Automatic Workload Repository)和ASH(Active Session History),你可以优化数据库性能,提高系统响应速度。...

    Oracle Database 10g Administration Workshop I

    - **性能调优**:涵盖SQL查询优化、索引管理、统计信息收集以及AWR(Automatic Workload Repository)和ADDM(Automatic Database Diagnostic Monitor)的使用。 - **安全管理**:讲解如何设置用户权限、角色分配...

    Oracle Database 10g:Real Application Clusters Vol 1

    - Automatic Workload Repository (AWR) 和 SQL Tuning Advisor:用于性能监控和SQL优化。 6. RAC扩展性: - 添加和移除节点:RAC支持在线添加或移除节点,不中断服务。 - Data Guard:结合Data Guard,RAC可以...

    Oracle Database 10g Performance Tuning

    ### Oracle Database 10g 性能调优 #### 知识点概览 本文档主要介绍了Oracle Database 10g的性能调优方法和技术,适用于希望提高数据库系统性能的IT专业人士。通过学习本课程,学员可以掌握如何优化Oracle Database...

    Oracle Database 10g Administration

    - **性能监控工具**:如AWR(Automatic Workload Repository)报告、ASH(Active Session History)等。 - **SQL 调优**:包括SQL语句分析、执行计划优化等。 - **内存管理**:利用SGA(System Global Area)和PGA...

    Oracle+Database+10g完全参考手册.rar

    2. **性能优化**:Oracle 10g提供了强大的性能监控和调优工具,如SQL Trace、 tkprof 和 Automatic Workload Repository (AWR)。这些工具帮助DBA分析数据库性能,找出瓶颈,并制定优化策略。 3. **数据库安全性**:...

    ORACLE DATABASE 11G性能优化攻略_高清_美 Sam R Alapati.pdf

    Oracle Database 11g是Oracle公司推出的一个重要的数据库管理系统版本,它在原有的Oracle 10g基础上进行了大量的改进和完善。Oracle 11g不仅提供了强大的数据存储和管理功能,还针对数据库性能做了诸多优化,包括但...

    Oracle Database 10g: The Top 20 Features for DBAs

    ### Oracle Database 10g: The Top 20 Features for DBAs #### 1. Flashback Versions Query **Description:** This feature allows database administrators (DBAs) to query the history of data changes within ...

    OCP Oracle Database 11g Administration II Exam Guide Exam 1Z0-053

    6. **故障诊断与问题解决**:学习使用告警日志、跟踪文件、ASH(Active Session History)和 AWR(Automatic Workload Repository)报告来诊断和解决常见问题。 7. **高可用性与容错**:掌握 RAC(Real Application...

    Oracle Database 11g DBA Handbook

    3. **性能优化**:Oracle 11g提供了许多性能监控和调优工具,如SQL*Trace、Automatic Workload Repository(AWR)、Database Diagnostic Monitor(DDM)和ASH(Active Session History)。DBA需要学会利用这些工具...

Global site tag (gtag.js) - Google Analytics