Obsidian/Recognition/Programing/Tibero/Lock 조회.md

54 lines
963 B
Markdown
Raw Permalink Normal View History

2023-08-14 16:19:25 +00:00
``` sql
select sess_id, used_blk from v$transaction;
select sid, serial#, sql_id, PREV_SQL_ID from v$session where sid = 287;
alter system kill session( 287, 9446203);
2023-12-23 14:26:28 +00:00
--session event
select tid,
"DESC",
total_waits,
total_timeouts,
time_waited,
average_wait,
max_wait
from V$SESSION_EVENT
where 1=1
and tid in ( '482' ) --()부분에 sid입력
and time_waited > 0
order by 1,time_waited desc
select tid,
"DESC",
total_waits,
total_timeouts,
time_waited,
average_wait,
max_wait,
b.sql_text,
b.ipaddr
from V$SESSION_EVENT a,
(
SELECT a.sid, max(c.sql_text) as sql_text, max(a.ipaddr) as ipaddr
FROM V$SESSION A,V$LOCK B, V$SQL C
where a.sid = b.sess_id
and state in ( 'RUNNING')
and ipaddr <> '10.200.32.111'
AND C.SQL_ID = A.SQL_ID
group by a.sid ) b
where 1=1
and tid = b.sid
and time_waited > 0
order by 1,time_waited desc
2023-08-14 16:19:25 +00:00
```