Vous êtes sur la page 1sur 19

AWR Reports in RAC

Wissem EL KHLIFI

www.oracle.class.com

1- AWR Concept:
In this post, I am going to show you how to generate AWR reports for Real Application Clusters (RAC) environment.
AWR was first introduced in 10g version of Oracle as a repository of all important statistics for an Oracle database. At a regular
intervals, Oracle makes a snapshots of those vital statistics and stores them in SYSAUX tablespace. In 11g version, These
snapshots are retained for 8 days. It is the MMON background process who is responsible of AWR collection.
AWR scripts allow you to generate the reports in HTML or TEXT formats. These reports allow you to analyze the workload of
the database at a given intervals. Oracle extends the AWR tool for RAC databases by adding the possibility to generate
snapshots reports against the whole cluster database, some database instances of the cluster database, a specific database
instance of the cluster database, statistics for a specific select query. In the following sections, I am going to show you how to
generate AWR reports for each case.
2- Generate AWR reports for the current Instance:
Run the awrrpt script from $ORACLE_HOME/rdbms/admin/ as a sys user. The script will ask you for the output format of the
report (HTML or TEXT), the the number of days (n) will result in the most recent (n) days of snapshots being listed (If you hit
enter, you will get all the available snapshots listed), begin and end snapshot interval Ids
In my Example below, this is the output of a six node RAC database.
-bash-3.2$ cd /opt/app/oracle/product/11.2.0/db_1/rdbms/admin/
-bash-3.2$
-bash-3.2$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.2.0 Production on Wed Sep 28 13:04:54 2011
Copyright (c) 1982, 2010, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
With the Real Application Clusters and Automatic Storage Management options
SQL> @awrrpt
Current Instance
~~~~~~~~~~~~~~~~
DB Id DB Name
Inst Num Instance
----------- ------------ -------- -----------1399294885 ddb
1 ddb1
Specify the Report Type
~~~~~~~~~~~~~~~~~~~~~~~
Wissem EL KHLIFI

www.oracle.class.com

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'
Enter value for report_type: html
Type Specified: html
Instances in this Workload Repository schema
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
DB Id Inst Num DB Name
Instance Host
------------ -------- ------------ ------------ -----------1399294885
6 ddb
ddb6
srvdb06
1399294885
4 ddb
ddb4
srvdb04
1399294885
2 ddb
ddb2
srvdb02
1399294885
5 ddb
ddb5
srvdb05
* 1399294885
1 ddb
ddb1
srvdb01
1399294885
3 ddb
ddb3
srvdb03
Using 1399294885 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.
Enter value for num_days:
Snap
Instance DB Name
Snap Id Snap Started Level
------------ ------------ --------- ------------------ ----ddb1
ddb
286 26 Sep 2011 23:00
1
287 27 Sep 2011 00:00
1
288 27 Sep 2011 01:00
1
289 27 Sep 2011 02:00
1
290 27 Sep 2011 03:00
1
291 27 Sep 2011 04:00
1
292 27 Sep 2011 05:00
1
293 27 Sep 2011 06:00
1
294 27 Sep 2011 07:00
1
295 27 Sep 2011 08:00
1
296 27 Sep 2011 09:00
1
Wissem EL KHLIFI

www.oracle.class.com

297 27 Sep 2011 10:00


298 27 Sep 2011 11:00
299 27 Sep 2011 12:00
300 27 Sep 2011 13:00
301 27 Sep 2011 14:00
302 27 Sep 2011 15:00
303 27 Sep 2011 16:00
304 27 Sep 2011 17:00
305 27 Sep 2011 18:00
306 27 Sep 2011 19:00
307 27 Sep 2011 20:00
308 27 Sep 2011 21:00
309 27 Sep 2011 22:00
310 27 Sep 2011 23:00
311 28 Sep 2011 00:00
312 28 Sep 2011 01:00
313 28 Sep 2011 02:00
314 28 Sep 2011 03:00
315 28 Sep 2011 04:00
316 28 Sep 2011 05:00
317 28 Sep 2011 06:00
318 28 Sep 2011 07:00
319 28 Sep 2011 08:00
320 28 Sep 2011 09:00
321 28 Sep 2011 10:00
322 28 Sep 2011 11:00
323 28 Sep 2011 12:00
324 28 Sep 2011 13:00

1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1

Specify the Begin and End Snapshot Ids


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Enter value for begin_snap: 323
Begin Snapshot Id specified: 323
Enter value for end_snap: 324
End Snapshot Id specified: 324

