## oracle sid를 이용한 sql문 찾기
set pages 40
col program for a25
col username for a10
col machine for a15
col module for a25
col spid for a6
col sid for 99999
select a.username,a.program,a.machine,a.module,b.spid,a.sid,a.serial#,a.status,
c.sql_text
from v$session a,
v$process b,
v$sql c
where a.sid = '&sid'
and b.addr = a.paddr
and a.sql_hash_value = c.hash_value(+)
and a.sql_address = c.address(+);
## os pid를 이용한 sql문 찾기
set pages 40
col module for a10
col MACHINE for a10
select /-+ use_hash(a,b,c) *-
a.username,a.program,a.machine,a.module,b.spid,a.sid,a.serial#,a.sql_hash_value,
d.PHYSICAL_READS, d.BLOCK_GETS,
c.sql_text
from v$session a,
v$process b,
v$sql c,
v$sess_io d
where b.spid = '&pid'
and b.addr = a.paddr
and a.sid = d.sid
and a.sql_hash_value = c.hash_value(+)
and a.sql_address = c.address(+);
'DB > Oracle' 카테고리의 다른 글
서비스 bat (0) | 2014.02.03 |
---|---|
오라클에서 정규식 사용(간단예제) (0) | 2013.08.01 |
Got minus one from a read call 에러 (0) | 2012.12.28 |
ORA-01113: file 5 needs media recovery 에러 (2) | 2012.12.28 |
[오라클 락 LOCK]ORA-00054: resource busy and acquire with NOWAIT specified (0) | 2011.10.12 |