SQL for Blocking Sessions

Database
Teradata Employee

SQL for Blocking Sessions

Hi All,

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

1 REPLY
Enthusiast

Re: SQL for Blocking Sessions

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