비

오라클 lock 체크 스크립트

· 2007-06-29 (금) 17:54:54 · 4886
오라클에서 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-10-30 조회 2,701
08-10-30 조회 2,795
08-10-20 조회 2,529
08-10-11 조회 2,431
08-09-20 조회 4,175
08-09-20 조회 2,843
08-09-18 조회 2,721
08-09-18 조회 3,423
08-09-17 조회 3,290
08-09-05 조회 4,631
08-09-03 조회 2,756
08-08-18 조회 2,893
08-08-17 조회 2,631
08-08-13 조회 3,411
08-07-30 조회 3,473
08-07-28 조회 4,351
08-07-22 조회 5,583
08-07-22 조회 4,064
08-07-10 조회 3,034
08-07-08 조회 3,098
08-06-30 조회 3,859
08-06-30 조회 3,344
08-06-30 조회 3,658
08-06-14 조회 2,727
08-06-11 조회 7,090
08-06-05 조회 3,307
08-05-20 조회 4,821
08-05-13 조회 4,159
08-05-08 조회 3,114
08-05-08 조회 5,267
08-04-25 조회 4,065
08-04-22 조회 4,530
08-04-21 조회 3,168
08-04-17 조회 2,557
08-04-17 조회 2,954
08-04-17 조회 2,253
08-04-17 조회 5,223
08-04-17 조회 4,541
08-04-17 조회 4,533
08-04-17 조회 3,316
08-04-17 조회 3,146
08-04-17 조회 3,632
08-04-17 조회 4,993
08-04-17 조회 5,142
08-04-17 조회 3,349
08-04-04 조회 4,608
08-04-04 조회 2,833
08-04-04 조회 2,578
08-04-04 조회 2,808
08-04-04 조회 2,543
08-04-04 조회 2,782
08-04-03 조회 2,667
08-04-03 조회 2,735
08-04-02 조회 3,050
08-04-02 조회 3,201
08-03-31 조회 3,095
08-03-26 조회 4,271
08-03-11 조회 2,960
08-03-11 조회 2,372
08-03-11 조회 2,380
08-03-07 조회 4,214
08-03-07 조회 3,307
08-03-06 조회 4,758
08-03-04 조회 3,390
08-02-19 조회 3,786
08-02-03 조회 3,408
08-01-18 조회 3,992
08-01-15 조회 3,444
08-01-12 조회 4,292
08-01-12 조회 3,856
08-01-12 조회 3,808
07-12-24 조회 3,106
07-11-30 조회 3,942
07-11-08 조회 5,007
07-11-06 조회 3,858
07-10-26 조회 5,001
07-10-24 조회 4,188
07-10-22 조회 3,576
07-10-19 조회 4,755
07-10-09 조회 4,892
07-10-09 조회 6,756
07-10-05 조회 3,090
07-10-05 조회 4,026
07-10-03 조회 7,537
07-10-03 조회 3,582
07-10-03 조회 2,933
07-10-03 조회 2,855
07-09-28 조회 4,703
07-09-27 조회 3,767
07-09-27 조회 3,219
07-09-13 조회 3,366
07-08-28 조회 3,455
07-08-04 조회 4,840
07-08-01 조회 5,534
07-08-01 조회 4,940
07-07-30 조회 5,455
07-07-29 조회 3,603
07-07-21 조회 3,424
07-07-18 조회 5,381
07-07-16 조회 3,181