SELECT A.OBJECT_ID
,A.OBJECT_NAME
,A.OBJECT_TYPE
,B.LOCKED_MODE
,B.PROCESS
,B.SESSION_ID SID
,S.SERIAL#
,'alter system kill session ''' || B.SESSION_ID || ',' || S.SERIAL# || '''' SQL_RUN
,B.ORACLE_USERNAME --锁进程的EBS用户名
FROM V$SESSION S
,ALL_OBJECTS A
,V$LOCKED_OBJECT B
WHERE A.OBJECT_ID = B.OBJECT_ID
AND (B.LOCKED_MODE = 3 OR B.LOCKED_MODE = 2)
AND B.SESSION_ID = S.SID
AND S.TYPE = 'USER'
ORDER BY A.OBJECT_NAME;
,A.OBJECT_NAME
,A.OBJECT_TYPE
,B.LOCKED_MODE
,B.PROCESS
,B.SESSION_ID SID
,S.SERIAL#
,'alter system kill session ''' || B.SESSION_ID || ',' || S.SERIAL# || '''' SQL_RUN
,B.ORACLE_USERNAME --锁进程的EBS用户名
FROM V$SESSION S
,ALL_OBJECTS A
,V$LOCKED_OBJECT B
WHERE A.OBJECT_ID = B.OBJECT_ID
AND (B.LOCKED_MODE = 3 OR B.LOCKED_MODE = 2)
AND B.SESSION_ID = S.SID
AND S.TYPE = 'USER'
ORDER BY A.OBJECT_NAME;