비

오라클 lock 체크 스크립트

· 2007-06-29 (금) 17:54:54 · 4871
오라클에서 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건
+
제목 글쓴이 날짜 조회
07-07-16 조회 3,109
07-07-06 조회 2,979
07-07-06 조회 3,422
07-06-23 조회 3,245
07-06-16 조회 2,758
07-05-20 조회 4,256
07-05-09 조회 3,433
07-05-09 조회 6,074
07-05-04 조회 2,674
07-04-30 조회 9,811
07-04-27 조회 4,311
07-04-26 조회 3,428
07-04-25 조회 5,253
07-04-18 조회 7,760
07-04-13 조회 3,091
07-04-12 조회 6,609
07-04-12 조회 5,012
07-04-12 조회 3,317
07-04-11 조회 5,693
07-04-05 조회 6,343
07-03-24 조회 4,392
07-03-20 조회 3,713
07-03-18 조회 3,976
07-03-18 조회 4,726
07-03-17 조회 4,221
07-03-16 조회 4,116
07-03-15 조회 5,268
07-03-13 조회 5,373
07-03-13 조회 3,569
07-03-08 조회 4,477
07-03-08 조회 3,963
07-03-08 조회 3,274
07-03-08 조회 4,161
07-03-05 조회 4,406
07-03-04 조회 2,894
07-03-01 조회 5,929
07-02-28 조회 3,218
07-02-27 조회 4,390
07-02-26 조회 3,294
07-02-26 조회 3,012
07-02-23 조회 3,644
07-02-23 조회 3,615
07-02-22 조회 3,996
07-02-22 조회 3,803
07-02-19 조회 3,831
07-02-17 조회 4,849
07-02-14 조회 8,151
07-02-12 조회 3,918
07-02-10 조회 3,527
07-02-02 조회 3,779
07-01-31 조회 3,457
07-01-29 조회 3,311
07-01-25 조회 5,094
07-01-21 조회 3,240
07-01-19 조회 3,028
06-12-15 조회 4,026
06-12-15 조회 4,438
06-12-15 조회 2,928
06-12-15 조회 4,468
06-12-15 조회 3,370
06-12-15 조회 4,077
06-12-15 조회 3,022
06-12-15 조회 2,748
06-12-15 조회 4,616
06-12-15 조회 3,164
06-12-15 조회 3,259
06-12-07 조회 4,702
06-12-07 조회 3,991
06-12-04 조회 4,631
06-11-27 조회 3,681
06-11-21 조회 4,001
06-11-15 조회 3,430
06-11-04 조회 3,315
06-10-29 조회 3,967
06-10-13 조회 3,827
06-10-13 조회 4,202
06-10-13 조회 4,161
06-10-12 조회 5,353
06-10-12 조회 4,264
06-10-04 조회 3,758
06-10-02 조회 4,549
06-09-29 조회 3,034
06-09-26 조회 3,371
06-09-26 조회 3,634
06-09-26 조회 3,278
06-09-26 조회 3,431
06-09-26 조회 4,334
06-09-25 조회 4,635
06-09-22 조회 4,971
06-09-22 조회 3,538
06-09-21 조회 4,307
06-09-21 조회 4,318
06-09-21 조회 3,535
06-09-21 조회 5,181
06-09-21 조회 3,716
06-09-21 조회 3,445
06-09-20 조회 3,014
06-09-15 조회 3,132
06-09-13 조회 3,448
06-09-11 조회 3,261