Obsidian/Recognition/0.바로가기/DB_Lock확인.md

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'