13.Oracle之AWR报告

AWR报告是对Oracle的性能分析的常用的手段。。。

0.什么是AWR

   Automatic workload repository(awr) is a repository of historical performance data that includes cumulative statistics for the system, sessions, individual SQL statements, segments, and services.

  As shown in the following graphic, the database stores recent AWR statistics in the SGA. By default, the MMON process gathers statistics every hour and creates an AWR snapshot. An AWR snapshot is a set of performance statistics captured at a specific time. The database writes snapshots to the SYSAUX tablespace. AWR manages snapshot space, purging older snapshots according to a configurable snapshot retention policy.

这些快照信息都会被存在DBA_HIST_SNAPSHOT表中。

因为awr报告基本上是每小时会产生一次(默认),生成一个快照,如果想要调整这个时间间隔,可以使用如下的存储过程来修改

BEGIN
  DBMS_WORKLOAD_REPOSITORY.MODIFY_SNAPSHOT_SETTINGS( retention  => 43200, 
                                                     interval   => 30, 
                                                     topnsql    => 100, 
                                                     dbid       => 3310949047);
END;
/
retention :快照的保护期,单位是分钟
interval:生成快照的间隔,单位是分钟
SQL> select snap_interval, retention from DBA_HIST_WR_CONTROL; 

SNAP_INTERVAL               RETENTION 
--------------------------------------- 
+00000 01:00:00.0        +00008 00:00:00.0    快照默认保留8天

通过上图就能看到这个策略

2. 创建一个基线

  为什么要创建一个基线呢,因为基线是一个Oracle性能指标的一个标准,一般代表着Oracle最好的(最稳定)的一个状态,假如oracle出现了不稳定,我们可以打一个awr报告,然后和该基线(awr)对对比,这样就能判断是某些指标是高了还是正常的。

 

3. 怎样生成AWR报告

 

然后按照需求打印那个时间段的,

awr中的各个指标具体见:https://www.modb.pro/doc/28288

参考:https://docs.oracle.com/en/database/oracle/oracle-database/19/tgdba/gathering-database-statistics.html#GUID-44811EF8-D082-487F-8EEC-DA6E78700E68

 

posted on   太白金星有点烦  阅读(426)  评论(0编辑  收藏  举报

相关博文:
阅读排行:
· DeepSeek “源神”启动!「GitHub 热点速览」
· 微软正式发布.NET 10 Preview 1:开启下一代开发框架新篇章
· C# 集成 DeepSeek 模型实现 AI 私有化(本地部署与 API 调用教程)
· DeepSeek R1 简明指南:架构、训练、本地部署及硬件要求
· 2 本地部署DeepSeek模型构建本地知识库+联网搜索详细步骤

导航

< 2025年2月 >
26 27 28 29 30 31 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 1
2 3 4 5 6 7 8
点击右上角即可分享
微信分享提示