비

오라클 lock 체크 스크립트

· 2007-06-29 (금) 17:54:54 · 4872
오라클에서 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,406
08-03-14 조회 3,252
08-03-08 조회 3,072
08-03-06 조회 3,058
08-03-03 조회 4,355
08-02-20 조회 3,026
08-02-15 조회 3,935
08-02-11 조회 5,095
08-02-09 조회 5,827
08-02-05 조회 3,883
08-01-14 조회 6,681
08-01-11 조회 7,119
08-01-04 조회 1.1만
07-12-10 조회 5,015
07-12-10 조회 3,899
07-12-04 조회 3,429
07-11-29 조회 3,614
07-11-27 조회 3,960
07-11-23 조회 4,548
07-11-23 조회 4,281
07-11-13 조회 4,415
07-10-19 조회 4,886
07-10-17 조회 5,933
07-10-03 조회 5,107
07-10-02 조회 8,858
07-10-02 조회 4,506
07-09-09 조회 3,500
07-07-29 조회 4,384
07-07-28 조회 4,603
07-07-26 조회 4,500
07-06-19 조회 1.1만
07-06-17 조회 3,652
07-06-15 조회 4,151
07-05-31 조회 3,229
07-05-09 조회 5,383
07-05-04 조회 3,236
07-05-04 조회 3,565
07-04-28 조회 6,476
07-04-26 조회 4,719
07-04-14 조회 5,354
07-04-13 조회 3,780
07-04-12 조회 5,950
07-03-27 조회 3,901
07-03-19 조회 3,601
07-03-13 조회 4,672
07-03-07 조회 4,821
07-03-07 조회 3,332
07-02-25 조회 3,699
07-02-21 조회 4,592
07-02-18 조회 5,108
07-02-12 조회 3,457
07-02-02 조회 4,597
07-01-28 조회 6,213
07-01-27 조회 5,707
07-01-25 조회 4,077
07-01-21 조회 4,696
07-01-19 조회 6,629
07-01-19 조회 8,088
07-01-13 조회 3,572
07-01-09 조회 5,213
06-12-27 조회 3,604
06-11-24 조회 3,706
06-11-18 조회 4,213
06-10-17 조회 5,547
06-10-01 조회 4,453
06-09-26 조회 4,347
06-09-25 조회 4,689
06-09-25 조회 4,381
06-09-22 조회 4,914
06-09-22 조회 3,690
06-09-22 조회 4,545
06-09-13 조회 5,340
06-08-27 조회 4,947
06-08-26 조회 6,318
06-08-26 조회 5,629
06-08-23 조회 5,121
06-07-28 조회 7,226
06-07-24 조회 4,676
06-07-23 조회 5,461
06-07-21 조회 5,224
06-07-19 조회 3,113
06-07-19 조회 3,038
06-07-11 조회 3,672
06-07-11 조회 3,966
06-07-11 조회 4,563
06-07-11 조회 5,004
06-07-11 조회 3,626
06-07-11 조회 9,247
06-07-11 조회 4,094
06-07-11 조회 3,325
06-07-11 조회 3,376
06-07-11 조회 3,321
06-07-11 조회 3,122
06-07-07 조회 4,161
06-06-25 조회 4,509
06-06-15 조회 4,498
06-06-14 조회 4,993
06-06-11 조회 3,587
06-06-10 조회 3,966
06-06-09 조회 3,551