_대문 | 방명록 | 최근글 | 홈피소개 | 주인놈
FrontPage › 락모니터링
Describe 락모니터링 here

---------------------
--락 걸린 객체 조회--
---------------------
col object_name format a30
col subobject_name format a10
col oracle_username format a20
select a.object_name, a.subobject_name, b.process, b.session_id, b.oracle_username, b.locked_mode
from dba_objects a, v$locked_object b
where a.object_id = b.object_id;

------------------------
--블록킹 세션 모니터링--
------------------------

column username for a10
column sid for 999
column lock_type for a25
column mode_held for a11
column mod_requested for a10
column lock_id1 for a8
column lock_id2 format a8
select a.sid,
decode(a.type, 'MR', 'Media Recovery',
               'RT', 'Redo Thread',
               'UN', 'User Name',
               'TX', 'Transaction',
               'TM', 'DML',
               'UL', 'PL/SQL User Lock',
               'DX', 'Distributed Xaction',
               'CF', 'Control File',
               'IS', 'Instance State',
               'FS', 'File Set',
               'IR', 'Instance Recovery',
               'ST', 'Disk Space Transaction',
               'TS', 'Temp Segment',
               'IV', 'Library Cache Invaildation',
               'LS', 'Log Start or Switch',
               'RW', 'Row Wait',
               'SQ', 'Sequence Number',
               'TE', 'Extend Table',
               'TT', 'Temp Table', a.type) lock_type,
decode(a.lmode,
				0, 'None', 			/*Non Lock equivalent*/
				1, 'Null', 			/*N*/
				2, 'Row-S(SS)', 	/*L*/
				3, 'Row-X(SX)', 	/*R*/
				4, 'Share', 		/*S*/
				5, 'S/Row-X(SSX)',/*C*/
				6, 'Exclusive',	/*X*/
				to_char(a.lmode)) mode_held,
decode(a.request,
				0, 'None', 			/*Non Lock equivalent*/
				1, 'Null', 			/*N*/
				2, 'Row-S(SS)', 	/*L*/
				3, 'Row-X(SX)', 	/*R*/
				4, 'Share', 		/*S*/
				5, 'S/Row-X(SSX)',/*C*/
				6, 'Exclusive',	/*X*/
				to_char(a.request)) mode_requested,
				to_char(a.id1) lock_id1,
				to_char(a.id2) lock_id2				             
from v$lock a
where a.type not in ('MR', 'DM', 'RT')
and (id1, id2) in (select b.id1, b.id2
                   from v$lock b 
                   where b.id1 = a.id1
                   and b.id2=a.id2
                   and b.request > 0)
order by 5,6;

-------------------------
--락으로 인한 wait 조회--
-------------------------
select s.sid, s.username, s.machine, 
decode(s.status, 'INACTIVE', '락을 걸고 있는 세션(INACTIVE)', s.status) status, e.event
from v$session s, v$session_wait e
where s.sid = e.sid
                   




댓글 남기기..
이름: : 오른쪽의 새로고침을 클릭해 주세요. 새로고침
EditText : Print : Mobile : FindPage : DeletePage : LikePages : Powered by MoniWiki : Last modified 2018-04-13 23:12:53

이슬비가 내리고 있다. 당신은 밖에 나가서 우산을 편다. 그것으로 충분하다.“구질구질하게 또 비가 오는군!” 이런 말을 한들 무슨 소용이 있는가. 비도 구름도 바람도 결코 마음대로 되지 않는데 어째서 “비 한번 시원스럽게 내리는군”하고 말하지 못하는가. <<날마다 행복해지는 255가지 이야기>> (알랭)