如何生成Oracle AWR报告

首先,准备一个目录作为AWR报告生成的路径。例如:[oracle@bspdev /]$ ls -l | grep testdrwxr-xr-x. 2 oracle oinstall 4096 Jun 21 13:01 test[oracle@bspdev /]$ cd test 启动sqlplus等开发工具,调用生成脚本。程序脚本一般保存在$ORACLE_HOME下的rdbms/admin中,名称为awrrpt.sql。[oracle...
如何生成Oracle AWR报告
AWR(Automatic Workload Repository)报告是数据库管理员进行日常数据库性能评定、问题SQL发现的重要工具。熟练掌握AWR报告,是做好开发、运维工作的基本技能。
首先,准备一个目录作为AWR报告生成的路径。例如:
[oracle@bspdev /]$ ls -l | grep testdrwxr-xr-x. 2 oracle oinstall 4096 Jun 21 13:01 test[oracle@bspdev /]$ cd test
启动sqlplus等开发工具,调用生成脚本。程序脚本一般保存在$ORACLE_HOME下的rdbms/admin中,名称为awrrpt.sql。
[oracle@bspdev test]$ sqlplus /nologSQL*Plus: Release11.2.0.1.0 Production on Tue Jun 21 13:04:44 2011Copyright (c) 1982, 2009, Oracle. All rights reserved.SQL> conn / as sysdbaConnected.
调用脚本,生成文件:
SQL> @?/rdbms/admin/awrrpt.sql
之后进入报告参数输入模块。
输入报告参数:报告涉及天数范围、报告类型等。
启动报告后,会显示生成实例的名称等基本信息。默认情况下,AWR会将镜像信息保留一个月。手工生成的时候,需要确认生成AWR报告的时间范围。一般情况下,特别是生产环境下,我们通常设置1-7天也就够用了。
Instances in this Workload Repository schema
DB Id Inst Num DB Name Instance Host----------------- -------- ------------------ ------------ ------------* 4143510747 1 ORA11G ora11g bspdev.local domainUsing 4143510747 for database IdUsing 1 for instance numberSpecify the number of days of snapshots to choose fromEntering the number of days (n) will result in the most recent (n) days of snapshots being listed. Pressing without specifying a number lists all completed snapshots.
输入天数信息后,AWR生成代码会将天数范围内的snapshot镜像点列出,供输入选择。
Listing the last 3 days of Completed Snapshots
Snap Instance DB Name Snap Id Snap Started Level------------ ------------ --------- ------------------ -----ora11g ORA11G 1789 20 Jun 2011 13:01 11790 20 Jun 2011 14:00 11791 20 Jun 2011 15:00 11792 20 Jun 2011 16:00 1...1811 21 Jun 2011 11:00 11812 21 Jun 2011 12:00 11813 21 Jun 2011 13:00 1
Specify the Begin and End Snapshot Ids
根据列出的时间范围,输入开始和结束的snap编号。
Specify the Report Name
一般采用默认的名称就可以了。
最后输出内容很多,此处不加以累述。最后提示报告生成成功。
Report written to awrrpt_1_1796_1813.html
于是,指定目录上可以看到相应的报告文件。
[oracle@bspdev test]$ ls -ltotal 508-rw-r--r--. 1 oracle oinstall 515262 Jun 21 13:10 awrrpt_1_1796_1813.html
2024-12-15
cdw 阅读 16 次 更新于 2025-08-05 00:12:19 我来答关注问题0
词典网在线解答立即免费咨询

报告相关话题

Copyright © 2023 cidian.nuo5.com - 词典网 打一生肖 英语单词  夜唱网
返回顶部