비

오라클 lock 체크 스크립트

· 2007-06-29 (금) 17:54:54 · 4811
오라클에서 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-10-13 조회 5,106
07-10-03 조회 4,091
07-10-03 조회 3,285
07-10-03 조회 2,504
07-10-03 조회 4,609
07-10-02 조회 2,940
07-10-01 조회 3,571
07-09-28 조회 3,488
07-09-27 조회 4,549
07-08-16 조회 6,403
07-08-04 조회 2,852
07-07-25 조회 6,105
07-07-05 조회 4,000
07-07-02 조회 4,547
07-06-30 조회 4,446
07-06-20 조회 7,335
07-06-20 조회 3,944
07-06-05 조회 4,116
07-05-26 조회 3,138
07-05-17 조회 9,150
07-05-17 조회 5,193
07-05-04 조회 6,114
07-04-15 조회 6,201
07-04-13 조회 3,964
07-04-11 조회 3,383
07-03-20 조회 3,551
07-03-02 조회 6,782
07-02-27 조회 6,046
07-02-22 조회 4,441
07-01-30 조회 6,252
07-01-30 조회 1만
06-12-20 조회 3,720
06-12-18 조회 4,603
06-12-15 조회 4,583
06-12-15 조회 3,810
06-12-15 조회 3,195
06-11-30 조회 3,634
06-11-27 조회 4,527
06-10-24 조회 6,438
06-10-17 조회 4,749
06-09-22 조회 4,485
06-09-21 조회 5,989
06-09-21 조회 3,911
06-09-15 조회 6,532
06-08-20 조회 3,672
06-07-19 조회 3,311
06-07-14 조회 4,220
06-07-14 조회 4,087
06-07-11 조회 5,698
06-06-08 조회 4,275
06-06-08 조회 4,187
06-05-24 조회 3,498
06-05-24 조회 4,884
06-05-17 조회 3,593
06-05-16 조회 4,345
06-05-14 조회 6,039
06-05-12 조회 3,598
06-05-06 조회 4,245
06-05-06 조회 4,330
06-05-06 조회 3,629
06-05-06 조회 3,700
06-05-06 조회 4,149
06-04-25 조회 4,016
06-03-23 조회 5,475
06-01-20 조회 4,043
06-01-04 조회 4,250
05-12-30 조회 4,120
05-12-21 조회 4,797
05-11-09 조회 4,005
05-11-09 조회 3,785
05-10-09 조회 3,450
05-09-21 조회 6,838
05-08-14 조회 4,318
05-08-04 조회 5,502
05-07-14 조회 4,558
05-06-15 조회 4,944
05-04-23 조회 4,552
05-04-20 조회 5,008
05-04-19 조회 1.1만
05-04-19 조회 5,969
05-03-15 조회 3,785
05-03-15 조회 4,228
05-03-13 조회 2,905
05-03-13 조회 3,430
05-03-13 조회 3,418
05-03-13 조회 2,719
05-03-13 조회 5,765
05-03-13 조회 5,402
05-03-13 조회 4,334
05-03-13 조회 4,629
05-03-13 조회 7,890
05-03-13 조회 4,388
05-03-13 조회 3,470
05-03-13 조회 3,464
05-03-13 조회 8,012
05-03-13 조회 5,467
05-03-13 조회 4,117
05-03-12 조회 3,755
05-03-12 조회 4,469
05-02-24 조회 4,618