Openedge (Progress) - List blocked users
You can use this select to list your blocked users and the user who is blocking the others.
select
l."_Lock-Usr" as 'ID',
l."_Lock-Name" as 'User',
l."_Lock-Usr" as 'ID',
l."_Lock-Name" as 'User',
c."_Connect-IPAddress"
as 'IP',
l."_Lock-Flags"
as 'Type 1',
l."_Lock-Type"
as 'Type 2',
tb.TBL
as 'Table',
l."_Lock-RecId"
as 'Register',
database()
as 'Database',
c."_Connect-Pid"
as 'PID OS',
t."_Trans-Duration"
as 'Time in seconds',
'Blocker'
as 'Status'
from
PUB."_Lock" l
cross join
sysprogress.SYSTABLES tb
cross join
pub."_connect" c
left join
pub."_trans" t on
t."_Trans-Usrnum"
= c."_Connect-Usr"
join
PUB."_Lock" l1 on
l1."_Lock-Usr"
is not null
and
l1."_Lock-Table" = l."_Lock-Table"
and
l1."_Lock-RecId" = l."_Lock-RecId"
and
l1."_Lock-Flags" like '%Q%'
where
c."_Connect-Usr"
= l."_Lock-Usr"
and
l."_Lock-Usr" is not null
and
l."_Lock-Table" = tb."ID"
and
l."_Lock-Flags" not like '%Q%'
union
select
union
select
l."_Lock-Usr" as
'ID',
l."_Lock-Name"
as 'User',
c."_Connect-IPAddress"
as 'IP',
l."_Lock-Flags"
as 'Type 1',
l."_Lock-Type"
as 'Type 2',
tb.TBL
as 'Table',
l."_Lock-RecId"
as 'Register',
database()
as 'Database',
c."_Connect-Pid"
as 'PID SOOS
t."_Trans-Duration"
as 'Time in seconds',
'Blocked'
as 'Status'
from
PUB."_Lock" l
cross join
sysprogress.SYSTABLES tb
cross join
pub."_connect" c
left join
pub."_trans" t on
t."_Trans-Usrnum"
= c."_Connect-Usr"
where
l."_Lock-Flags" like '%Q%'
l."_Lock-Flags" like '%Q%'
and
c."_Connect-Usr" = l."_Lock-Usr"
and
l."_Lock-Usr" is not null
and
l."_Lock-Table" = tb."ID"
Comments
Post a Comment