AWR-比较两个阶段性能

 实际环境中,需要比较两个不同时间点的性能,故生产两个时间点的ARW并做些比较!

 

 

 

示例:产生整个数据库的AWR报告。本例中,Oracle的主目录是
S:\app\Administrator\product\11.2.0\dbhome_1

运行脚本awrrpt.sql。

SQL> @?/rdbms/admin/awrddrpt.sql

Current Instance
~~~~~~~~~~~~~~~~

   DB Id       DB Id    DB Name      Inst Num Inst Num Instance
----------- ----------- ------------ -------- -------- ------------
 1337234614  1337234614 ORCL                1        1 orcl


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 的值:  html

Type Specified:  html


Instances in this Workload Repository schema
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

   DB Id     Inst Num DB Name      Instance     Host
------------ -------- ------------ ------------ ------------
* 1337234614        1 ORCL         orcl         JINRI185

Database Id and Instance Number for the First Pair of Snapshots
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Using 1337234614 for Database Id for the first pair of snapshots
Using          1 for Instance Number for the first pair of snapshots


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 的值:  2

Listing the last 2 days of Completed Snapshots

                                                        Snap
Instance     DB Name        Snap Id    Snap Started    Level
------------ ------------ --------- ------------------ -----
orcl         ORCL              1136 24 4月  2013 00:00     1
                               1137 24 4月  2013 01:00     1
                               1138 24 4月  2013 02:00     1
                               1139 24 4月  2013 03:00     1
                               1140 24 4月  2013 04:00     1
                               1141 24 4月  2013 05:00     1
                               1142 24 4月  2013 06:00     1
                               1143 24 4月  2013 07:00     1
                               1144 24 4月  2013 08:00     1
                               1145 24 4月  2013 09:00     1
                               1146 24 4月  2013 10:00     1
                               1147 24 4月  2013 11:00     1
                               1148 24 4月  2013 12:00     1
                               1149 24 4月  2013 13:00     1
                               1150 24 4月  2013 14:00     1
                               1151 24 4月  2013 15:00     1
                               1152 24 4月  2013 16:00     1
                               1153 24 4月  2013 17:00     1
                               1154 24 4月  2013 18:00     1
                               1155 24 4月  2013 19:00     1
                               1156 24 4月  2013 20:00     1
                               1157 24 4月  2013 21:00     1
                               1158 24 4月  2013 22:00     1
                               1159 24 4月  2013 23:00     1
                               1160 25 4月  2013 00:00     1
                               1161 25 4月  2013 01:00     1
                               1162 25 4月  2013 02:00     1
                               1163 25 4月  2013 03:00     1
                               1164 25 4月  2013 04:00     1
                               1165 25 4月  2013 05:00     1
                               1166 25 4月  2013 06:00     1
                               1167 25 4月  2013 07:00     1
                               1168 25 4月  2013 08:00     1
                               1169 25 4月  2013 09:00     1
                               1170 25 4月  2013 10:00     1
                               1171 25 4月  2013 11:00     1
                               1172 25 4月  2013 12:00     1
                               1173 25 4月  2013 13:00     1
                               1174 25 4月  2013 14:00     1
                               1175 25 4月  2013 15:00     1

 

Specify the First Pair of Begin and End Snapshot Ids
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

输入 begin_snap 的值:  1144
First Begin Snapshot Id specified: 1144

输入 end_snap 的值:  1145
First End   Snapshot Id specified: 1145

 


Instances in this Workload Repository schema
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

   DB Id     Inst Num DB Name      Instance     Host
------------ -------- ------------ ------------ ------------
* 1337234614        1 ORCL         orcl         JINRI185

 


Database Id and Instance Number for the Second Pair of Snapshots
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Using 1337234614 for Database Id for the second pair of snapshots
Using          1 for Instance Number for the second pair of snapshots


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_days2 的值:  2


Listing the last 2 days of Completed Snapshots

                                                        Snap
Instance     DB Name        Snap Id    Snap Started    Level
------------ ------------ --------- ------------------ -----
orcl         ORCL              1136 24 4月  2013 00:00     1
                               1137 24 4月  2013 01:00     1
                               1138 24 4月  2013 02:00     1
                               1139 24 4月  2013 03:00     1
                               1140 24 4月  2013 04:00     1
                               1141 24 4月  2013 05:00     1
                               1142 24 4月  2013 06:00     1
                               1143 24 4月  2013 07:00     1
                               1144 24 4月  2013 08:00     1
                               1145 24 4月  2013 09:00     1
                               1146 24 4月  2013 10:00     1
                               1147 24 4月  2013 11:00     1
                               1148 24 4月  2013 12:00     1
                               1149 24 4月  2013 13:00     1
                               1150 24 4月  2013 14:00     1
                               1151 24 4月  2013 15:00     1
                               1152 24 4月  2013 16:00     1
                               1153 24 4月  2013 17:00     1
                               1154 24 4月  2013 18:00     1
                               1155 24 4月  2013 19:00     1
                               1156 24 4月  2013 20:00     1
                               1157 24 4月  2013 21:00     1
                               1158 24 4月  2013 22:00     1
                               1159 24 4月  2013 23:00     1
                               1160 25 4月  2013 00:00     1
                               1161 25 4月  2013 01:00     1
                               1162 25 4月  2013 02:00     1
                               1163 25 4月  2013 03:00     1
                               1164 25 4月  2013 04:00     1
                               1165 25 4月  2013 05:00     1
                               1166 25 4月  2013 06:00     1
                               1167 25 4月  2013 07:00     1
                               1168 25 4月  2013 08:00     1
                               1169 25 4月  2013 09:00     1
                               1170 25 4月  2013 10:00     1
                               1171 25 4月  2013 11:00     1
                               1172 25 4月  2013 12:00     1
                               1173 25 4月  2013 13:00     1
                               1174 25 4月  2013 14:00     1
                               1175 25 4月  2013 15:00     1

 

Specify the Second Pair of Begin and End Snapshot Ids
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


输入 begin_snap2 的值:  1168
Second Begin Snapshot Id specified: 1168

输入 end_snap2 的值:  1169


Specify the Report Name
~~~~~~~~~~~~~~~~~~~~~~~
The default report file name is awrdiff_1_1144_1_1168.html  To use this name,
press <return> to continue, otherwise enter an alternative.

输入 report_name 的值:  s:\testocp.html

Using the report name s:\testocp.html


去路径s:\testocp.html查看报表即可.

 

 

 

指定报告的名字。

输入 report_name 的值:  s:/ocpyang.html

 //******** 常见错误

注意:输入报告名后回车出现 ORA-00904:: invalid identified value
解决办法:用sys用户来执行或者对用户进行授权 grant all on dbms_workload_repository to perfstat;

**********//

 

@?/rdbms/admin/

你可能感兴趣的:(AWR-比较两个阶段性能)