17 lines
520 B
Markdown
17 lines
520 B
Markdown
|
#Oracle #Lock
|
||
|
|
||
|
SELECT C.id1, username, osuser, lockwait, a.status, machine, program, 'ALTER SYSTEM KILL SESSION ' ||''''||A.SID|| ','|| A.serial#||'''' ||';', (select OBJECT_NAME from dba_objects where object_id = c.id1 and owner = a.username ) as obj
|
||
|
FROM v$session A, v$lock c
|
||
|
WHERE A.SID= c.SID
|
||
|
AND c.TYPE= 'TM'
|
||
|
and c.id1 not in ( '87463' , '92646')
|
||
|
order by A.SID, A. serial#
|
||
|
|
||
|
|
||
|
* * *
|
||
|
|
||
|
select object_id, OBJECT_NAME
|
||
|
from dba_objects
|
||
|
where owner in ('ERPMAN','TERASEN','WMES','WOUT','POPMAN')
|
||
|
and object_id = '87463'
|