MORE ABORT AWR?

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.

时间: 2024-10-01 20:11:13

MORE ABORT AWR?的相关文章

【干货】ORACLE-AWR报告分析

1.什么是AWR? AWR (Automatic Workload Repository) 是自动负载信息库的英文缩写,AWR报告是Oracle 10g以后版本提供的一种性能收集和分析工具,能提供一个时间段内整个系统资源使用情况的报告,通过报告可以了解一个系统的整个运行情况,生成的报告包括多个部分. AWR每小时对v$active_session_history视图(内存中的ASH采集信息,理论为1小时)进行采样一次,并将信息保存到磁盘中,并且保留7天,7天后旧的记录才会被覆盖.这些采样信息被保

Oracle的awr和ash

1.     10g之前 用户的连接将产生会话,当前会话记录保存在v$session中:处于等待状态的会话会被复制一份放在v$session_wait中.当该连接断开后,其原来的连接信息在v$session和v$session_wait中就会被删除.这是10g之前的状况. 2.     v$session_wait_history与ASH 若是一个普通的会话(我是指没有大量地耗费资源),则对于性能调整来说无足轻重.但若该会话在活动时大量占用了资源(比如:CPU,内存,I/O等),该会话信息的丢失

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

版权声明:本文由 MySQL redo lock 死锁问题排查 & 解决过程 张青林 原创文章,转载请注明出处: 文章原文链接:https://www.qcloud.com/community/article/181 来源:腾云阁 https://www.qcloud.com/community 周一上班,首先向同事了解了一下上周的测试情况,被告知在多实例场景下 MySQL Server hang 住,无法测试下去,原生版本不存在这个问题,而新版本上出现了这个问题,不禁心头一颤,心中不禁感到奇怪

和浏览器异步请求取消相关的那些事

我们开发web页面时候,也许会遇到和异步请求取消相关的问题. 如:在一个请求发送之后,用户做了一个取消指令,为了节省资源,我们需要把已经被用户取消的请求终止掉:或者是一个页面正在用ajax请求后台,突然页面发生了跳转,而我们未完成的ajax莫名其妙地走进了error里面了. 为了解决这两问题,我们今天一起看看和异步请求取消相关的那些事. 1.ajax的取消 当我们创建一个XMLHttpRequest对象的时候,我们就会发现两个api——abert和onabort,这就是终止异步请求的方法与其响应

第九章结构体变量实验报告

实验项目: 1.结构体变量的应用 2.结构体数组的应用 3.共用体的应用 4.结构体指针的应用 姓名:谢丽萍  实验地点:教学楼514教室  实验时间2019.6.26 一.本章要点 1.对结构体和共用体的概念进行区分,学会定义变量和使用变量. 2.结构类型的定义可以嵌套,结构类型与联合类型的定义也可以相互嵌套,只是要注意被嵌套的类型必须先有定义. 3.将指针.数组与结构体或共用体相结合来实现数据的输入输出. 4.要了解各种函数的作用,例如:abort(),strmcmp()等. 二.实验内容

注意!你的Thread.Abort方法真的让线程停止了吗?

大家都知道在C#里面,我们可以使用 Thread.Start方法来启动一个线程,当我们想停止执行的线程时可以使用Thread.Abort方法来强制停止正在执行的线程,但是请注意,你确定调用了Thread.Abort方法后线程就立刻停止了吗? 答案是:不是! 下面我们来解释一下Abort方法是如何工作的.因为公用语言运行时管理了所有的托管的线程,同样它能在每个线程内抛出异常.Abort方法能在目标线程中抛出一个ThreadAbortException异常从而导致目标线程的终止.不过Abort方法被

Oracle 11g AWR 系列五:如何生成 AWR 报告?

1.生成单实例 AWR 报告:@$ORACLE_HOME/rdbms/admin/awrrpt.sql2.生成 Oracle RAC AWR 报告:@$ORACLE_HOME/rdbms/admin/awrgrpt.sql3.生成 RAC 环境中特定数据库实例的 AWR 报告:@$ORACLE_HOME/rdbms/admin/awrrpti.sql4.生成 Oracle RAC 环境中多个数据库实例的 AWR 报告的方法:@$ORACLE_HOME/rdbms/admin/awrgrpti.s

jQuery的document ready与 onload事件——你真的思考过吗?

在进行实验和资料查询时,我遇到了几个关键问题: 1. window.onload到底是什么加载完触发? 2. body为什么会有onload事件? 3. 为什么是window.onload,而不是document.onload? 4. document ready到底是什么ready,DOM渲染完成? 5. jQuery怎么实现$(document).ready? 6. jQuery的ready,还能ready什么? 7. jQuery的document ready就一定比window.onlo

关于AWR报告的解析

其实,网上关于AWR的解析已经足够多了.但总觉得通过收集资料,再加工写出来的资料能便于自己理解其中的各项内容,因此我对AWR进行一篇详尽的解析.希望能分几次完成 从AWR报告的第一部分包含了数据库的名称.数据库的ID号.实例名.实例数.启动的时间.数据库版本和是否为RAC.此外也包含了系统的部分信息. 该部分最关键的内容是第三个模块,里面记录了snapshot的开始时间和结束时间,以及数据库运行时间和用户级别调用(session)所消耗的时间. DB CPU:Amount of CPU time