Specify the Report Name


~~~~~~~~~~~~~~~~~~~~~~~
The default report file name is awrrpt_1_323_324.html. To use this name,
press <return> to continue, otherwise enter an alternative.
Enter value for report_name:
...
Wissem EL KHLIFI

www.oracle.class.com

...
End of Report
</body></html>
Report written to awrrpt_1_323_324.html
SQL>
3- Generate AWR reports for any instance in the cluster:
Run the awrrpti script from $ORACLE_HOME/rdbms/admin/ as a sys user. The script will ask you for the output format of the
report (HTML or TEXT), the instance number, the the number of days (n) will result in the most recent (n) days of snapshots
being listed (If you hit enter, you will get all the available snapshots listed), begin and end snapshot interval Ids
In the example below, I am generating a report for the instance number 5, which is ddb5.
-bash-3.2$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.2.0 Production on Wed Sep 28 13:09:48 2011
Copyright (c) 1982, 2010, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
With the Real Application Clusters and Automatic Storage Management options
SQL> @awrrpti
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'
Enter value for report_type: text
Type Specified: text
Instances in this Workload Repository schema
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
DB Id Inst Num DB Name
Instance Host
------------ -------- ------------ ------------ -----------1399294885
6 ddb
ddb6
srvdb06
1399294885
4 ddb
ddb4
srvdb04
1399294885
2 ddb
ddb2
srvdb02
1399294885
5 ddb
ddb5
srvdb05
* 1399294885
1 ddb
ddb1
srvdb01
Wissem EL KHLIFI

www.oracle.class.com

1399294885

3 ddb

ddb3

srvdb03

Enter value for dbid: 1399294885


Using 1399294885 for database Id
Enter value for inst_num: 5
Using 5 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.
Enter value for num_days:
Snap
Instance DB Name
Snap Id Snap Started Level
------------ ------------ --------- ------------------ ----ddb5
ddb
230 24 Sep 2011 15:00
1
231 24 Sep 2011 16:00
1
232 24 Sep 2011 17:00
1
233 24 Sep 2011 18:00
1
234 24 Sep 2011 19:00
1
235 24 Sep 2011 20:00
1
236 24 Sep 2011 21:00
1
237 24 Sep 2011 22:00
1
238 24 Sep 2011 23:00
1
239 25 Sep 2011 00:00
1
240 25 Sep 2011 01:00
1
241 25 Sep 2011 02:00
1
242 25 Sep 2011 03:00
1
243 25 Sep 2011 04:00
1
244 25 Sep 2011 05:00
1
245 25 Sep 2011 06:00
1
246 25 Sep 2011 07:00
1
247 25 Sep 2011 08:00
1
248 25 Sep 2011 09:00
1
249 25 Sep 2011 10:00
1
250 25 Sep 2011 11:00
1
251 25 Sep 2011 12:00
1
252 25 Sep 2011 13:00
1
253 25 Sep 2011 14:00
1
254 25 Sep 2011 15:00
1
255 25 Sep 2011 16:00
1
256 25 Sep 2011 17:00
1
257 25 Sep 2011 18:00
1
Wissem EL KHLIFI

www.oracle.class.com

258 25 Sep 2011 19:00


259 25 Sep 2011 20:00
260 25 Sep 2011 21:00
261 25 Sep 2011 22:00
262 25 Sep 2011 23:00
263 26 Sep 2011 00:00
264 26 Sep 2011 01:00
265 26 Sep 2011 02:00
266 26 Sep 2011 03:00
267 26 Sep 2011 04:00
268 26 Sep 2011 05:00
269 26 Sep 2011 06:00
270 26 Sep 2011 07:00
271 26 Sep 2011 08:00
272 26 Sep 2011 09:00
273 26 Sep 2011 10:00
274 26 Sep 2011 11:00
275 26 Sep 2011 12:00
276 26 Sep 2011 13:00
277 26 Sep 2011 14:00
278 26 Sep 2011 15:00
279 26 Sep 2011 16:00
280 26 Sep 2011 17:00
281 26 Sep 2011 18:00
282 26 Sep 2011 19:00
283 26 Sep 2011 20:00
284 26 Sep 2011 21:00
285 26 Sep 2011 22:00
Snap
Instance DB Name
Snap Id Snap Started
------------ ------------ --------- ------------------ ----ddb5
ddb
286 26 Sep 2011 23:00
287 27 Sep 2011 00:00
288 27 Sep 2011 01:00
289 27 Sep 2011 02:00
290 27 Sep 2011 03:00
291 27 Sep 2011 04:00
292 27 Sep 2011 05:00
293 27 Sep 2011 06:00
294 27 Sep 2011 07:00
295 27 Sep 2011 08:00
296 27 Sep 2011 09:00
297 27 Sep 2011 10:00
298 27 Sep 2011 11:00
299 27 Sep 2011 12:00
300 27 Sep 2011 13:00
301 27 Sep 2011 14:00
Wissem EL KHLIFI

