All Forums Database
Srinivasa123 1 post Joined 09/15
17 Sep 2015
SQL for Blocking Sessions

Hi All,
Please help me the SQL query of Blocked User and Blocking user along sessions information.
 

gskaushik 56 posts Joined 09/10
26 Sep 2015

Hi Srinivas
 
We can find the blocking sessions by using SYSLIB functions as below
 

SEL USERNAME ,
    SESSIONNO ,
    HOSTID , 
    IDENTIFYUSER(BLK1USERID) ,
    BLK1SESSNO
FROM TABLE
(SYSLIB.MONITORSESSION(-1,'*',0)) AS T1
WHERE (AMPSTATE='BLOCKED' OR PESTATE='BLOCKED')
AND 
USERNAME <> IDENTIFYUSER(BLK1USERID)
ORDER BY 1,2

 

Regards
Subramanian kaushik Gurumoorthy

You must sign in to leave a comment.