행위

"모니터링 SQL"의 두 판 사이의 차이

DB CAFE

(새 문서: === 현재 트랜잭션 조회 === <source lang=sql> col name format a10 col username format a8 col osuser format a8 col start_time format a17 col status format a12 tti 'Active transa...)
 
(현재 트랜잭션 조회)
1번째 줄: 1번째 줄:
 +
=== sql_id 의 바인드변수 값 조회 ===
 +
<source lang=sql>
 +
_id,
 +
b. LAST_CAPTURED,
 +
t.sql_text sql_text,
 +
b.HASH_VALUE,
 +
b.name bind_name,
 +
b.value_string bind_value
 +
FROM
 +
gv$sql t
 +
JOIN
 +
gv$sql_bind_capture b using (sql_id)
 +
WHERE
 +
b.value_string is not null
 +
AND
 +
sql_id='&sqlid'
 +
/
 +
</source>
 +
 
=== 현재 트랜잭션 조회 ===
 
=== 현재 트랜잭션 조회 ===
 
<source lang=sql>
 
<source lang=sql>

2024년 7월 11일 (목) 19:40 판

thumb_up 추천메뉴 바로가기


1 sql_id 의 바인드변수 값 조회[편집]

_id,
b. LAST_CAPTURED,
t.sql_text sql_text,
b.HASH_VALUE,
b.name bind_name,
b.value_string bind_value
FROM
gv$sql t
JOIN
gv$sql_bind_capture b using (sql_id)
WHERE
b.value_string is not null
AND
sql_id='&sqlid'
/

2 현재 트랜잭션 조회[편집]

col name format a10
col username format a8
col osuser format a8
col start_time format a17
col status format a12
tti 'Active transactions'

select s.sid,username,t.start_time, r.name, t.used_ublk "USED BLKS",
decode(t.space, 'YES', 'SPACE TX',
decode(t.recursive, 'YES', 'RECURSIVE TX',
decode(t.noundo, 'YES', 'NO UNDO TX', t.status)
)) status
from sys.v_$transaction t, sys.v_$rollname r, sys.v_$session s
where t.xidusn = r.usn
and t.ses_addr = s.saddr
/