Skip to content

Instantly share code, notes, and snippets.

@yogananda-muthaiah
Created September 25, 2019 11:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yogananda-muthaiah/79aa1d8fa565746c3acec97022958c8d to your computer and use it in GitHub Desktop.
Save yogananda-muthaiah/79aa1d8fa565746c3acec97022958c8d to your computer and use it in GitHub Desktop.
Oracle PL SQL - Identify top SQL statements causing long running
To find the top SQL statements that have caused most block buffer reads:
Select buffer_gets, sql_text
from v$sqlarea
where buffer_gets > 10000
order by buffer_gets desc;
To find the most frequently executed SQL:
Select executions, buffer_gets, sql_text
from v$sqlarea
where executions > 10000
order by executions desc;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment