For some time, Oracle’s solution in this area has been its built-in tool, Statspack.Oracle Database 10g offers a significant improvement: the Automatic Workload Repository (AWR). The AWR installs along with the database and captures not only statistics, but the derived metrics as well.

AWR retention settings and data gathering frequency
The AWR History is by default maintained for 7 days and the data is gathered in the AWR repository tables every hour by default.

The current snapshot retention settings and data gathering frequency can be determined by the query shown below. Note in this case the default settings of 7 days and 1 hour is displayed.

SQL> select to_char(snap_interval,’DD’),to_char(retention,’DD’) FROM dba_hist_wr_control;

TO_CHAR(SNAP_INTER TO_CHAR(RETENTION,
—————— ——————
+00000 01:00:00.0 +00007 00:00:00.0;

To change the settings –say, for snapshot intervals of 20 minutes and a retention period of two days –you would issue the following. The parameters are specified in minutes.

begin
dbms_workload_repository.modify_snapshot_settings (
interval => 20,
retention => 2*24*60
);
end;

AWR TABLES
Metadata (WRM$)
Historical data (WRH$)
AWR tables related to advisor functions (WRI$)
Oracle 11g New Features About Workload Capture and Workload Replay tables (WRR$)

Workload Repository Reports
Oracle provide two main 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

There are other scripts too, here is the full list:

REPORT NAME SQL Script
Automatic Workload Repository Report awrrpt.sql
Automatic Database Diagnostics Monitor Report addmrpt.sql
ASH Report ashrpt.sql
AWR Diff Periods Report awrddrpt.sql
AWR Single SQL Statement Report awrsqrpt.sql
AWR Global Report awrgrpt.sql
AWR Global Diff Report awrgdrpt.sql
Exporting and Importing AWR snapshot data
AWR data is stored in the WRH$ and DBA_HIST tables in the SYSAUX tablespace. There could be performance implications if these tables were to grow too large in size or if the retention was increased beyond the default of 7 days.

A good solution is to have a central repository and move statistical AWR data periodically to this central repository database using the Oracle supplied awrextr.sql and awrload.sql scripts which can be found in the $ORACLE_HOME/rdbms/admin directory.

— in source db
SQL> @?/rdbms/admin/awrextr.sql

— in target db
SQL>@?/rdbms/admin/awrload.sql

or

using oracle internal package
dbms_swrf_internal.AWR_EXTRACT
DBMS_SWRF_INTERNAL.AWR_LOAD
DBMS_SWRF_INTERNAL.MOVE_TO_AWR
DBMS_SWRF_INTERNAL.CLEAR_AWR_DBID

Clean AWR
exec dbms_swrf_internal.unregister_database();

dbms_workload_repository.DROP_SNAPSHOT_RANGE;

Disable Oracle AWR
If you would like to disable AWR from executing on an Oracle database, here are several ways to turn it off. If you are not using the AWR data, why pay the penalty for having it continually running and collecting unused data. These steps are listed in what I think are the easiest options first.

1,Set STATISTICS_LEVEL parameter to BASIC.
2,Run the CATNOAWR.sql script to drop the AWR Repository tables. The script calls procedure dbms_swrf_internal.remove_wr_control, which deletes a row relating to your database from the wrm$_wr_control table, and then drops all the AWR tables.
3,Execute DBMS_WORKLOAD_REPOSITORY.MODIFY_SNAPSHOT_SETTINGS(interval=>0).By setting the value of the interval as 0, we set the new interval between each snapshot collection as 110 years:
4,Download dbms_awr.plb from Metalink, compile this package and execute the PL/SQL package DBMS_AWR.DISABLE_AWR() [see Metalink note 436386.1].
5,This does not work for an existing database, but does for future databases: Create your own database creation scripts (do not utilize DBCA) and do not execute the CATAWRTB.sql script.
6,_awr_restrict_mode initialization parameter which is set to TRUE and turns off all AWR features in the repository database

Recreate the AWR
Oracle Support suggesting us to recreate the AWR using the below steps since our SYSAUX tablespace is keep growing:

alter system set sga_target=0 scope=spfile;
alter system set statistics_level = basic scope=both;
alter system set cluster_database=false;

shutdown immediate

startup restrict
— in 10g begin —
@?/rdbms/admin/catnoawr.sql
alter system flush shared_pool;
@?/rdbms/admin/catsvrm.sql –in the script had calls catawrtb.sql
— in 10g end —

— in 11g begin—
SQL> @?/rdbms/admin/catnoawr.sql
SQL> alter system flush shared_pool;
SQL> @?/rdbms/admin/catawr.sql
SQL> @?/rdbms/admin/utlrp.sql
sql> @?/rdbms/admin/execsvrm.sql
— in 11g end—

Then re-enable the AWR statistics gathering as required, by setting STATISTICS_LEVEL back to its original value, and restart the instance normally

Tip:
When SYSAUX tablespace is keep growing,you can check the V$SYSAUX_OCCUPANTS View to find out who/what is occupying space in SYSAUX.

MORE ABORT AWR?的更多相关文章

  1. ORACLE ASH/AWR

    (一) ASH 用户在ORACLE数据库中执行操作时,必然要创建相应的连接和会话,其中,所有当前的会话信息都保存在动态性能视图V$SESSION中,通过该视图,DBA可以查看用户实际执行的操作,或者当 ...

  2. Oracle的awr和ash

    1.     10g之前 用户的连接将产生会话,当前会话记录保存在v$session中:处于等待状态的会话会被复制一份放在v$session_wait中.当该连接断开后,其原来的连接信息在v$sess ...

  3. 【OCP、OCM、高可用等】小麦苗课堂网络班招生简章(从入门到专家)--课程大纲

    [OCP.OCM.高可用等]小麦苗课堂网络班招生简章(从入门到专家)--课程大纲 小麦苗信息 我的个人信息 网名:小麦苗 QQ:646634621 QQ群:618766405 我的博客:http:// ...

  4. 【OCP|OCM】Oracle培训考证系列

     [OCP|OCM]Oracle培训考证系列  我的个人信息 网名:小麦苗 QQ:646634621 QQ群:618766405 我的博客:http://blog.itpub.net/26736162 ...

  5. JQuery LazyLoad实现图片延迟加载-探究

    对于大量图片的网站,图片延迟加载是提高速度和性能的好方法. 目前图片延迟加载主要分两大块,一是触发加载(根据滚动条位置加载图片):二是自动预加载(加载完首屏后n秒后自动加载其他位置的图片).大体常用的 ...

  6. MySQL redo lock 死锁问题排查 & 解决过程

    版权声明:本文由张青林原创文章,转载请注明出处: 文章原文链接:https://www.qcloud.com/community/article/181 来源:腾云阁 https://www.qclo ...

  7. C语言的本质(21)——预处理之三:其它预处理特性及总结

    C标准规定了几个特殊的宏,在不同的地方使用可以自动展开成不同的值,预编译程序对于在源程序中出现的这些串将用合适的值进行替换.这些宏有下面这些: __FILE__ 展开为当前源文件的文件名,是一个字符串 ...

  8. 分布式一致性算法2PC和3PC

    为了解决分布式一致性问题,产生了不少经典的分布式一致性算法,本文将介绍其中的2PC和3PC.2PC即Two-Phase Commit,译为二阶段提交协议.3PC即Three-Phase Commit, ...

  9. ORA-4031 错误故障排除与诊断[视频] (Doc ID 2016002.1)

    Copyright (c) 2019, Oracle. All rights reserved. Oracle Confidential.     ORA-4031 错误故障排除与诊断[视频] (Do ...

随机推荐

  1. 【转】Android中设置TextView的颜色setTextColor--代码中设置字体颜色

    原文网址:http://www.cnblogs.com/myphoebe/archive/2012/01/06/2314728.html android中设置TextView的颜色有方法setText ...

  2. 一点一点学ASP.NET系列

    转自:http://www.cnblogs.com/stwyhm/archive/2006/08/10/473075.html 做开发近两年了,自认为自己还算是个知道要上进的人,每天不停地学习,不停地 ...

  3. SAS软件的使用和统计学分析的初步介绍

           一般而言我们都会使用Excel来统计测试结果,除了Excel之外,还有SAS等软件,也是可以统计测试结果的,本人也是SAS的初学者,现在我就给大家介绍一下SAS的简单使用,随着我不断的学 ...

  4. Oracle Statspack报告中各项指标含义详解~~学习性能必看!!!

    Oracle Statspack报告中各项指标含义详解~~学习性能必看!!! Data Buffer Hit Ratio#<#90# 数据块在数据缓冲区中的命中率,通常应该在90%以上,否则考虑 ...

  5. Web---session技术代码演示(request,session,servletContext)

    Session会话简介与基本知识点 当浏览器第一次访问服务器时,无论先访问哪一个页面,服务器就会给用户分配一个唯一的会话标识,即jsessionid然后以cookie的形式返回给用户. 会话是指在一段 ...

  6. cf293E Close Vertices(树分治+BIT)

    E. Close Vertices You've got a weighted tree, consisting of n vertices. Each edge has a non-negative ...

  7. python的import与from...import的不同之处

    在python用import或者from...import来导入相应的模块.模块其实就是一些函数和类的集合文件,它能实现一些相应的功能,当我们需要使用这些功能的时候,直接把相应的模块导入到我们的程序中 ...

  8. 380. Insert Delete GetRandom O(1)

    经过昨天的消沉 今天我振作了 设计个数据结构,添加,删除,随机获取都是O(1). 怎么会有这么牛逼的数据结构,所以肯定相应的要耗费空间. 添加和获取耗时O(1)是Array的特性,或者说是Map/Ta ...

  9. 之前学习wordpress的几张图片

  10. [每日一题] 11gOCP 1z0-052 :2013-08-31 数据库的存储结构....................................................A8

    转载请注明出处:http://blog.csdn.net/guoyjoe/article/details/10784599 . 正确答案:A 将逻辑存储与物理存储分开是关系数据库范例的必要部分.关系数 ...