- --生成awr示例,以手动生成的两个快照生成awr报告
- SQL> col dbid for 9999999999
- SQL> col snap_interval for a20
- SQL> col retention for a20
- SQL> col topsql for a20
- SQL> set linesize 100
- SQL> select * from dba_hist_wr_control;
- DBID SNAP_INTERVAL RETENTION TOPNSQL
- ----------- -------------------- -------------------- ----------
- 3913660635 +00000 01:00:00.0 +00007 00:00:00.0 DEFAULT
- SQL> exec dbms_workload_repository.modify_snapshot_settings(interval=>30, retention=>10*24*60);
- PL/SQL 过程已成功完成。
- SQL> select * from dba_hist_wr_control;
- DBID SNAP_INTERVAL RETENTION TOPNSQL
- ----------- -------------------- -------------------- ----------
- 3913660635 +00000 00:30:00.0 +00010 00:00:00.0 DEFAULT
- --以手动生成的两个快照生成awr报告
- SQL> exec dbms_workload_repository.create_snapshot ();
- PL/SQL 过程已成功完成。
- SQL> exec dbms_workload_repository.create_snapshot ();
- PL/SQL 过程已成功完成。
- SQL> @G:\oracle\product\10.2.0\db_1\RDBMS\ADMIN\awrrpt.sql
- Current Instance
- ~~~~~~~~~~~~~~~~
- DB Id DB Name Inst Num Instance
- ----------- ------------ -------- ------------
- 3913660635 ORALIFE 1 oralife
- 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 text
- Defaults to 'html'
- 输入 report_type 的值:
- Type Specified: html
- Instances in this Workload Repository schema
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- DB Id Inst Num DB Name Instance Host
- ------------ -------- ------------ ------------ ------------
- * 3913660635 1 ORALIFE oralife LAUGHING-PC
- Using 3913660635 for database Id
- Using 1 for instance number
- Specify 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> without
- specifying a number lists all completed snapshots.
- 输入 num_days 的值: 1
- Listing the last day's Completed Snapshots
- Snap
- Instance DB Name Snap Id Snap Started Level
- ------------ ------------ --------- ------------------ -----
- oralife ORALIFE 943 18 8月 2012 00:00 1
- 944 18 8月 2012 09:31 1
- 945 18 8月 2012 10:56 1
- 946 18 8月 2012 10:59 1
- 947 18 8月 2012 17:25 1
- 948 18 8月 2012 18:00 1
- 949 18 8月 2012 19:00 1
- 950 18 8月 2012 19:10 1
- 951 18 8月 2012 19:10 1
- Specify the Begin and End Snapshot Ids
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- 输入 begin_snap 的值: 950
- Begin Snapshot Id specified: 950
- 输入 end_snap 的值: 951
- End Snapshot Id specified: 951
- Specify the Report Name
- ~~~~~~~~~~~~~~~~~~~~~~~
- The default report file name is awrrpt_1_950_951.html. To use this name,
- press <return> to continue, otherwise enter an alternative.
- 输入 report_name 的值:
- Using the report name awrrpt_1_950_951.html
- ...
- ...
- ...
- Report written to awrrpt_1_950_951.html
如何生成awr报告
最新推荐文章于 2024-08-24 09:35:43 发布