Skip to content

Commit

Permalink
Better handle blocked background sessions
Browse files Browse the repository at this point in the history
Attempt to provide alternate details, such as the Oracle process name,
for blocked background sessions and NULL usernames.
  • Loading branch information
landstander668 committed Sep 16, 2019
1 parent 535833f commit 2b4760d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion sql/blocker_tree.sql
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@ with sess as (
lk as (
select s1.blocking_instance || '.' || s1.blocking_session || '.' || s2.serial# blocker, s2.status blocking_status,
s2.sql_id blocking_sql_id, s2.sql_child_number blocking_child_number, s1.inst_id || '.' || s1.sid || '.' || s1.serial# waiter, s1.status,
s1.username waiter_username,
case when s1.type = 'BACKGROUND' then 'System: ' || substr( s1.program, -5, 4 )
when s1.username is NULL then 'Unknown: possibly job/scheduler related'
else s1.username
end waiter_username,
case when s2.type = 'BACKGROUND' then 'System: ' || substr( s2.program, -5, 4 )
when s2.username is NULL then 'Unknown: possibly job/scheduler related'
else s2.username
Expand Down

0 comments on commit 2b4760d

Please sign in to comment.