AWR报告

1. 导出AWR报告

@?/rdbms/admin/awrrpt.sql

@$ORACLE_HOME/rdbms/admin/awrrpt.sql

生产的报告在登录oracle的目录下

2. 强制生成快照

exec dbms_workload_repository.create_snapshot();

通过两次强制生成快照,可以查看该时间段内的报告

3. 查看当前快照配置

SQL> select * from dba_hist_wr_control;

      DBID SNAP_INTERVAL                                                                    RETENTION                                                                        TOPNSQL
---------- -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- ----------
1579433655 +00000 01:00:00.0                                                                +00008 00:00:00.0                                                                DEFAULT

SQL>

4. Example

  1 SQL> 
  2 SQL> 
  3 SQL> @?/rdbms/admin/awrrpt.sql
  4 
  5 Current Instance
  6 ~~~~~~~~~~~~~~~~
  7 
  8    DB Id    DB Name      Inst Num Instance
  9 ----------- ------------ -------- ------------
 10  1579433655 ORCL                1 ORCL
 11 
 12 
 13 Specify the Report Type
 14 ~~~~~~~~~~~~~~~~~~~~~~~
 15 Would you like an HTML report, or a plain text report?
 16 Enter 'html' for an HTML report, or 'text' for plain text
 17 Defaults to 'html'
 18 
 19 
 20 
 21 
 22 @?/rdbms/admin/awrrpt.sql
 23 
 24 @/data/app/oracle/product/11.2.0/rdbms/admin/awrrpt.sql
 25 @$ORACLE_HOME/rdbms/admin/awrrpt.sql
 26 
 27 exec dbms_workload_repository.create_snapshot();
 28 
 29 
 30 
 31 
 32 SQL> @?/rdbms/admin/awrrpt.sql
 33 
 34 Current Instance
 35 ~~~~~~~~~~~~~~~~
 36 
 37    DB Id    DB Name      Inst Num Instance
 38 ----------- ------------ -------- ------------
 39  1579433655 ORCL                1 ORCL
 40 
 41 
 42 Specify the Report Type
 43 ~~~~~~~~~~~~~~~~~~~~~~~
 44 Would you like an HTML report, or a plain text report?
 45 Enter 'html' for an HTML report, or 'text' for plain text
 46 Defaults to 'html'
 47 Enter value for report_type: 
 48 
 49 Type Specified:                  html
 50 
 51 
 52 Instances in this Workload Repository schema
 53 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 54 
 55    DB Id     Inst Num DB Name      Instance     Host
 56 ------------ -------- ------------ ------------ ------------
 57   1579433655        1 ORCL         orcl         oracledb
 58 * 1579433655        1 ORCL         ORCL         oracledb
 59 
 60 Using 1579433655 for database Id
 61 Using          1 for instance number
 62 
 63 
 64 Specify the number of days of snapshots to choose from
 65 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 66 Entering the number of days (n) will result in the most recent
 67 (n) days of snapshots being listed.  Pressing <return> without
 68 specifying a number lists all completed snapshots.
 69 
 70 
 71 Enter value for num_days: 1
 72 
 73 Listing the last day's Completed Snapshots
 74 
 75                                                         Snap
 76 Instance     DB Name        Snap Id    Snap Started    Level
 77 ------------ ------------ --------- ------------------ -----
 78 ORCL         ORCL              2330 27 Dec 2020 00:01      1
 79                                2331 27 Dec 2020 01:00      1
 80                                2332 27 Dec 2020 02:00      1
 81                                2333 27 Dec 2020 03:00      1
 82                                2334 27 Dec 2020 04:00      1
 83                                2335 27 Dec 2020 05:00      1
 84                                2336 27 Dec 2020 06:01      1
 85                                2337 27 Dec 2020 07:00      1
 86                                2338 27 Dec 2020 08:01      1
 87                                2339 27 Dec 2020 09:00      1
 88                                2340 27 Dec 2020 10:00      1
 89                                2341 27 Dec 2020 11:00      1
 90 
 91                                2342 27 Dec 2020 12:00      1
 92                                2343 27 Dec 2020 13:00      1
 93                                2344 27 Dec 2020 14:00      1
 94                                2345 27 Dec 2020 15:00      1
 95                                2346 27 Dec 2020 16:00      1
 96                                2347 27 Dec 2020 17:00      1
 97                                2348 27 Dec 2020 18:00      1
 98 
 99                                2349 27 Dec 2020 18:50      1
100                                2350 27 Dec 2020 18:51      1
101 
102 
103 
104 Specify the Begin and End Snapshot Ids
105 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
106 Enter value for begin_snap: 
107 
108 
109 
110 
111 
112 
113 
114 
115 
116 SQL> 
117 SQL> select * from dba_hist_wr_control;
118 
119       DBID SNAP_INTERVAL                                                                    RETENTION                                                                        TOPNSQL
120 ---------- -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- ----------
121 1579433655 +00000 01:00:00.0                                                                +00008 00:00:00.0                                                                DEFAULT
122 
123 SQL> 

 

上一篇:B站小甲鱼-迭代与递归写十进制转换为二进制的函数


下一篇:golang int64 json.Unmarshal精度丢失问题