-
Notifications
You must be signed in to change notification settings - Fork 64
/
cs_blocked_sessions_ash_awr_report.sql
executable file
·458 lines (458 loc) · 17.7 KB
/
cs_blocked_sessions_ash_awr_report.sql
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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
----------------------------------------------------------------------------------------
--
-- File name: cs_blocked_sessions_ash_awr_report.sql
--
-- Purpose: Top Session Blockers by multiple Dimensions as per ASH from AWR (text report)
--
-- Author: Carlos Sierra
--
-- Version: 2022/02/04
--
-- Usage: Execute connected to CDB or PDB
--
-- Enter range of dates and filters when requested.
--
-- Example: $ sqlplus / as sysdba
-- SQL> @cs_blocked_sessions_ash_awr_report.sql
--
-- Notes: Developed and tested on 12.1.0.2.
--
---------------------------------------------------------------------------------------
--
@@cs_internal/cs_primary.sql
@@cs_internal/cs_set.sql
@@cs_internal/cs_def.sql
@@cs_internal/cs_file_prefix.sql
--
DEF cs_script_name = 'cs_blocked_sessions_ash_awr_report';
DEF cs_hours_range_default = '24';
DEF cs_top_n = '20';
DEF cs_min_perc = '0.1';
--
@@cs_internal/cs_sample_time_from_and_to.sql
@@cs_internal/cs_snap_id_from_and_to.sql
--
-- @@cs_internal/&&cs_set_container_to_cdb_root.
--
SELECT '&&cs_file_prefix._&&cs_script_name.' cs_file_name FROM DUAL;
--
@@cs_internal/cs_spool_head.sql
PRO SQL> @&&cs_script_name..sql "&&cs_sample_time_from." "&&cs_sample_time_to."
@@cs_internal/cs_spool_id.sql
--
@@cs_internal/cs_spool_id_sample_time.sql
--
DEF times_cpu_cores = '1';
DEF include_hist = 'Y';
DEF include_mem = 'Y';
@@cs_internal/cs_ash_block_chains.sql
--
COL time FOR A19 HEA 'SAMPLE TIME';
COL blocked FOR 999,990 HEA 'BLOCKED|SESSIONS|COUNT';
COL percent FOR 999,990.000 HEA 'CONTRIBUTION|PERCENT %'
COL blocker FOR A12 HEA 'ROOT|BLOCKER|SID_SERIAL#';
COL blocker_machine FOR A64 HEA 'ROOT BLOCKER MACHINE';
COL blocker_module FOR A64 HEA 'ROOT BLOCKER MODULE';
COL blocker_status FOR A80 HEA 'ROOT BLOCKER TIMED EVENT';
COL blocker_sql_id FOR A13 HEA 'ROOT|BLOCKER|SQL_ID';
COL blocker_sql_text FOR A80 TRUNC HEA 'ROOT BLOCKER SQL_TEXT';
COL wait_class_event FOR A80 TRUNC HEA 'BLOCKEE(S) WAIT CLASS AND EVENT';
--
BREAK ON REPORT;
COMPUTE SUM OF percent ON REPORT;
--
PRO
PRO Root Blocker contribution percent by SQL_ID (between &&cs_sample_time_from. and &&cs_sample_time_to. UTC)
PRO ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
SET TERM OFF;
GET cs_internal/cs_blocked_sessions_ash_awr_internal.sql NOLIST
.
666666 ,
666666 detail AS (
666666 SELECT /*+ MATERIALIZE NO_MERGE */
666666 b.time,
666666 b.sessions_blocked blocked,
666666 b.blocker_session_id||','||b.blocker_session_serial# blocker,
666666 b.machine blocker_machine,
666666 CASE b.blocker_status WHEN 'INACTIVE or UNKNOWN' THEN (CASE b.machine WHEN '&&cs_host_name.' THEN 'UNKNOWN' ELSE 'INACTIVE' END) ELSE ('ACTIVE '||CASE b.blocker_session_state WHEN 'ON CPU' THEN b.blocker_session_state ELSE 'WAITING ON '||b.blocker_wait_class||' - '||b.blocker_event END) END blocker_status,
666666 b.blocker_sql_id,
666666 (SELECT s.sql_text FROM v$sql s WHERE s.sql_id = b.blocker_sql_id AND ROWNUM = 1) blocker_sql_text
666666 FROM blockers_and_blockees b
666666 WHERE b.sessions_blocked > 0
666666 ),
666666 summary AS (
666666 SELECT /*+ MATERIALIZE NO_MERGE */
666666 100 * SUM(blocked) / SUM(SUM(blocked)) OVER () percent,
666666 blocker_sql_id,
666666 blocker_sql_text
666666 FROM detail
666666 GROUP BY
666666 blocker_sql_id,
666666 blocker_sql_text
666666 )
666666 SELECT *
666666 FROM summary
666666 WHERE percent > &&cs_min_perc.
666666 ORDER BY
666666 1 DESC
666666 FETCH FIRST &&cs_top_n. ROWS ONLY;
SET TERM ON;
/
--
PRO
PRO Root Blocker contribution percent by Timed Event (between &&cs_sample_time_from. and &&cs_sample_time_to. UTC)
PRO ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
SET TERM OFF;
GET cs_internal/cs_blocked_sessions_ash_awr_internal.sql NOLIST
.
666666 ,
666666 detail AS (
666666 SELECT /*+ MATERIALIZE NO_MERGE */
666666 b.time,
666666 b.sessions_blocked blocked,
666666 b.blocker_session_id||','||b.blocker_session_serial# blocker,
666666 b.machine blocker_machine,
666666 CASE b.blocker_status WHEN 'INACTIVE or UNKNOWN' THEN (CASE b.machine WHEN '&&cs_host_name.' THEN 'UNKNOWN' ELSE 'INACTIVE' END) ELSE ('ACTIVE '||CASE b.blocker_session_state WHEN 'ON CPU' THEN b.blocker_session_state ELSE 'WAITING ON '||b.blocker_wait_class||' - '||b.blocker_event END) END blocker_status,
666666 b.blocker_sql_id,
666666 (SELECT s.sql_text FROM v$sql s WHERE s.sql_id = b.blocker_sql_id AND ROWNUM = 1) blocker_sql_text
666666 FROM blockers_and_blockees b
666666 WHERE b.sessions_blocked > 0
666666 ),
666666 summary AS (
666666 SELECT /*+ MATERIALIZE NO_MERGE */
666666 100 * SUM(blocked) / SUM(SUM(blocked)) OVER () percent,
666666 blocker_status
666666 FROM detail
666666 GROUP BY
666666 blocker_status
666666 )
666666 SELECT *
666666 FROM summary
666666 WHERE percent > &&cs_min_perc.
666666 ORDER BY
666666 1 DESC
666666 FETCH FIRST &&cs_top_n. ROWS ONLY;
SET TERM ON;
/
--
PRO
PRO Root Blocker contribution percent by Module (between &&cs_sample_time_from. and &&cs_sample_time_to. UTC)
PRO ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
SET TERM OFF;
GET cs_internal/cs_blocked_sessions_ash_awr_internal.sql NOLIST
.
666666 ,
666666 detail AS (
666666 SELECT /*+ MATERIALIZE NO_MERGE */
666666 b.time,
666666 b.sessions_blocked blocked,
666666 b.blocker_session_id||','||b.blocker_session_serial# blocker,
666666 b.module blocker_module,
666666 CASE b.blocker_status WHEN 'INACTIVE or UNKNOWN' THEN ('ACTIVE '||CASE b.blocker_session_state WHEN 'ON CPU' THEN b.blocker_session_state ELSE 'WAITING ON '||b.blocker_wait_class||' - '||b.blocker_event END) END blocker_status,
666666 b.blocker_sql_id,
666666 (SELECT s.sql_text FROM v$sql s WHERE s.sql_id = b.blocker_sql_id AND ROWNUM = 1) blocker_sql_text
666666 FROM blockers_and_blockees b
666666 WHERE b.sessions_blocked > 0
666666 ),
666666 summary AS (
666666 SELECT /*+ MATERIALIZE NO_MERGE */
666666 100 * SUM(blocked) / SUM(SUM(blocked)) OVER () percent,
666666 blocker_module
666666 FROM detail
666666 GROUP BY
666666 blocker_module
666666 )
666666 SELECT *
666666 FROM summary
666666 WHERE percent > &&cs_min_perc.
666666 ORDER BY
666666 1 DESC
666666 FETCH FIRST &&cs_top_n. ROWS ONLY;
SET TERM ON;
/
--
PRO
PRO Root Blocker contribution percent by Machine (between &&cs_sample_time_from. and &&cs_sample_time_to. UTC)
PRO ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
SET TERM OFF;
GET cs_internal/cs_blocked_sessions_ash_awr_internal.sql NOLIST
.
666666 ,
666666 detail AS (
666666 SELECT /*+ MATERIALIZE NO_MERGE */
666666 b.time,
666666 b.sessions_blocked blocked,
666666 b.blocker_session_id||','||b.blocker_session_serial# blocker,
666666 b.machine blocker_machine,
666666 b.module blocker_module,
666666 CASE b.blocker_status WHEN 'INACTIVE or UNKNOWN' THEN (CASE b.machine WHEN '&&cs_host_name.' THEN 'UNKNOWN' ELSE 'INACTIVE' END) ELSE ('ACTIVE '||CASE b.blocker_session_state WHEN 'ON CPU' THEN b.blocker_session_state ELSE 'WAITING ON '||b.blocker_wait_class||' - '||b.blocker_event END) END blocker_status,
666666 b.blocker_sql_id,
666666 (SELECT s.sql_text FROM v$sql s WHERE s.sql_id = b.blocker_sql_id AND ROWNUM = 1) blocker_sql_text
666666 FROM blockers_and_blockees b
666666 WHERE b.sessions_blocked > 0
666666 ),
666666 summary AS (
666666 SELECT /*+ MATERIALIZE NO_MERGE */
666666 100 * SUM(blocked) / SUM(SUM(blocked)) OVER () percent,
666666 blocker_machine
666666 FROM detail
666666 GROUP BY
666666 blocker_machine
666666 )
666666 SELECT *
666666 FROM summary
666666 WHERE percent > &&cs_min_perc.
666666 ORDER BY
666666 1 DESC
666666 FETCH FIRST &&cs_top_n. ROWS ONLY;
SET TERM ON;
/
--
PRO
PRO Root Blocker contribution percent by SID (between &&cs_sample_time_from. and &&cs_sample_time_to. UTC)
PRO ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
SET TERM OFF;
GET cs_internal/cs_blocked_sessions_ash_awr_internal.sql NOLIST
.
666666 ,
666666 detail AS (
666666 SELECT /*+ MATERIALIZE NO_MERGE */
666666 b.time,
666666 b.sessions_blocked blocked,
666666 b.blocker_session_id||','||b.blocker_session_serial# blocker,
666666 b.machine blocker_machine,
666666 b.module blocker_module,
666666 CASE b.blocker_status WHEN 'INACTIVE or UNKNOWN' THEN (CASE b.machine WHEN '&&cs_host_name.' THEN 'UNKNOWN' ELSE 'INACTIVE' END) ELSE ('ACTIVE '||CASE b.blocker_session_state WHEN 'ON CPU' THEN b.blocker_session_state ELSE 'WAITING ON '||b.blocker_wait_class||' - '||b.blocker_event END) END blocker_status,
666666 b.blocker_sql_id,
666666 (SELECT s.sql_text FROM v$sql s WHERE s.sql_id = b.blocker_sql_id AND ROWNUM = 1) blocker_sql_text
666666 FROM blockers_and_blockees b
666666 WHERE b.sessions_blocked > 0
666666 ),
666666 summary AS (
666666 SELECT /*+ MATERIALIZE NO_MERGE */
666666 100 * SUM(blocked) / SUM(SUM(blocked)) OVER () percent,
666666 blocker
666666 FROM detail
666666 GROUP BY
666666 blocker
666666 )
666666 SELECT *
666666 FROM summary
666666 WHERE percent > &&cs_min_perc.
666666 ORDER BY
666666 1 DESC
666666 FETCH FIRST &&cs_top_n. ROWS ONLY;
SET TERM ON;
/
--
PRO
PRO Root Blocker contribution percent by Timed Event and SQL_ID (between &&cs_sample_time_from. and &&cs_sample_time_to. UTC)
PRO ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
SET TERM OFF;
GET cs_internal/cs_blocked_sessions_ash_awr_internal.sql NOLIST
.
666666 ,
666666 detail AS (
666666 SELECT /*+ MATERIALIZE NO_MERGE */
666666 b.time,
666666 b.sessions_blocked blocked,
666666 b.blocker_session_id||','||b.blocker_session_serial# blocker,
666666 b.machine blocker_machine,
666666 CASE b.blocker_status WHEN 'INACTIVE or UNKNOWN' THEN (CASE b.machine WHEN '&&cs_host_name.' THEN 'UNKNOWN' ELSE 'INACTIVE' END) ELSE ('ACTIVE '||CASE b.blocker_session_state WHEN 'ON CPU' THEN b.blocker_session_state ELSE 'WAITING ON '||b.blocker_wait_class||' - '||b.blocker_event END) END blocker_status,
666666 b.blocker_sql_id,
666666 (SELECT s.sql_text FROM v$sql s WHERE s.sql_id = b.blocker_sql_id AND ROWNUM = 1) blocker_sql_text
666666 FROM blockers_and_blockees b
666666 WHERE b.sessions_blocked > 0
666666 ),
666666 summary AS (
666666 SELECT /*+ MATERIALIZE NO_MERGE */
666666 100 * SUM(blocked) / SUM(SUM(blocked)) OVER () percent,
666666 blocker_status,
666666 blocker_sql_id,
666666 blocker_sql_text
666666 FROM detail
666666 GROUP BY
666666 blocker_status,
666666 blocker_sql_id,
666666 blocker_sql_text
666666 )
666666 SELECT *
666666 FROM summary
666666 WHERE percent > &&cs_min_perc.
666666 ORDER BY
666666 1 DESC
666666 FETCH FIRST &&cs_top_n. ROWS ONLY;
SET TERM ON;
/
--
PRO
PRO Root Blocker contribution percent by Module, Timed Event and SQL_ID (between &&cs_sample_time_from. and &&cs_sample_time_to. UTC)
PRO ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
SET TERM OFF;
GET cs_internal/cs_blocked_sessions_ash_awr_internal.sql NOLIST
.
666666 ,
666666 detail AS (
666666 SELECT /*+ MATERIALIZE NO_MERGE */
666666 b.time,
666666 b.sessions_blocked blocked,
666666 b.blocker_session_id||','||b.blocker_session_serial# blocker,
666666 b.module blocker_module,
666666 CASE b.blocker_status WHEN 'INACTIVE or UNKNOWN' THEN ('ACTIVE '||CASE b.blocker_session_state WHEN 'ON CPU' THEN b.blocker_session_state ELSE 'WAITING ON '||b.blocker_wait_class||' - '||b.blocker_event END) END blocker_status,
666666 b.blocker_sql_id,
666666 (SELECT s.sql_text FROM v$sql s WHERE s.sql_id = b.blocker_sql_id AND ROWNUM = 1) blocker_sql_text
666666 FROM blockers_and_blockees b
666666 WHERE b.sessions_blocked > 0
666666 ),
666666 summary AS (
666666 SELECT /*+ MATERIALIZE NO_MERGE */
666666 100 * SUM(blocked) / SUM(SUM(blocked)) OVER () percent,
666666 blocker_module,
666666 blocker_status,
666666 blocker_sql_id,
666666 blocker_sql_text
666666 FROM detail
666666 GROUP BY
666666 blocker_module,
666666 blocker_status,
666666 blocker_sql_id,
666666 blocker_sql_text
666666 )
666666 SELECT *
666666 FROM summary
666666 WHERE percent > &&cs_min_perc.
666666 ORDER BY
666666 1 DESC
666666 FETCH FIRST &&cs_top_n. ROWS ONLY;
SET TERM ON;
/
--
PRO
PRO Root Blocker contribution percent by Machine, Module, Timed Event and SQL_ID (between &&cs_sample_time_from. and &&cs_sample_time_to. UTC)
PRO ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
SET TERM OFF;
GET cs_internal/cs_blocked_sessions_ash_awr_internal.sql NOLIST
.
666666 ,
666666 detail AS (
666666 SELECT /*+ MATERIALIZE NO_MERGE */
666666 b.time,
666666 b.sessions_blocked blocked,
666666 b.blocker_session_id||','||b.blocker_session_serial# blocker,
666666 b.machine blocker_machine,
666666 b.module blocker_module,
666666 CASE b.blocker_status WHEN 'INACTIVE or UNKNOWN' THEN (CASE b.machine WHEN '&&cs_host_name.' THEN 'UNKNOWN' ELSE 'INACTIVE' END) ELSE ('ACTIVE '||CASE b.blocker_session_state WHEN 'ON CPU' THEN b.blocker_session_state ELSE 'WAITING ON '||b.blocker_wait_class||' - '||b.blocker_event END) END blocker_status,
666666 b.blocker_sql_id,
666666 (SELECT s.sql_text FROM v$sql s WHERE s.sql_id = b.blocker_sql_id AND ROWNUM = 1) blocker_sql_text
666666 FROM blockers_and_blockees b
666666 WHERE b.sessions_blocked > 0
666666 ),
666666 summary AS (
666666 SELECT /*+ MATERIALIZE NO_MERGE */
666666 100 * SUM(blocked) / SUM(SUM(blocked)) OVER () percent,
666666 blocker_machine,
666666 blocker_module,
666666 blocker_status,
666666 blocker_sql_id,
666666 blocker_sql_text
666666 FROM detail
666666 GROUP BY
666666 blocker_machine,
666666 blocker_module,
666666 blocker_status,
666666 blocker_sql_id,
666666 blocker_sql_text
666666 )
666666 SELECT *
666666 FROM summary
666666 WHERE percent > &&cs_min_perc.
666666 ORDER BY
666666 1 DESC
666666 FETCH FIRST &&cs_top_n. ROWS ONLY;
SET TERM ON;
/
--
PRO
PRO Root Blocker contribution percent by SID, Machine, Module, Timed Event and SQL_ID (between &&cs_sample_time_from. and &&cs_sample_time_to. UTC)
PRO ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
SET TERM OFF;
GET cs_internal/cs_blocked_sessions_ash_awr_internal.sql NOLIST
.
666666 ,
666666 detail AS (
666666 SELECT /*+ MATERIALIZE NO_MERGE */
666666 b.time,
666666 b.sessions_blocked blocked,
666666 b.blocker_session_id||','||b.blocker_session_serial# blocker,
666666 b.machine blocker_machine,
666666 b.module blocker_module,
666666 CASE b.blocker_status WHEN 'INACTIVE or UNKNOWN' THEN (CASE b.machine WHEN '&&cs_host_name.' THEN 'UNKNOWN' ELSE 'INACTIVE' END) ELSE ('ACTIVE '||CASE b.blocker_session_state WHEN 'ON CPU' THEN b.blocker_session_state ELSE 'WAITING ON '||b.blocker_wait_class||' - '||b.blocker_event END) END blocker_status,
666666 b.blocker_sql_id,
666666 (SELECT s.sql_text FROM v$sql s WHERE s.sql_id = b.blocker_sql_id AND ROWNUM = 1) blocker_sql_text
666666 FROM blockers_and_blockees b
666666 WHERE b.sessions_blocked > 0
666666 ),
666666 summary AS (
666666 SELECT /*+ MATERIALIZE NO_MERGE */
666666 100 * SUM(blocked) / SUM(SUM(blocked)) OVER () percent,
666666 blocker,
666666 blocker_machine,
666666 blocker_module,
666666 blocker_status,
666666 blocker_sql_id,
666666 blocker_sql_text
666666 FROM detail
666666 GROUP BY
666666 blocker,
666666 blocker_machine,
666666 blocker_module,
666666 blocker_status,
666666 blocker_sql_id,
666666 blocker_sql_text
666666 )
666666 SELECT *
666666 FROM summary
666666 WHERE percent > &&cs_min_perc.
666666 ORDER BY
666666 1 DESC
666666 FETCH FIRST &&cs_top_n. ROWS ONLY;
SET TERM ON;
/
--
PRO
PRO Sample of Blocked Sessions (between &&cs_sample_time_from. and &&cs_sample_time_to. UTC)
PRO ~~~~~~~~~~~~~~~~~~~~~~~~~~
SET TERM OFF;
GET cs_internal/cs_blocked_sessions_ash_awr_internal.sql NOLIST
.
666666 SELECT b.time,
666666 b.wait_class_event,
666666 b.sessions_blocked blocked,
666666 b.blocker_session_id||','||b.blocker_session_serial# blocker,
666666 b.machine blocker_machine,
666666 b.module blocker_module,
666666 --CASE b.blocker_status WHEN 'INACTIVE or UNKNOWN' THEN b.blocker_status ELSE ('ACTIVE '||CASE b.blocker_session_state WHEN 'ON CPU' THEN b.blocker_session_state ELSE 'WAITING ON '||b.blocker_wait_class||' - '||b.blocker_event END) END blocker_status,
666666 CASE b.blocker_status WHEN 'INACTIVE or UNKNOWN' THEN (CASE b.machine WHEN '&&cs_host_name.' THEN 'UNKNOWN' ELSE 'INACTIVE' END) ELSE ('ACTIVE '||CASE b.blocker_session_state WHEN 'ON CPU' THEN b.blocker_session_state ELSE 'WAITING ON '||b.blocker_wait_class||' - '||b.blocker_event END) END blocker_status,
666666 b.blocker_sql_id,
666666 (SELECT s.sql_text FROM v$sql s WHERE s.sql_id = b.blocker_sql_id AND ROWNUM = 1) blocker_sql_text
666666 FROM blockers_and_blockees b
666666 WHERE b.sessions_blocked > 0
666666 ORDER BY
666666 b.time,
666666 b.blocker_session_id;
SET TERM ON;
/
--
PRO
PRO "INACTIVE" means: Database is waiting for Application Host to release LOCK, while "UNKNOWN" could be a BACKGROUND session on CDB$ROOT.
--
PRO
PRO SQL> @&&cs_script_name..sql "&&cs_sample_time_from." "&&cs_sample_time_to."
--
@@cs_internal/cs_spool_tail.sql
--
-- @@cs_internal/&&cs_set_container_to_curr_pdb.
--
@@cs_internal/cs_undef.sql
@@cs_internal/cs_reset.sql
--