1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
Level
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
www.oracle.class.com

302 27 Sep 2011 15:00


303 27 Sep 2011 16:00
304 27 Sep 2011 17:00
305 27 Sep 2011 18:00
306 27 Sep 2011 19:00
307 27 Sep 2011 20:00
308 27 Sep 2011 21:00
309 27 Sep 2011 22:00
310 27 Sep 2011 23:00
311 28 Sep 2011 00:00
312 28 Sep 2011 01:00
313 28 Sep 2011 02:00
314 28 Sep 2011 03:00
315 28 Sep 2011 04:00
316 28 Sep 2011 05:00
317 28 Sep 2011 06:00
318 28 Sep 2011 07:00
319 28 Sep 2011 08:00
320 28 Sep 2011 09:00
321 28 Sep 2011 10:00
322 28 Sep 2011 11:00
323 28 Sep 2011 12:00
324 28 Sep 2011 13:00

1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1

Specify the Begin and End Snapshot Ids


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Enter value for begin_snap: 323
Begin Snapshot Id specified: 323
Enter value for end_snap: 324
Specify the Report Name
~~~~~~~~~~~~~~~~~~~~~~~
The default report file name is awrrpt_5_323_324.txt. To use this name,
press <return> to continue, otherwise enter an alternative.
Enter value for report_name:
...
...
...
Receive Receive Receive Buffer Frame
Mbytes/sec Errors Dropped Overrun Errors
----------- -------- -------- -------- -------bond0:1
169.254.37.89 NO
Wissem EL KHLIFI

www.oracle.class.com

.00
0
0
0
0
.00
0
0
0
0
------------------------------------------------------------Dynamic Remastering Stats

DB/Inst: ddb/ddb5 Snaps: 323-324

No data exists for this section of the report.


------------------------------------------------------------End of Report
Report written to awrrpt_5_323_324.txt
SQL>

4- Generate AWR Cluster aggregated statistics from all the instances:


Run the awrgrpt script from $ORACLE_HOME/rdbms/admin/ as a sys user. The script will ask you for the output format of the
report (HTML or TEXT), the the number of days (n) will result in the most recent (n) days of snapshots being listed (If you hit
enter, you will get all the available snapshots listed), begin and end snapshot interval Ids
This report shows the aggregated statistics from the whole cluster database; also, described as a global AWR cluster report:
-bash-3.2$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.2.0 Production on Wed Sep 28 13:13:49 2011
Copyright (c) 1982, 2010, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
With the Real Application Clusters and Automatic Storage Management options
SQL> @awrgrpt.sql
Current Database
~~~~~~~~~~~~~~~~
DB Id DB Name
----------- -----------1399294885 ddb
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'
Wissem EL KHLIFI

www.oracle.class.com

Enter value for report_type: text


Type Specified: text
Instances in this Workload Repository schema
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
DB Id
INSTT_NUM DB Name
INSTT_NAME
Host
------------ ---------- ------------ ---------------- -----------* 1399294885
6 ddb
ddb6
srvdb06
* 1399294885
5 ddb
ddb5
srvdb05
* 1399294885
2 ddb
ddb2
srvdb02
* 1399294885
1 ddb
ddb1
srvdb01
* 1399294885
3 ddb
ddb3
srvdb03
* 1399294885
4 ddb
ddb4
srvdb04
Using 1399294885 for database Id
Using instances ALL (default 'ALL')
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.
Enter value for num_days:
Snap
DB Name
Snap Id Snap Started
------------ --------- ------------------ ----ddb
287 27 Sep 2011 00:00
288 27 Sep 2011 01:00
289 27 Sep 2011 02:00
290 27 Sep 2011 03:00
291 27 Sep 2011 04:00
292 27 Sep 2011 05:00
293 27 Sep 2011 06:00
294 27 Sep 2011 07:00
295 27 Sep 2011 08:00
296 27 Sep 2011 09:00
297 27 Sep 2011 10:00
298 27 Sep 2011 11:00
299 27 Sep 2011 12:00
300 27 Sep 2011 13:00
301 27 Sep 2011 14:00
302 27 Sep 2011 15:00
303 27 Sep 2011 16:00
Wissem EL KHLIFI

