Проект

Общее

Профиль

OracleLogs » История » Версия 6

BEA, 30.01.2025 19:04

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