chk_lock.sql °ú lock_kill.sh ½ºÅ©¸³Æ®
ÀÛ¼ºÀÚ °ü¸®ÀÚ ÀÛ¼º½Ã°£ 2008-01-18 22:58:28
 

BISDB1|/oracle/DBA/MONITOR> vi chk_lock.sql
set lines 200
set pages 2000
col object_name format a20
col owner format a15
col osuser format a15
select b.owner, c.osuser, a.session_id, c.serial#,
decode(a.locked_mode, 0, 'None', 1, 'Null', 2, 'Row-S', 3, 'Row-X', 4, 'Share', 5, 'S/Row-X', 6, 'Exclusive') lockmode,
b.object_name,b.object_type
from v$locked_object a, dba_objects b, v$session c
where a.object_id=b.object_id and a.session_id=c.sid;




BISDB1|/oracle/DBA/MONITOR> vi lock_kill.sh

set pages 500
set lines 500
select * from v$lock where type!='MR';

set head off

spool lock_kill.sql

select 'alter system kill session '''||sid||','||serial#||''';'
from v$session
where sid in (select distinct sid from v$lock where type ='TM');

spool off
set head on
~


¸ñ·Ï | ÀÔ·Â | ¼öÁ¤ | ´äº¯ | »èÁ¦