프린트 하기

내맘대로긍정이 알려주는

Oracle 23ai 신기능
무료 세미나 발표자료

다운로드 trending_flat

OS환경 : Oracle Linux 7.6 (64bit)

 

DB 환경 : Oracle Database 19.3.0.0

 

방법 : 오라클 19c AWR 리포트 수집 방법

오라클 19c AWR 란 ( https://positivemh.tistory.com/1013 )

 

 

AWR 리포트는 3가지 타입으로 출력할수 있음
'html' HTML format (default)
'text' Text format
'active-html' Includes Performance Hub active report
html 타입이 기본값이고 text 형식으로도 출력이 가능함
그리고 active-html 이라는 타입도 존재하는데 이 타입을 선택하여 awr 리포트를 출력하면 awr 리포트 최하단에
oracle em(enterprise manager)에서 보는것처럼 Performance Hub Active Report gui 페이지가 같이 저장됨

 

 

이 게시글에선 AWR 리포트를 수집하는 방법을 설명함
sqlplus 접속

1
$ sqlplus / as sysdba

 

 

AWR 리포트 수집

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
순서1. AWR 리포트 출력용 sql 실행
SQL> @?/rdbms/admin/awrrpt.sql
 
Specify the Report Type
~~~~~~~~~~~~~~~~~~~~~~~
AWR reports can be generated in the following formats.  Please enter the
name of the format at the prompt.  Default value is 'html'.
 
'html'          HTML format (default)
'text'          Text format
'active-html'   Includes Performance Hub active report
 
순서2. AWR 리포트 출력 타입 입력, 엔터 입력시 기본값인 html 타입으로 선택됨
Enter value for report_type: html (AWR 리포트 출력 타입 입력)
 
Type Specified:  html
 
Current Instance
~~~~~~~~~~~~~~~~
DB Id          DB Name        Inst Num       Instance       Container Name
-------------- -------------- -------------- -------------- --------------
 3209222764     ORACLE19                    1 oracle19       oracle19
 
 
Instances in this Workload Repository schema
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  DB Id      Inst Num   DB Name      Instance     Host
------------ ---------- ---------    ----------   ------
* 3209222764     1      ORACLE19     oracle19     oel7
 
Using 3209222764 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  without
specifying a number lists all completed snapshots.
 
순서3. AWR 스냅샷을 확인할 일수 입력
Enter value for num_days: 2 (AWR 스냅샷을 확인할 일수 입력)
 
Listing the last 2 days of Completed Snapshots
Instance     DB Name      Snap Id       Snap Started    Snap Level
------------ ------------ ---------- ------------------ ----------
 
oracle19     ORACLE19            25  29 Jan 2024 10:50    1
                                 26  29 Jan 2024 12:00    1
                                 27  29 Jan 2024 13:00    1
                                 28  29 Jan 2024 14:00    1
                                 29  29 Jan 2024 15:00    1
                                 30  29 Jan 2024 16:00    1
                                 31  29 Jan 2024 17:00    1
                                 32  30 Jan 2024 11:10    1
 
 
Specify the Begin and End Snapshot Ids
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
순서4. AWR을 보려는 스냅샷의 시작 시간대 번호(Snap Id) 입력
Enter value for begin_snap: 26 (AWR을 보려는 스냅샷의 시작 번호 입력)
Begin Snapshot Id specified: 26
 
순서5. AWR을 보려는 스냅샷의 종료 시간대 번호(Snap Id) 입력
Enter value for end_snap: 27  (AWR을 보려는 스냅샷의 종료 번호 입력)
End   Snapshot Id specified: 27
 
 
Specify the Report Name
~~~~~~~~~~~~~~~~~~~~~~~
The default report file name is awrrpt_1_26_27.html.  To use this name,
press  to continue, otherwise enter an alternative.
 
순서6. AWR 리포트의 출력 파일명 입력, 엔터 입력시 위에 있는 awrrpt_1_26_27.html 기본 이름으로 저장됨
(나의 경우 시작날짜_시간_종료날짜_시간_awrrpt_sid.html 로 지정함)
Enter value for report_name: 20240129_1200_20240129_1300_awrrpt_oracle19.html  (awr 리포트의 출력 파일명 입력)
 
Using the report name 20240129_1200_20240129_1300_awrrpt_oracle19.html
.
.
(AWR 리포트 생성중)
.
.
<p />
End of Report
 
Report written to 20240129_1200_20240129_1300_awrrpt_oracle19.html
완료됨

 

 

출력파일 로컬 pc나 gui를 볼수있는 화면에서 실행해서 AWR 리포트 확인

 

 

AWR 리포트 출력 파일 샘플
text 타입

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
$ cat 20240129_1200_20240129_1300_awrrpt_oracle19.txt
WORKLOAD REPOSITORY report for
 
DB Name         DB Id    Unique Name DB Role          Edition Release    RAC CDB
------------ ----------- ----------- ---------------- ------- ---------- --- ---
ORACLE19      3209222764 oracle19    PRIMARY          EE      19.0.0.0.0 NO  NO
 
Instance     Inst Num Startup Time
------------ -------- ---------------
oracle19            1 29-Jan-24 10:39
 
Host Name        Platform                         CPUs Cores Sockets Memory(GB)
---------------- -------------------------------- ---- ----- ------- ----------
oel7             Linux x86 64-bit                    2     2       1       3.84
 
              Snap Id      Snap Time      Sessions Curs/Sess
            --------- ------------------- -------- ---------
Begin Snap:        26 29-Jan-24 12:00:43        54       1.2
  End Snap:        27 29-Jan-24 13:00:56        57       1.6
   Elapsed:               60.22 (mins)
   DB Time:                0.41 (mins)
 
Load Profile                    Per Second   Per Transaction  Per Exec  Per Call
~~~~~~~~~~~~~~~            ---------------   --------------- --------- ---------
             DB Time(s):               0.0               0.4      0.00      0.01
              DB CPU(s):               0.0               0.3      0.00      0.01
      Background CPU(s):               0.0               0.4      0.00      0.00
      Redo size (bytes):         328,177.4      20,098,434.7
  Logical read (blocks):             213.7          13,087.2
          Block changes:              40.7           2,494.1
 Physical read (blocks):              99.6           6,101.8
Physical write (blocks):              64.4           3,942.9
       Read IO requests:               2.7             166.1
      Write IO requests:               4.9             302.4
           Read IO (MB):               0.8              47.7
          Write IO (MB):               0.5              30.8
           IM scan rows:               0.0               0.0
Session Logical Read IM:               0.0               0.0
             User calls:               0.7              43.5
           Parses (SQL):               2.1             127.0
      Hard parses (SQL):               0.3              20.0
     SQL Work Area (MB):               0.5              30.9
                 Logons:               0.0               0.7
            User logons:               0.0               0.2
         Executes (SQL):               6.3             383.7
              Rollbacks:               0.0               0.0
           Transactions:               0.0
 
Instance Efficiency Percentages (Target 100%)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
            Buffer Nowait %:  100.00       Redo NoWait %:  100.00
            Buffer  Hit   %:   90.23    In-memory Sort %:   99.89
            Library Hit   %:   87.83        Soft Parse %:   84.26
         Execute to Parse %:   66.91         Latch Hit %:   99.97
Parse CPU to Parse Elapsd %:   88.74     % Non-Parse CPU:   95.65
          Flash Cache Hit %:    0.00

 

 

html 타입

 

 

html-active 타입
(html과 동일하지만 하단에 Performance Hub Active Report가 존재)

 

 

리포트 수집 방법 및 AWR 관련 링크

오라클 19c AWR 란 ( https://positivemh.tistory.com/1013 )

오라클 19c AWR 리포트 수집 방법 ( https://positivemh.tistory.com/1012 )
오라클 19c ASH 리포트 수집 방법 ( https://positivemh.tistory.com/1011 )

오라클 19c AWR 비교 리포트 수집 방법 ( https://positivemh.tistory.com/1014 )

오라클 19c AWR 에 저장된 정보 확인(awrinfo.sql) ( https://positivemh.tistory.com/780 )

오라클 19c AWR  데이터 export 방법 ( https://positivemh.tistory.com/836 )

오라클 무료 모니터링 툴 ASH Viewer 설치 가이드 ( https://positivemh.tistory.com/966 )

 

 

참조 : 

https://docs.oracle.com/en/database/oracle/oracle-database/19/tgdba/gathering-database-statistics.html#GUID-56AEF38E-9400-427B-A818-EDEC145F7ACD
https://www.oracle.com/technetwork/oem/grid-control/overview/con9715-bestkeptsecrets-2806698.pdf
https://docs.oracle.com/en/database/oracle/oracle-database/19/tgdba/analyzing-sampled-data.html#GUID-A40B1029-D042-41B6-B596-C77BDCEC722B
https://docs.oracle.com/en/database/oracle/oracle-database/19/tgdba/measuring-database-performance.html#GUID-270E36D0-D7D7-4235-8280-CA3EDD68F8E6