Skip to content

Instantly share code, notes, and snippets.

@sytkov
Created June 26, 2013 06:05
Show Gist options
  • Save sytkov/5865083 to your computer and use it in GitHub Desktop.
Save sytkov/5865083 to your computer and use it in GitHub Desktop.
Current query from session
select s.sql_id, t.sql_text
from V$SESSION s, v$sqltext_with_newlines t
where
s.status = 'ACTIVE'
and s.username = :p_schema
and s.machine = :p_machine
and t.address =s.sql_address
and t.hash_value = s.sql_hash_value
and s.sid = :p_sid
and s.type <>'BACKGROUND'
and s.last_call_et > 10
order by s.sid,t.piece
;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment