Oracle-AWR管理包DBMS_WORKLOAD_REPOSITORY.MODIFY_SNAPSHOT_SETTINGS
- 概述
- MODIFY_SNAPSHOT_SETTINGS Procedures
概述
官方说明:DBMS_WORKLOAD_REPOSITORY
Overview of the Automatic Workload Repository
AWR机制:通过对系统整体动态采样收集快照信息,存储在SYSAUX表空间,,MMON进程实施,快照分析后写入DBA_HIST_%开头的数据字典。
select table_name from dictionary where table_name like 'DBA_HIST_%';
DBMS_WORKLOAD_REPOSITORY包管理AWR(Automatic Workload Repository),执行诸如管理快照和基线等操作。
因包中功能众多,这里我们仅关注MODIFY_SNAPSHOT_SETTINGS
MODIFY_SNAPSHOT_SETTINGS Procedures
默认快照间隔1小时,10g保存7天,11g保存8天
可以通过dbms_workload_repository.MODIFY_SNAPSHOT_SETTINGS存过来调整AWR快照的相关参数
我们来看下Oralce对这段存过标注的注释 ,说明均在注释里,请仔细阅读
--
-- modify_snapshot_settings()
-- Procedure to adjust the settings of the snapshot collection.
--
-- Input arguments:
-- retention - new retention time (in minutes). The
-- specified value must be in the range:
-- MIN_RETENTION (1 day) to
-- MAX_RETENTION (100 years)
--
-- If ZERO is specified, snapshots will be
-- retained forever. A large system-defined
-- value will be used as the retention setting.
--
-- If NULL is specified, the old value for
-- retention is preserved.
--
-- ***************
-- NOTE: The retention setting must be
-- greater than or equal to the window
-- size of the 'SYSTEM_MOVING_WINDOW'
-- baseline. If the retention needs
-- to be less than the window size,
-- the 'modify_baseline_window_size'
-- routine can be used to adjust the
-- window size.
-- ***************
--
-- interval - the interval between each snapshot, in
-- units of minutes. The specified value
-- must be in the range:
-- MIN_INTERVAL (10 minutes) to
-- MAX_INTERVAL (100 years)
--
-- If ZERO is specified, automatic and manual
-- snapshots will be disabled. A large
-- system-defined value will be used as the
-- interval setting.
--
-- If NULL is specified, the
-- current value is preserved.
--
-- topnsql (NUMBER) - Top N SQL size. The number of Top SQL
-- to flush for each SQL criteria
-- (Elapsed Time, CPU Time, Parse Calls,
-- Shareable Memory, Version Count).
--
-- The value for this setting will be not
-- be affected by the statistics/flush level
-- and will override the system default
-- behavior for the AWR SQL collection. The
-- setting will have a minimum value of 30
-- and a maximum value of 50000.
--
-- IF NULL is specified, the
-- current value is preserved.
--
-- topnsql (VARCHAR2) - Users are allowed to specify the following
-- values: ('DEFAULT', 'MAXIMUM', 'N')
--
-- Specifying 'DEFAULT' will revert the system
-- back to the default behavior of Top 30 for
-- level TYPICAL and Top 100 for level ALL.
--
-- Specifying 'MAXIMUM' will cause the system
-- to capture the complete set of SQL in the
-- cursor cache. Specifying the number 'N' is
-- equivalent to setting the Top N SQL with
-- the NUMBER type.
--
-- Specifying 'N' will cause the system
-- to flush the Top N SQL for each criteria.
-- The 'N' string is converted into the number
-- for Top N SQL.
--
-- dbid - database identifier for the database to
-- adjust setting. If NULL is specified, the
-- local dbid will be used.
--
-- For example, the following statement can be used to set the
-- Retention and Interval to their minimum settings:
--
-- dbms_workload_repository.modify_snapshot_settings
-- (retention => DBMS_WORKLOAD_REPOSITORY.MIN_RETENTION
-- interval => DBMS_WORKLOAD_REPOSITORY.MIN_INTERVAL)
--
-- The following statement can be used to set the Retention to
-- 8 days and the Interval to 60 minutes and the Top N SQL to
-- the default setting:
--
-- dbms_workload_repository.modify_snapshot_settings
-- (retention => 11520, interval => 60, topnsql => 'DEFAULT');
--
-- The following statement can be used to set the Top N SQL
-- setting to 200:
-- dbms_workload_repository.modify_snapshot_settings
-- (topnsql => 200);
--
存过定义如下
PROCEDURE modify_snapshot_settings(retention IN NUMBER DEFAULT NULL,interval IN NUMBER DEFAULT NULL,topnsql IN NUMBER DEFAULT NULL,dbid IN NUMBER DEFAULT NULL);PROCEDURE modify_snapshot_settings(retention IN NUMBER DEFAULT NULL,interval IN NUMBER DEFAULT NULL,topnsql IN VARCHAR2,dbid IN NUMBER DEFAULT NULL);
如何修改默认的参数值呢?
This example changes the interval setting to one hour and the retention setting to two weeks for the local database:
EXECUTE DBMS_WORKLOAD_REPOSITORY.MODIFY_SNAPSHOT_SETTINGS(interval => 60,retention => 20160);
重新查询 DBA_HIST_WR_CONTROL 可以发现新的规则已经生效。
AWR参数存放的表 DBA_HIST_WR_CONTROL
snapshot的信息存放在DBA_HIST_SNAPSHOT
Oracle-AWR管理包DBMS_WORKLOAD_REPOSITORY.MODIFY_SNAPSHOT_SETTINGS相关推荐
- Oracle AWR管理与维护
AWR是Automatic Workload Repository的简称,中文叫着自动工作量资料档案库.对于AWR的管理,主要是针对快照和基线的管理而言.比如设定快照的间隔,删除快照,设定快照的保 ...
- Oracle Awr
About Oracle AWR Oracle AWR is a powerful monitoring utility bundle with Oracle Database from 10g. O ...
- oracle 删除awr报告,学习笔记:Oracle awr入门 深入了解AWR报告
天萃荷净 深入了解AWR报告,ASH与AWR报告的官方说明,数据库进程和性能视图获取 1.AWR与ASH概念 1.ASH 若是一个普通的会话(我是指没有大量地耗费资源),则对于性能调整来说无足轻重.但 ...
- oracle awr 计算,【Oracle AWR详解分析】
一.WHY--为什么会出现ASH和AWR? 1.10g之前 用户的连接将产生会话,当前会话记录保存在v$session中:处于等待状态的会话会被复制一份放在v$session_wait中.当该连接断开 ...
- ORACLE AWR简介
http://blog.csdn.net/wildwave/article/details/6838906 Automatic Workload Repository(AWR)收集.处理和维护性能系统 ...
- Oracle AWR报告指标全解析-11011552
1-5 Top 5 Timed Events Waits : 该等待事件发生的次数, 对于DB CPU此项不可用 Times : 该等待事件消耗的总计时间,单位为秒, 对于DB CPU 而言是前台进程 ...
- Oracle AWR报告指标全解析
1-5 Top 5 Timed Events Waits : 该等待事件发生的次数, 对于DB CPU此项不可用 Times : 该等待事件消耗的总计时间,单位为秒, 对于DB CPU 而言是前台进程 ...
- oracle awr详解
啥是AWR? ============================================================================================= ...
- 【性能调优】Oracle AWR报告指标全解析
[性能调优]Oracle AWR报告指标全解析 啥是AWR? ===================================================================== ...
最新文章
- 在eclipse中安装groovy插件详细步骤
- RT-Thread的I/O设备模块及其驱动实现步骤
- 解决中文乱码的问题要考虑的8个地方|(utf-8,用于抛砖引玉)
- 代理服务器 查看npm_使用sinopia搭建npm仓库,代理内网服务器npm服务
- 8.9 元学习网络结构讲解
- Asp.net mvc 网站之速度优化 -- Memcache
- DDA算法画直线+源代码
- winform DevComponents.DotNetBar2 添加到工具栏方法
- alize blue_泽野弘之 | 明明可以靠才华,却非要用脸滚键盘的神曲缔造者
- CocosCreator角色动态更换武器实现
- .NET Reflector Visual Studio Extension
- mysql学习应用_MySQL学习从这里出发!
- javascript call用法及好处
- 2020 最好的Linux网络监控工具(翻译)
- 一文带您了解亚细胞定位(Subcellular Localization)
- 麒麟系统安装clickhouse
- 16.CSS中使用颜色
- android studio中清除代码中的无效引用
- 五、输入输出管理(一)外部存储器管理
- Numpy属性dtype的转换(数据类型转换):unit8和float32转换
热门文章
- python DataFrame join()
- pandas Series 的索引对象(一)
- php fpm error,关于启动php-fpm失败的解决办法
- 组态王怎么做超级曲线_鱼怎么做才好吃?试试这个方法,吃着过瘾,还超级下饭!(收藏)...
- 127. Leetcode 242. 有效的字母异位词 (哈希表)
- seaborn 笔记:load_dataset
- NTU课程笔记 MAS714(8) 分治与排序
- Python可视化应用实战-如何制作酷炫的图表?
- MATLAB实战系列(二)- 如何使用YALMIP检验数学模型的正确性?
- 增强学习(二)----- 马尔可夫决策过程MDP