Level
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
www.oracle.class.com

304 27 Sep 2011 17:00


305 27 Sep 2011 18:00
306 27 Sep 2011 19:00
307 27 Sep 2011 20:00
308 27 Sep 2011 21:00
309 27 Sep 2011 22:00
310 27 Sep 2011 23:00
311 28 Sep 2011 00:00
312 28 Sep 2011 01:00
313 28 Sep 2011 02:00
314 28 Sep 2011 03:00
315 28 Sep 2011 04:00
316 28 Sep 2011 05:00
317 28 Sep 2011 06:00
318 28 Sep 2011 07:00
319 28 Sep 2011 08:00
320 28 Sep 2011 09:00
321 28 Sep 2011 10:00
322 28 Sep 2011 11:00
323 28 Sep 2011 12:00
324 28 Sep 2011 13:00

1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1

Specify the Begin and End Snapshot Ids


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Enter value for begin_snap: 323
Begin Snapshot Id specified: 323
Enter value for end_snap: 324
End Snapshot Id specified: 324

Specify the Report Name


~~~~~~~~~~~~~~~~~~~~~~~
The default report file name is awrrpt_rac_323_324.txt. To use this name,
press <return> to continue, otherwise enter an alternative.
Enter value for report_name:
...
....
.....
End of Report
Report written to awrrpt_rac_323_324.txt
SQL>
5- Generate AWR Global Cluster Difference Report:
Wissem EL KHLIFI

www.oracle.class.com

Run the awrgdrpt.sql script from $ORACLE_HOME/rdbms/admin/ as a sys user. The script will ask you for the output format of
the report (HTML or TEXT), the the number of days (n) will result in the most recent (n) days of snapshots being listed (If you
hit enter, you will get all the available snapshots listed), begin and end snapshot interval Ids of the first and second pair diff
intervals
This report compares the statistic results of differences between two different snapshot intervals, for the whole cluster database.
-bash-3.2$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.2.0 Production on Wed Sep 28 13:16:36 2011
Copyright (c) 1982, 2010, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
With the Real Application Clusters and Automatic Storage Management options
SQL> @awrgdrpt.sql
Current Instance
~~~~~~~~~~~~~~~~
DB Id
DB Id DB Name
----------- ----------- -----------1399294885 1399294885 ddb
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'
Enter value for report_type: text
Type Specified: text
Instances in this Workload Repository schema
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
DB Id Inst Num DB Name
Instance Host
------------ -------- ------------ ------------ -----------1399294885
6 ddb
ddb6
srvdb06
1399294885
4 ddb
ddb4
srvdb04
1399294885
2 ddb
ddb2
srvdb02
1399294885
5 ddb
ddb5
srvdb05
* 1399294885
1 ddb
ddb1
srvdb01
Wissem EL KHLIFI

www.oracle.class.com

1399294885

3 ddb

ddb3

srvdb03

Database Id and Instance Number for the First Pair of Snapshots


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Using 1399294885 for Database Id for the first pair of snapshots
Using instances ALL 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.
Enter value for num_days: 2
Listing the last 2 days of Completed Snapshots
Snap
DB Name
Snap Id Snap Started
------------ --------- ------------------ ----ddb
287 27 Sep 2011 00:00
288 27 Sep 2011 01:00
289 27 Sep 2011 02:00
290 27 Sep 2011 03:00
291 27 Sep 2011 04:00
292 27 Sep 2011 05:00
293 27 Sep 2011 06:00
294 27 Sep 2011 07:00
295 27 Sep 2011 08:00
296 27 Sep 2011 09:00
297 27 Sep 2011 10:00
298 27 Sep 2011 11:00
299 27 Sep 2011 12:00
300 27 Sep 2011 13:00
301 27 Sep 2011 14:00
302 27 Sep 2011 15:00
303 27 Sep 2011 16:00
304 27 Sep 2011 17:00
305 27 Sep 2011 18:00
306 27 Sep 2011 19:00
307 27 Sep 2011 20:00
308 27 Sep 2011 21:00
309 27 Sep 2011 22:00
310 27 Sep 2011 23:00
311 28 Sep 2011 00:00
312 28 Sep 2011 01:00
313 28 Sep 2011 02:00
Wissem EL KHLIFI

