除了AWR报告本身,Oracle还提供了一些AWR相关的脚本,用于进行辅助操作。本篇主要介绍awr Info脚本。
1、环境介绍
本篇使用Oracle 11gR2进行实验,具体版本为11.2.0.4。
[oracle@SICS-MIGPC-DB ~]$ sqlplus /nolog
SQL*Plus: Release 11.2.0.4.0 Production on Sat Oct 10 08:52:31 2015
Copyright (c) 1982, 2013, Oracle.? All rights reserved.
SQL> conn / as sysdba
Connected.
SQL> select * from v$version;
BANNER
--------------------------------------------------------------------------------
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
PL/SQL Release 11.2.0.4.0 - Production
CORE? ? 11.2.0.4.0? ? ? Production
TNS for Linux: Version 11.2.0.4.0 - Production
NLSRTL Version 11.2.0.4.0 – Production
2、脚本执行
执行的生成脚本是在Oracle客户端。为避免由于版本原因带来的差异问题,笔者建议最好是在Oracle服务器端生成文件。
[oracle@SICS-MIGPC-DB ~]$ sqlplus /nolog
SQL*Plus: Release 11.2.0.4.0 Production on Sat Oct 10 09:16:45 2015
Copyright (c) 1982, 2013, Oracle.? All rights reserved.
SQL> conn / as sysdba
Connected.
SQL> @?/rdbms/admin/awrinfo.sql
之后要求输入报告名称。
This script will report general AWR information
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Specify the Report File Name
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The default report file name is awrinfo.txt.? To use this name,
press to continue, otherwise enter an alternative.
Enter value for report_name:
最后会自动输出信息:
(若干输出)
(2b) ASH details (past 1 day)
**********************************
INST MIN_TIME? ? ? ? MAX_TIME? ? ? ? ? NUM_SAMPLES? ? NUM_ROWS AVG_ACTIVE
---- ---------------- ---------------- ------------ ------------ ----------
? 1 10:10:12 (10/09) 08:49:19 (10/10)? ? ? ? 8,145? ? ? ? 1,604? ? ? 0.20
**********************************
(2c) ASH sessions (Fg Vs Bg) (past 1 day across all instances in RAC)
**********************************
Foreground %? ? ? ? ? 90.0
Background %? ? ? ? ? 10.0
MMNL %? ? ? ? ? ? ? ? ? 0.0
End of Report
Report written to awrinfo.txt
在当前目录下,会看到awrinfo.txt文件。下面会分部分进行解析:
3、结果解析
下面分为若干部分进行结果说明。
第一部分:报告信息说明。抽取出AWR配置信息和保留自动删除信息。
~~~~~~~~~~~~~~~
AWR INFO Report
~~~~~~~~~~~~~~~
Report generated at? ? ? ? ? ? ? ? ? ? ? ? ?
09:18:28 on Oct 10, 2015 ( Saturday ) in Timezone +08:00? ? ? ? ? ? ? ? ? ?
? ? ? ? ? ? ?
Warning: Non Default AWR Setting!? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?
--------------------------------------------------------------------------------? ? ? ? ? ? ? ? ? ? ? ? ? ? ?
Snapshot interval is 60 minutes and Retention is 8 days? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?
? ? ? DB_ID DB_NAME? HOST_PLATFORM? ? ? ? ? ? ? ? ? ? ? ? ? ? INST STARTUP_TIME? ? ? LAST_ASH_SID PAR? ? ?
------------ --------- ---------------------------------------- ----- ----------------- ------------ ---? ? ?
* 2746051042 SICSDB? ? SICS-MIGPC-DB - Linux x86 64-bit? ? ? ? ? ? 1 10:28:41 (01/08)? ? ? 23726128 NO? ?
第二部分:AWR镜像snapshot信息。依据规则,每次snapshot记录是保存在sysaux表空间里面的。经常会遇到SYSAUX不断增大超过限制的问题,一般都是由于AWR Purge引起的问题。
########################################################
(I) AWR Snapshots Information
########################################################
*****************************************************
(1a) SYSAUX usage - Schema breakdown (dba_segments)
*****************************************************
|? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?
| Total SYSAUX size? ? ? ? ? ? ? ? ? ? ? 3,131.4 MB ( 10% of 32,768.0 MB MAX with AUTOEXTEND ON )? ? ? ? ? ? ?
|? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?
| Schema? SYS? ? ? ? ? occupies? ? ? ? ? 2,754.2 MB (? 88.0% )? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?
| Schema? XDB? ? ? ? ? occupies? ? ? ?