Skip to content

Instantly share code, notes, and snippets.

@MilesDowe
Created October 2, 2018 15:25
Show Gist options
  • Save MilesDowe/198fd358136d38aa9a2aa5f77994980e to your computer and use it in GitHub Desktop.
Save MilesDowe/198fd358136d38aa9a2aa5f77994980e to your computer and use it in GitHub Desktop.
General OracleSQL query to check active queries
select S.USERNAME, s.sid, s.serial#, s.osuser, t.sql_id, sql_text
from v$sqltext_with_newlines t,V$SESSION s
where t.address =s.sql_address
and t.hash_value = s.sql_hash_value
and s.status = 'ACTIVE'
and s.username <> 'SYSTEM'
order by s.sid,t.piece
;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment