AWR DB 보고서 생성

  • 필요 권한
    • SELECT ANY DICTIONARY 권한
    • SYS.DBMS_WORKLOAD_REPOSITORY 패키지의 실행 권한
스크립트설명
awrrpt.sql스크립트를 수행한 인스턴스의 AWR DB 보고서를 생성
awrrpti.sql데이터베이스 ID와 인스턴스 번호를 지정해서 AWR DB 보고서를 생성

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

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

   DB Id    DB Name      Inst Num Instance
----------- ------------ -------- ------------
 1490765173 ORATEST            1 ORATEST


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
------------ -------- ------------ ------------ ------------
  1490765173        1 ORATEST     ORATEST     dbhost1
* 1490765173        1 ORATEST     ORATEST     dbhost

Using 1490765173 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: 2

Listing the last 2 days of Completed Snapshots

                                                        Snap
Instance     DB Name        Snap Id    Snap Started    Level
------------ ------------ --------- ------------------ -----
ORATEST     ORATEST         38641 14 Dec 2012 00:00      1
                              38642 14 Dec 2012 00:20      1
                              38643 14 Dec 2012 00:40      1
                              ...

                                                        Snap
Instance     DB Name        Snap Id    Snap Started    Level
------------ ------------ --------- ------------------ -----
ORATEST     ORATEST         38697 14 Dec 2012 18:40      1
                              38698 14 Dec 2012 19:00      1
                              38699 14 Dec 2012 19:20      1
                              ...



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

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



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

Enter value for report_name: awr_report.txt

Using the report name awr_report.txt

  • 보고서를 대량으로 생성해야 한다면 DBMS_WORKLOAD_REPOSITORY 패키지를 사용하는 것이 편리
프로시저설명
AWR_REPORT_TEXT텍스트 형식으로 AWR DB 보고서를 생성
AWR_REPOST_HTML웹 문서 형식으로 DB 보고서를 생성

SELECT OUTPUT
FROM  TABLE(DBMS_WORKLOAD_REPOSITORY.AWR_REPORT_TEXT(
                      :DBID, :INST_ID, :BEGIN_SNAP, :END_SNAP));

항목설명
:DBID데이터베이스 ID
:INST_ID인스턴스 번호
:BEGIN_SNAP시작 스냅 ID
:END_SNAP종료 스냅 ID
  • 쉘 프로그램을 작성하여 보다 편리하게 작업을 수행할 수 있다. (p.50~52참고)