비

오라클 lock 체크 스크립트

· 2007-06-29 (금) 17:54:54 · 4808
오라클에서 lock체크 스크립트 입니다.
작업 시간이 오래걸리는 spid 찾아주는 쿼리문 입니다.
 

select /*+ ordered / distinct /* 속도를 위해 v$sql을 조인할 경우 중복되는 레코드 제거 */
           s.sid SID, s.username, s.program, p.spid "OS-Pid",w.seconds_in_wait as "W_time(Sec)",
          decode(w.wait_time,0,'Wai-ting', 'Waited') Status, w.ename event,
--              p1text || ':' || decode(event,'latch free',p1raw, to_char(p1)) ||','||
--              p2text || ':' || to_char(p2) ||','|| p3text || ':' || to_char(p3) "Additional Info",
           q.sql_text
from ( select a.*, decode(a.event,'latch free', 'latch free (' ||b.name||')',
                                         'row cache lock', 'row cache lock (' || c.parameter || ')',
                                         'enqueue', 'enqueue ('||chr(bitand(p1, -16777216)/16777215)||
                                                                             chr(bitand(p1,16711680)/65535)||':'||
                                                decode(bitand(p1,65535), 1, 'N', 2, 'SS',3,'SX',4,'S',5,'SSX',6,'X') ||')',
                              a.event ) ename
           from v$session_wait a, v$latchname b, v$rowcache c
         where a.p2 = b.latch#(+) and a.p1 = c.cache#(+) and c.type(+) = 'PARENT'
           and a.event not in ('rdbms ipc message','smon timer','pmon timer','slave wait','pipe get','null event',
                                     'SQL*Net message from client', 'SQL*Net message to client','PX Idle Wait',
                                      'PX Deq: Execution Msg', 'KXFQ: kxfqdeq - normal deqeue',
                                         'ges remote message', 'wakeup time manager', /* idle event 적절히 수정 */
                                         'lock manager wait for remote message', 'single-task message')
        ) w, v$session s, v$process p, v$sql q
where w.sid = s.sid and s.paddr = p.addr
and s.sql_hash_value = q.hash_value(+) and s.sql_address = q.address(+)
order by w.ename;
[이 게시물은 관리자님에 의해 2011-10-31 16:47:36 Oracle에서 이동 됨]
|
댓글을 작성하시려면 로그인이 필요합니다.

프로그램

8,188건
+
제목 글쓴이 날짜 조회
08-04-17 조회 4,317
08-03-14 조회 3,204
08-03-08 조회 3,027
08-03-06 조회 2,997
08-03-03 조회 4,285
08-02-20 조회 2,975
08-02-15 조회 3,886
08-02-11 조회 5,044
08-02-09 조회 5,763
08-02-05 조회 3,816
08-01-14 조회 6,628
08-01-11 조회 7,060
08-01-04 조회 1.1만
07-12-10 조회 4,968
07-12-10 조회 3,834
07-12-04 조회 3,373
07-11-29 조회 3,547
07-11-27 조회 3,904
07-11-23 조회 4,503
07-11-23 조회 4,235
07-11-13 조회 4,362
07-10-19 조회 4,822
07-10-17 조회 5,875
07-10-03 조회 4,960
07-10-02 조회 8,797
07-10-02 조회 4,455
07-09-09 조회 3,422
07-07-29 조회 4,310
07-07-28 조회 4,536
07-07-26 조회 4,440
07-06-19 조회 1.1만
07-06-17 조회 3,607
07-06-15 조회 4,104
07-05-31 조회 3,163
07-05-09 조회 5,317
07-05-04 조회 3,163
07-05-04 조회 3,511
07-04-28 조회 6,408
07-04-26 조회 4,654
07-04-14 조회 5,299
07-04-13 조회 3,714
07-04-12 조회 5,909
07-03-27 조회 3,849
07-03-19 조회 3,547
07-03-13 조회 4,621
07-03-07 조회 4,771
07-03-07 조회 3,283
07-02-25 조회 3,639
07-02-21 조회 4,533
07-02-18 조회 5,049
07-02-12 조회 3,395
07-02-02 조회 4,511
07-01-28 조회 6,121
07-01-27 조회 5,631
07-01-25 조회 3,995
07-01-21 조회 4,629
07-01-19 조회 6,571
07-01-19 조회 8,030
07-01-13 조회 3,487
07-01-09 조회 5,127
06-12-27 조회 3,530
06-11-24 조회 3,646
06-11-18 조회 4,166
06-10-17 조회 5,485
06-10-01 조회 4,409
06-09-26 조회 4,291
06-09-25 조회 4,609
06-09-25 조회 4,325
06-09-22 조회 4,852
06-09-22 조회 3,624
06-09-22 조회 4,454
06-09-13 조회 5,284
06-08-27 조회 4,886
06-08-26 조회 6,266
06-08-26 조회 5,570
06-08-23 조회 5,066
06-07-28 조회 7,166
06-07-24 조회 4,624
06-07-23 조회 5,408
06-07-21 조회 5,165
06-07-19 조회 3,048
06-07-19 조회 2,958
06-07-11 조회 3,618
06-07-11 조회 3,910
06-07-11 조회 4,482
06-07-11 조회 4,945
06-07-11 조회 3,569
06-07-11 조회 9,191
06-07-11 조회 4,053
06-07-11 조회 3,283
06-07-11 조회 3,331
06-07-11 조회 3,263
06-07-11 조회 3,066
06-07-07 조회 4,107
06-06-25 조회 4,456
06-06-15 조회 4,450
06-06-14 조회 4,940
06-06-11 조회 3,523
06-06-10 조회 3,904
06-06-09 조회 3,489