Displaying SQL which is presently running on the Oracle server.
set pages 999 verify off
col sid format 999
col event format a40
col p1text format a20 newline
col p2text format a20 newline
col p3text format a20 newline
col p1 format 999999999999999
col p2 format 999999999999999
col p3 format 999999999999999
col p1raw format a16
col p2raw format a16
col p3raw format a16
col sql_text format a80
col last_call_et newline
col sql_text newline
select s.sid, event
,seq#
,P1TEXT
,P1
,P1RAW
,P2TEXT
,P2
,P2RAW
,P3TEXT
,P3
,P3RAW, s.last_call_et, wait_time,
seconds_in_wait, state, sql_text
from v$session s,v$session_wait w, v$sqlarea sa
where s.sql_address = sa.address
and s.sql_hash_value = sa.hash_value
and w.sid = s.sid
--and s.audsid != sys_context('USERENV','SESSIONID')
and s.audsid != userenv('SESSIONID')
and w.event != 'Null event'
and w.event != 'rdbms ipc message'
and w.event != 'pipe get'
and w.event != 'virtual circuit status'
and w.event not like '%timer%'
and w.event not like 'SQL*Net message %'
order by last_call_et
;
|
|