28 October 2015

Get AWR, ADDR, and ASH reports using SQL scripts

Get AWR, ADDR, and ASH reports from SQL scripts
One way to identify the causes of poor performance in the database is to review AWR, ADDR, and
ASH reports. They should be for a period of 60 or more minutes, covering the poor performance
period. The report gets generated in the same directory where you have initiated the sqlplus session.

To generate the AWR report, execute the following script and select two snapshots:

SQL> @$ORACLE_HOME/rdbms/admin/awrrpt.sql

>> Choose the TXT format or the HTML format.

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:


. To generate the ADDM report, execute:

SQL> @$ORACLE_HOME/rdbms/admin/addmrpt

>> Choose the TXT format or the HTML format.

Specify the Begin and End Snapshot Ids
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Enter value for begin_snap: 46086
Begin Snapshot Id specified: 46086

Enter value for end_snap: 46087
End   Snapshot Id specified: 46087



Specify the Report Name
~~~~~~~~~~~~~~~~~~~~~~~
The default report file name is addmrpt_1_46086_46087.txt.  To use this name,
press to continue, otherwise enter an alternative.


. To generate the ASH report, execute:

SQL> @$ORACLE_HOME/rdbms/admin/ashrpt.sql

>> Choose the TXT format or the HTML format.

Specify the Report Type
~~~~~~~~~~~~~~~~~~~~~~~
Enter 'html' for an HTML report, or 'text' for plain text
Defaults to 'html'
Enter value for report_type:

Defaults to current database

Using database id: 457724301

Defaults to current instance

Using instance number: 1


ASH Samples in this Workload Repository schema
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Oldest ASH sample available:  20-Oct-15 12:50:18   [  10787 mins in the past]
Latest ASH sample available:  28-Oct-15 00:36:05   [      1 mins in the past]


Specify the timeframe to generate the ASH report
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Enter begin time for report:

--    Valid input formats:
--      To specify absolute begin time:
--        [MM/DD[/YY]] HH24:MI[:SS]
--        Examples: 02/23/03 14:30:15
--                  02/23 14:30:15
--                  14:30:15
--                  14:30
--      To specify relative begin time: (start with '-' sign)
--        -[HH24:]MI
--        Examples: -1:15  (SYSDATE - 1 Hr 15 Mins)
--                  -25    (SYSDATE - 25 Mins)

Defaults to -15 mins
Enter value for begin_time:


Just keep pressing 'ENTER' for passing default values.

No comments:

Post a Comment