Level
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
www.oracle.class.com

314 28 Sep 2011 03:00


315 28 Sep 2011 04:00
316 28 Sep 2011 05:00
317 28 Sep 2011 06:00
318 28 Sep 2011 07:00
319 28 Sep 2011 08:00
320 28 Sep 2011 09:00
321 28 Sep 2011 10:00
322 28 Sep 2011 11:00
323 28 Sep 2011 12:00
324 28 Sep 2011 13:00

1
1
1
1
1
1
1
1
1
1
1

Specify the First Pair of Begin and End Snapshot Ids


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Enter value for begin_snap: 323
First Begin Snapshot Id specified: 323
Enter value for end_snap: 324
First End Snapshot Id specified: 324

Instances in this Workload Repository schema


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
DB Id Inst Num DB Name
Instance Host
------------ -------- ------------ ------------ -----------1399294885
6 ddb
ddb6
srvdb06
1399294885
4 ddb
ddb4
srvdb04
1399294885
2 ddb
ddb2
srvdb02
1399294885
5 ddb
ddb5
srvdb05
* 1399294885
1 ddb
ddb1
srvdb01
1399294885
3 ddb
ddb3
srvdb03
INSTNUM1
-------------------------------------------------------------------------------Database Id and Instance Number for the Second Pair of Snapshots
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Using 1399294885 for Database Id for the second pair of snapshots
Using instances ALL for the second pair of snapshots
Specify the number of days of snapshots to choose from
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Wissem EL KHLIFI

www.oracle.class.com

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.
Enter value for num_days2: 4
Listing the last 2 days of Completed Snapshots
Snap
DB Name
Snap Id Snap Started
------------ --------- ------------------ ----ddb
287 27 Sep 2011 00:00
288 27 Sep 2011 01:00
289 27 Sep 2011 02:00
290 27 Sep 2011 03:00
291 27 Sep 2011 04:00
292 27 Sep 2011 05:00
293 27 Sep 2011 06:00
294 27 Sep 2011 07:00
295 27 Sep 2011 08:00
296 27 Sep 2011 09:00
297 27 Sep 2011 10:00
298 27 Sep 2011 11:00
299 27 Sep 2011 12:00
300 27 Sep 2011 13:00
301 27 Sep 2011 14:00
302 27 Sep 2011 15:00
303 27 Sep 2011 16:00
304 27 Sep 2011 17:00
305 27 Sep 2011 18:00
306 27 Sep 2011 19:00
307 27 Sep 2011 20:00
308 27 Sep 2011 21:00
309 27 Sep 2011 22:00
310 27 Sep 2011 23:00
311 28 Sep 2011 00:00
312 28 Sep 2011 01:00
313 28 Sep 2011 02:00
314 28 Sep 2011 03:00
315 28 Sep 2011 04:00
316 28 Sep 2011 05:00
317 28 Sep 2011 06:00
318 28 Sep 2011 07:00
319 28 Sep 2011 08:00
320 28 Sep 2011 09:00
321 28 Sep 2011 10:00
322 28 Sep 2011 11:00
323 28 Sep 2011 12:00
Wissem EL KHLIFI

Level
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
www.oracle.class.com

324 28 Sep 2011 13:00

Specify the First Pair of Begin and End Snapshot Ids


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Enter value for begin_snap2: 321
First Begin Snapshot Id specified: 321
Enter value for end_snap2: 322
First End Snapshot Id specified: 322

Specify the Report Name


~~~~~~~~~~~~~~~~~~~~~~~
The default report file name is awrracdiff_1st_323_2nd_321.txt To use this name,
press <return> to continue, otherwise enter an alternative.
Enter value for report_name:
Using the report name awrracdiff_1st_323_2nd_321.txt
....
....
.....
-------------------------------------------------------------End of Report
Report written to awrracdiff_1st_323_2nd_321.txt
SQL> SQL>
6- Generate AWR Report Single Select Statement:
Run the awrsqrpt.sql script from $ORACLE_HOME/rdbms/admin/ as a sys user. The script will ask you for the output format of
the report (HTML or TEXT), the the number of days (n) will result in the most recent (n) days of snapshots being listed (If you
hit enter, you will get all the available snapshots listed), begin and end snapshot interval Ids intervals and the SQL_ID for the
specific SELECT statement
SQL> select SQL_ID from V$SQLAREA where rownum =1 ;
SQL_ID
------------4qm8a3w6a1rfd
SQL>
Wissem EL KHLIFI

