It should be nice to have a mode wich allows to check if there are blocking sessions on the DB
- https://www.dba-oracle.com/t_find_blocking_sessions.htm
- https://www.tutorialspoint.com/how-to-identify-blocked-and-blocking-sessions-in-oracle
- https://stackoverflow.com/questions/46886403/finding-query-from-oracle-which-is-blocking-session
see also: https://github.com/centreon/centreon-plugins/issues/4247
Here is a example of a valid SQL statement:
SQL> select l1.inst_id,l1.sid, ' IS BLOCKING ', l2.sid,l1.type,l2.type,l1.lmode,l2.lmode,l2.inst_id
from gv$lock l1, gv$lock l2
where l1.block =1 and l2.request > 0and l1.id1=l2.id1
and l1.id2=l2.id2; 2 3 4
INST_ID SID 'ISBLOCKING' SID TY TY LMODE LMODE INST_ID
---------- ---------- ------------- ---------- -- -- ---------- ---------- ----------
1 682 IS BLOCKING 275 TX TX 6 0 1
SQL>
SQL> SELECT blocking_session,
sid,
wait_class,
seconds_in_wait
FROM v$session
WHERE blocking_session IS NOT NULL
ORDER BY blocking_session; 2 3 4 5 6 7
BLOCKING_SESSION SID WAIT_CLASS SECONDS_IN_WAIT
---------------- ---------- ---------------------------------------------------------------- ---------------
682 275 Application 401