oracle AWR深入研究分析,如何使用
AWR的前身是statspack,当然现在还在,只不过大家都在使用AWR,因为它方便,简单,直观,形象。
AWR是oracle内置工具,安装oracle时已经自动安装完毕,无需额外安装了。
SELECT *
FROM DBA_HIST_WR_CONTROL;
这里主要查看AWR策略的制定信息,多久抓一次快照,保留多长时间。
DECLARE
BEGIN
DBMS_WORKLOAD_REPOSITORY.modify_snapshot_settings (
interval => 30,
retention => 10 * 24 * 60);
END;
修改策略信息
如何生成AWR报表信息:
依赖于awrrpt.sql脚本,该脚本的路径是$oracle_home/RDBMS/ADMIN
该脚本的内容如下:
Rem $Header: awrrpt.sql 24-oct-2003.12:04:53 pbelknap Exp $
Rem
Rem awrrpt.sql
Rem
Rem Copyright (c) 1999, 2003, Oracle Corporation. All rights reserved.
Rem
Rem NAME
Rem awrrpt.sql
Rem
Rem DESCRIPTION
Rem This script defaults the dbid and instance number to that of the
Rem current instance connected-to, then calls awrrpti.sql to produce
Rem the Workload Repository report.
Rem
Rem NOTES
Rem Run as select_catalog privileges.
Rem This report is based on the Statspack report.
Rem
Rem If you want to use this script in an non-interactive fashion,
Rem see the 'customer-customizable report settings' section in
Rem awrrpti.sql
Rem
Rem MODIFIED (MM/DD/YY)
Rem pbelknap 10/24/03 - swrfrpt to awrrpt
Rem pbelknap 10/14/03 - moving params to rpti
Rem pbelknap 10/02/03 - adding non-interactive mode cmnts
Rem mlfeng 09/10/03 - heading on
Rem aime 04/25/03 - aime_going_to_main
Rem mlfeng 01/27/03 - mlfeng_swrf_reporting
Rem mlfeng 01/13/03 - Update comments
Rem mlfeng 07/08/02 - swrf flushing
Rem mlfeng 06/12/02 - Created
Rem --
-- Get the current database/instance information - this will be used
-- later in the report along with bid, eid to lookup snapshots set echo off heading on underline on;
column inst_num heading "Inst Num" new_value inst_num format 99999;
column inst_name heading "Instance" new_value inst_name format a12;
column db_name heading "DB Name" new_value db_name format a12;
column dbid heading "DB Id" new_value dbid format 9999999999 just c; prompt
prompt Current Instance
prompt ~~~~~~~~~~~~~~~~ select d.dbid dbid
, d.name db_name
, i.instance_number inst_num
, i.instance_name inst_name
from v$database d,
v$instance i; @@awrrpti undefine num_days;
undefine report_type;
undefine report_name;
undefine begin_snap;
undefine end_snap;
--
-- End of file
那么我们就通过调用该脚本产生报表信息:
后面就是基本简单操作。
关键产生报表后如何分析呢?
1、观察CACHE SIZE,观察主机内存情况,判断SGA的内存分批额是否合理
2、观察load profile的事务情况,判断系统繁忙程度
3、观察load profile的hard parses和Parses值,观察是否存在过多硬解析,从而定位是否存在绑定变量的问题
4、观察top 5 timed events,查看系统的瓶颈所在,一般而言,CPU TIME排名第一并且占用了绝大部分的时间比例,说明系统没有什么瓶颈
5、关注如下6个ordered by的sql语句,
elapsed_time,cpu time,gets,reads,executions,parse calls
oracle AWR深入研究分析,如何使用的更多相关文章
- Oracle AWR报告详细分析--比较详细
https://blog.csdn.net/demonson/article/details/79474133
- ORACLE AWR报告生成步骤
ORACLE AWR报告生成步骤 (以PL/SQL中命令窗口为例) 1.sqlplus或plsql的commod窗口(命令窗口)运行命令 @D:\oracle\product\10.2.0\db_1\ ...
- [转]oracle awr报告生成和分析
转自:http://blog.csdn.net/cuker919/article/details/8767328 最近由于数据库cpu占用非常高,导致VCS常常自动切换,引起很多问题. 最近学习一下数 ...
- (原创)如何在性能测试中自动生成并获取Oracle AWR报告
版权声明:本文为原创文章,转载请先联系并标明出处 由于日常使用最多的数据库为Oracle,因此,最近又打起了Oracle的AWR报告的主意. 过去我们执行测试,都是执行开始和结束分别手动建立一个快照, ...
- 【转】ORACLE AWR报告
转自:http://blog.csdn.net/liqfyiyi/article/details/8236864 About Oracle AWR Oracle AWR is a powerful m ...
- SQL中的Null深入研究分析
SQL中的Null深入研究分析 虽然熟练掌握SQL的人对于Null不会有什么疑问,但总结得很全的文章还是很难找,看到一篇英文版的, 感觉还不错. Tony Hoare 在1965年发明了 null 引 ...
- Oracle AWR,SQL_TRACE,10046,DBMS_PROFILER 等使用
Oracle AWR,SQL_TRACE,10046,DBMS_PROFILER 等使用 1 AWR 工具的使用及优化 1 10g默认安装 select * from dba_hist_wr_cont ...
- 快速熟悉 Oracle AWR 报告解读
目录 AWR报告简介 AWR报告结构 基本信息 Report Summary Main Report RAC statistics Wait Event Statistics 参考资料 本文面向没有太 ...
- Oracle AWR 数据导入/导出的步骤
LINUX状态下,连接oracle用户:su - oracle 1.上传采集快照.dmp文件至服务器 (dbid:4292035712) 919219826 2.在服务器端创建目录 (即文件夹a ...
随机推荐
- 【原创】CMD常用命令:解决实际问题
1.查找某一目录下后缀名文某某的所有文件. 命令格式:dir *.mp3 /a -d/b/s >C:\Users\leemo\Desktop\total.txt MP3为文件后缀名.>是命 ...
- mysql5.7.14安装与配置
参考文章链接: http://jingyan.baidu.com/article/afd8f4de9006d934e286e9fd.html http://www.cnblogs.com/wenthi ...
- html引入外部的jswenjian
首先看一下引入的方式是否正确 <script type='text/javascript' src='xx.js'></script> 其次看引入的路径是否正确 如果引入了第三 ...
- php多线程即时通讯
即时通讯:推送消息http://www.workerman.net/
- Object之克隆对象clone 和__clone()函数
在前面的PHP面向对象之对象和引用,"$b=$a"的方式复制对象传递的是对象的地址,而不是传递对象的值(内容),我们可以通过克隆对象来实现对对象的内容和引用的复制 使用传址引用的方 ...
- Android性能分析工具介绍
1. Android系统性能调优工具介绍 http://blog.csdn.net/innost/article/details/9008691 TraceviewSystraceOprofile 2 ...
- 从gcc的__attribute__((packed))聊到结构体大小的问题
公司的前辈的代码里面 结构体的花括号最后 有__attribute__((packed))字样.以前没见过,所以查了查.学习学习http://blog.sina.com.cn/s/blog_559f6 ...
- Newtonsoft.Json工具类
这个类用于序列化和反序列化类. 效果是当前最好的.微软都推荐使用.在建立MVC的里面已经引用了这个dll. 上面一篇文章要用到 SerializeHelper工具类 public class Seri ...
- 链表与Hash检索实测
测试环境: Win7 SP1.8G内存.3.4GHz 4核 测试代码: using System; using System.Collections.Generic; using System.Lin ...
- struts.enable.DynamicMethodInvocation = true 动态方法调用
default.properties 在Struts 2的核心jar包-struts2-core中,有一个default.properties的默认配置文件.里面配置了一些全局的信息,比如: stru ...