www.oracle.class.com

SQL> @awrsqrpt.sql
Current Instance
~~~~~~~~~~~~~~~~
DB Id DB Name
Inst Num Instance
----------- ------------ -------- -----------1399294885 ddb
1 ddb1
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'
Enter value for report_type: text
Type Specified: text
Instances in this Workload Repository schema
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
DB Id Inst Num DB Name
Instance Host
------------ -------- ------------ ------------ -----------1399294885
6 ddb
ddb6
srvdb06
1399294885
4 ddb
ddb4
srvdb04
1399294885
2 ddb
ddb2
srvdb02
1399294885
5 ddb
ddb5
srvdb05
* 1399294885
1 ddb
ddb1
srvdb01
1399294885
3 ddb
ddb3
srvdb03
Using 1399294885 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.
Enter value for num_days:
Snap
Instance DB Name
Snap Id Snap Started
------------ ------------ --------- ------------------ ----Wissem EL KHLIFI

Level

www.oracle.class.com

ddb1

ddb

286 26 Sep 2011 23:00


287 27 Sep 2011 00:00
288 27 Sep 2011 01:00
289 27 Sep 2011 02:00
290 27 Sep 2011 03:00
291 27 Sep 2011 04:00
292 27 Sep 2011 05:00
293 27 Sep 2011 06:00
294 27 Sep 2011 07:00
295 27 Sep 2011 08:00
296 27 Sep 2011 09:00
297 27 Sep 2011 10:00
298 27 Sep 2011 11:00
299 27 Sep 2011 12:00
300 27 Sep 2011 13:00
301 27 Sep 2011 14:00
302 27 Sep 2011 15:00
303 27 Sep 2011 16:00
304 27 Sep 2011 17:00
305 27 Sep 2011 18:00
306 27 Sep 2011 19:00
307 27 Sep 2011 20:00
308 27 Sep 2011 21:00
309 27 Sep 2011 22:00
310 27 Sep 2011 23:00
311 28 Sep 2011 00:00
312 28 Sep 2011 01:00
313 28 Sep 2011 02:00
314 28 Sep 2011 03:00
315 28 Sep 2011 04:00
316 28 Sep 2011 05:00
317 28 Sep 2011 06:00
318 28 Sep 2011 07:00
319 28 Sep 2011 08:00
320 28 Sep 2011 09:00
321 28 Sep 2011 10:00
322 28 Sep 2011 11:00
323 28 Sep 2011 12:00
324 28 Sep 2011 13:00

1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1

Specify the Begin and End Snapshot Ids


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Enter value for begin_snap: 319
Begin Snapshot Id specified: 319
Enter value for end_snap: 324
Wissem EL KHLIFI

www.oracle.class.com

End Snapshot Id specified: 324

Specify the SQL Id


~~~~~~~~~~~~~~~~~~
Enter value for sql_id: 4qm8a3w6a1rfd
.....
7- License:
AWR tool is part of the diagnostic pack option which needs an Oracle license. The substitute of the AWR report in the case you
are not licensed to use AWR tool is the Statspack tool which is detailed in my previous post: Statspack in RAC
(http://www.oracle-class.com/?p=2384).
In 11g, if you are not licensed to use the diagnostic pack tool you have to disable the option by setting the
control_management_pack_access to NONE;
alter system set control_management_pack_access='none';
In 10g version., you can disable the AWR tool following the MOS ID: 436386.1 which provides a script to disable the AWR
package.
To disable database option, you can use chopt command line; for example; to disable partitioning option, you can run the following
command from ALL nodes of the cluster as oracle database home owner (usually called oracle user):
-bash-3.2$ chopt disable partitioning
Writing to /opt/app/oracle/product/11.2.0/db_1/install/disable_partitioning.log...
/usr/bin/make -f /opt/app/oracle/product/11.2.0/db_1/rdbms/lib/ins_rdbms.mk part_off
ORACLE_HOME=/opt/app/oracle/product/11.2.0/db_1
/usr/bin/make -f /opt/app/oracle/product/11.2.0/db_1/rdbms/lib/ins_rdbms.mk ioracle
ORACLE_HOME=/opt/app/oracle/product/11.2.0/db_1

Wissem EL KHLIFI

www.oracle.class.com

Vous aimerez peut-être aussi