AWR Report » История » Версия 2
BEA, 21.10.2024 08:21
1 | 1 | BEA | h2. Отчёт AWR |
---|---|---|---|
2 | 2 | BEA | |
3 | h3. Создание отчетов AWR в Oracle через SQL: |
||
4 | |||
5 | Основные три способа получения отчетов AWR: |
||
6 | # *AWRRPT.SQL* и *AWRRPTI.SQL*: Получите отчет AWR с помощью: @@?\rdbms\admin\awrrpt.sql;@ |
||
7 | # *AWRSQRPT.SQL* и *AWRSQRPI.SQL* Получите отчет об идентификаторе SQL с помощью: @@?\rdbms\admin\awrsqrpt.sql;@ |
||
8 | # *AWRDDRPT.SQL* и *AWRDDRPI.SQL* Получите отчет о различиях с помощью: @@?\rdbms\admin\awrddropt.sql;@ |
||
9 | |||
10 | h4. AWRRPT.SQL |
||
11 | |||
12 | {{collapse |
||
13 | Нам нужно создать отчет AWR для получения данных о производительности за определенный интервал. Показать статистику для диапазона идентификаторов снимков. |
||
14 | Во время выборки мы должны ввести некоторые данные: |
||
15 | * Тип отчета: HTML. (В примере @Enter value for report_type: html@) |
||
16 | * Укажите количество дней. (В примере @Enter value for num_days: 2@) |
||
17 | * Укажите идентификаторы начального и конечного снимка. (В примере @Enter value for begin_snap: 483@ и @Enter value for end_snap: 484@) |
||
18 | * Укажите имя отчета. (В примере @Enter value for report_name: C:\reportawr.html@) |
||
19 | |||
20 | Пример: |
||
21 | <pre>SQL> @?\rdbms\admin\awrrpt.sql; |
||
22 | |||
23 | Specify the Report Type |
||
24 | ~~~~~~~~~~~~~~~~~~~~~~~ |
||
25 | AWR reports can be generated in the following formats. Please enter the |
||
26 | name of the format at the prompt. Default value is 'html'. |
||
27 | |||
28 | 'html' HTML format (default) |
||
29 | 'text' Text format |
||
30 | 'active-html' Includes Performance Hub active report |
||
31 | |||
32 | Enter value for report_type: html |
||
33 | |||
34 | Specify the number of days of snapshots to choose from |
||
35 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
||
36 | Entering the number of days (n) will result in the most recent |
||
37 | (n) days of snapshots being listed. Pressing without |
||
38 | specifying a number lists all completed snapshots. |
||
39 | |||
40 | Enter value for num_days: 2 |
||
41 | |||
42 | Listing the last 2 days of Completed Snapshots |
||
43 | Instance DB Name Snap Id Snap Started Snap Level |
||
44 | ------------ ------------ ---------- ------------------ ---------- |
||
45 | |||
46 | xe XE 483 06 Jan 2020 09:27 1 |
||
47 | 484 06 Jan 2020 10:30 1 |
||
48 | |||
49 | Specify the Begin and End Snapshot Ids |
||
50 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
||
51 | Enter value for begin_snap: 483 |
||
52 | Begin Snapshot Id specified: 483 |
||
53 | |||
54 | Enter value for end_snap: 484 |
||
55 | End Snapshot Id specified: 484 |
||
56 | |||
57 | Specify the Report Name |
||
58 | ~~~~~~~~~~~~~~~~~~~~~~~ |
||
59 | The default report file name is awrrpt_1_483_484.html. To use this name, |
||
60 | press to continue, otherwise enter an alternative. |
||
61 | |||
62 | Enter value for report_name: C:\reportawr.html |
||
63 | |||
64 | Using the report name C:\reportawr.html |
||
65 | ... |
||
66 | ... |
||
67 | ... |
||
68 | Report written to C:\reportawr.html</pre> |
||
69 | }} |
||
70 | |||
71 | h4. AWRRPTI.SQL |
||
72 | |||
73 | {{collapse |
||
74 | Он запрашивает еще два параметра: |
||
75 | * идентификатор базы данных (В примере @Enter value for dbid: 2901846628@) |
||
76 | * номер экземпляра. (В примере @Enter value for inst_num: 1@) |
||
77 | Пример: |
||
78 | |||
79 | <pre>SQL> @?\rdbms\admin\awrrpti.sql; |
||
80 | |||
81 | Specify the Report Type |
||
82 | ~~~~~~~~~~~~~~~~~~~~~~~ |
||
83 | AWR reports can be generated in the following formats. Please enter the |
||
84 | name of the format at the prompt. Default value is 'html'. |
||
85 | |||
86 | 'html' HTML format (default) |
||
87 | 'text' Text format |
||
88 | 'active-html' Includes Performance Hub active report |
||
89 | |||
90 | Enter value for report_type: HTML |
||
91 | Type Specified: html |
||
92 | |||
93 | Instances in this Workload Repository schema |
||
94 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
||
95 | DB Id Inst Num DB Name Instance Host |
||
96 | ------------ ---------- --------- ---------- ------ |
||
97 | 2900437705 1 XE xe IXC1-LT8TBDW |
||
98 | * 2901846628 1 XE xe IXC1-LT8TBDW |
||
99 | |||
100 | Enter value for dbid: 2901846628 |
||
101 | Using 2901846628 for database Id |
||
102 | Enter value for inst_num: 1 |
||
103 | Using 1 for instance number |
||
104 | ... |
||
105 | ...</pre> |
||
106 | }} |
||
107 | |||
108 | h4. AWRSQRPT |
||
109 | |||
110 | {{collapse |
||
111 | Используется для просмотра статистики, связанной с идентификатором SQL, которая помогает повысить производительность конкретного запроса SQL. |
||
112 | Вы можете найти SQLID в диапазоне выборки отчета AWR из того же снимка с помощью AWRRPT.SQL. (В примере @Enter value for sql_id: @) |
||
113 | |||
114 | <pre>SQL> @?\rdbms\admin\awrsqrpt.sql |
||
115 | |||
116 | Specify the Report Type |
||
117 | ~~~~~~~~~~~~~~~~~~~~~~~ |
||
118 | Would you like an HTML report, or a plain text report? |
||
119 | Enter 'html' for an HTML report, or 'text' for plain text |
||
120 | Defaults to 'html' |
||
121 | |||
122 | Enter value for report_type: html |
||
123 | Type Specified: html |
||
124 | |||
125 | Current Instance |
||
126 | ~~~~~~~~~~~~~~~~ |
||
127 | DB Id DB Name Inst Num Instance |
||
128 | ----------- ------------ -------- ------------ |
||
129 | 2901846628 XE 1 xe |
||
130 | |||
131 | Instances in this Workload Repository schema |
||
132 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
||
133 | DB Id Inst Num DB Name Instance Host |
||
134 | ------------ ---------- --------- ---------- ------ |
||
135 | 2900437705 1 XE xe IXC1-LT8TBDW |
||
136 | * 2901846628 1 XE xe IXC1-LT8TBDW |
||
137 | |||
138 | Using 2901846628 for database Id |
||
139 | Using 1 for instance number |
||
140 | |||
141 | Specify the number of days of snapshots to choose from |
||
142 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
||
143 | Entering the number of days (n) will result in the most recent |
||
144 | (n) days of snapshots being listed. Pressing without |
||
145 | specifying a number lists all completed snapshots. |
||
146 | |||
147 | Enter value for num_days: 2 |
||
148 | |||
149 | Listing the last 2 days of Completed Snapshots |
||
150 | Instance DB Name Snap Id Snap Started Snap Level |
||
151 | ------------ ------------ ---------- ------------------ ---------- |
||
152 | xe XE 483 06 Jan 2020 09:27 1 |
||
153 | 484 06 Jan 2020 10:30 1 |
||
154 | |||
155 | |||
156 | Specify the Begin and End Snapshot Ids |
||
157 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
||
158 | Enter value for begin_snap: 483 |
||
159 | Begin Snapshot Id specified: 483 |
||
160 | |||
161 | Enter value for end_snap: 484 |
||
162 | End Snapshot Id specified: 484 |
||
163 | |||
164 | Specify the SQL Id |
||
165 | ~~~~~~~~~~~~~~~~~~ |
||
166 | Enter value for sql_id: |
||
167 | ... |
||
168 | ...</pre> |
||
169 | }} |
||
170 | |||
171 | h4. AWRSQRPTI.SQL |
||
172 | |||
173 | Аналогичен AWRSQRPT, но используется с идентификатором базы данных и номером экземпляра. |
||
174 | |||
175 | h4. AWRDDRPT |
||
176 | |||
177 | {{collapse |
||
178 | Сравните два отчета awr и найдите разницу между двумя снимками разного времени с помощью этой команды. AWRDDRPT |
||
179 | |||
180 | <pre>SQL> @?\rdbms\admin\awrddrpt.sql; |
||
181 | |||
182 | Specify the Report Type |
||
183 | ~~~~~~~~~~~~~~~~~~~~~~~ |
||
184 | Would you like an HTML report, or a plain text report? |
||
185 | Enter 'html' for an HTML report, or 'text' for plain text |
||
186 | Defaults to 'html' |
||
187 | Enter value for report_type: html |
||
188 | |||
189 | DB Id DB Id DB Name Inst Num Inst Num Instance |
||
190 | ----------- ----------- ------------ -------- -------- ------------ |
||
191 | 2901846628 2901846628 XE 1 1 xe |
||
192 | |||
193 | Current Instance |
||
194 | ~~~~~~~~~~~~~~~~ |
||
195 | Instances in this Workload Repository schema |
||
196 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
||
197 | DB Id Inst Num DB Name Instance Host |
||
198 | ------------ ---------- --------- ---------- ------ |
||
199 | 2900437705 1 XE xe IXC1-LT8TBDW |
||
200 | * 2901846628 1 XE xe IXC1-LT8TBDW |
||
201 | |||
202 | Database Id and Instance Number for the First Pair of Snapshots |
||
203 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
||
204 | Using 2901846628 for Database Id for the first pair of snapshots |
||
205 | Using 1 for Instance Number for the first pair of snapshots |
||
206 | |||
207 | Specify the number of days of snapshots to choose from |
||
208 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
||
209 | Entering the number of days (n) will result in the most recent |
||
210 | (n) days of snapshots being listed. Pressing without |
||
211 | specifying a number lists all completed snapshots. |
||
212 | |||
213 | Enter value for num_days: 2 |
||
214 | |||
215 | Listing the last 2 days of Completed Snapshots |
||
216 | Instance DB Name Snap Id Snap Started Snap Level |
||
217 | ------------ ------------ ---------- ------------------ ---------- |
||
218 | xe XE 483 06 Jan 2020 09:27 1 |
||
219 | 484 06 Jan 2020 10:30 1 |
||
220 | 485 06 Jan 2020 11:30 1 |
||
221 | 486 06 Jan 2020 12:30 1 |
||
222 | 487 06 Jan 2020 13:30 1 |
||
223 | 488 06 Jan 2020 14:30 1 |
||
224 | |||
225 | |||
226 | Specify the First Pair of Begin and End Snapshot Ids |
||
227 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
||
228 | Enter value for begin_snap: 483 |
||
229 | First Begin Snapshot Id specified: 483 |
||
230 | |||
231 | Enter value for end_snap: 484 |
||
232 | First End Snapshot Id specified: 484 |
||
233 | |||
234 | Instances in this Workload Repository schema |
||
235 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
||
236 | DB Id Inst Num DB Name Instance Host |
||
237 | ------------ ---------- --------- ---------- ------ |
||
238 | 2900437705 1 XE xe IXC1-LT8TBDW |
||
239 | * 2901846628 1 XE xe IXC1-LT8TBDW |
||
240 | |||
241 | Database Id and Instance Number for the Second Pair of Snapshots |
||
242 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
||
243 | Using 2901846628 for Database Id for the second pair of snapshots |
||
244 | Using 1 for Instance Number for the second pair of snapshots |
||
245 | |||
246 | Specify the number of days of snapshots to choose from |
||
247 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
||
248 | Entering the number of days (n) will result in the most recent |
||
249 | (n) days of snapshots being listed. Pressing without |
||
250 | specifying a number lists all completed snapshots. |
||
251 | |||
252 | Enter value for num_days2: 2 |
||
253 | |||
254 | Listing the last 3 days of Completed Snapshots |
||
255 | 482 04 Jan 2020 09:59 1 |
||
256 | 483 06 Jan 2020 09:27 1 |
||
257 | 484 06 Jan 2020 10:30 1 |
||
258 | 485 06 Jan 2020 11:30 1 |
||
259 | 486 06 Jan 2020 12:30 1 |
||
260 | 487 06 Jan 2020 13:30 1 |
||
261 | 488 06 Jan 2020 14:30 1 |
||
262 | |||
263 | |||
264 | Specify the Second Pair of Begin and End Snapshot Ids |
||
265 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
||
266 | Enter value for begin_snap2: 487 |
||
267 | Second Begin Snapshot Id specified: 487 |
||
268 | |||
269 | Enter value for end_snap2: 488 |
||
270 | Second End Snapshot Id specified: 488 |
||
271 | |||
272 | Specify the Report Name |
||
273 | ~~~~~~~~~~~~~~~~~~~~~~~ |
||
274 | The default report file name is awrdiff_1_483_1_487.html To use this name, |
||
275 | press to continue, otherwise enter an alternative. |
||
276 | |||
277 | Enter value for report_name: |
||
278 | ... |
||
279 | ...</pre> |
||
280 | }} |
||
281 | |||
282 | h4. AWRDDRPI.SQL |
||
283 | |||
284 | Аналогичен awrddropt.sql, но используется с определенным идентификатором базы данных и номером экземпляра. |