AWR(Automatic Workload Repository)报告是我们进行日常数据库性能评定、问题SQL发现的重要手段
调用脚本,生成文件(程序脚本一般保存在$ORACLE_HOME下的rdbms/admin中,名称为awrrpt.sql)
SQL> @?/rdbms/admin/awrrpt.sql
输入报告参数
--默认类型html
Specify the Report Type~~~~~~~~~~~~~~~~~~~~~~~Would you like an HTML report, or a plain text report?Enter 'html' for an HTML report, or 'text' for plain textDefaults to 'html'Enter value for report_type:
--选择awr报告时间跨度(一般会保存1个月左右)
Instances in this Workload Repository schema~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~DB Id Inst Num DB Name Instance Host------------ -------- ------------ ------------ ------------* 1397953534 1 DEV dev tts.oradgUsing 1397953534 for database IdUsing 1 for instance numberSpecify the number of days of snapshots to choose from~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~Entering the number of days (n) will result in the most recent(n) days of snapshots being listed. Pressing <return> withoutspecifying a number lists all completed snapshots.Enter value for num_days:
--选择开始和结束的快照(快照默认1个小时生成一个)
Listing the last day's Completed SnapshotsSnapInstance DB Name Snap Id Snap Started Level------------ ------------ --------- ------------------ -----dev DEV 19073 19 Sep 2019 00:00 119074 19 Sep 2019 01:00 119075 19 Sep 2019 02:00 119076 19 Sep 2019 03:00 119077 19 Sep 2019 04:00 119078 19 Sep 2019 05:00 119079 19 Sep 2019 06:00 119080 19 Sep 2019 07:00 119081 19 Sep 2019 08:00 119082 19 Sep 2019 09:00 1Specify the Begin and End Snapshot Ids~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~Enter value for begin_snap:Enter value for end_snap:
--默认awr报告文件名(awrrpt_inst_beginscapid_endscapid.html)
Specify the Report Name~~~~~~~~~~~~~~~~~~~~~~~The default report file name is awrrpt_1_19073_19082.html. To use this name,press <return> to continue, otherwise enter an alternative.Enter value for report_name:
生成完成,在进入命令行的当前目录下可以看到生成的awr文件
文章转载自数据库这点小事,如果涉嫌侵权,请发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。




