Skip to content

Instantly share code, notes, and snippets.

@xtender
Created November 3, 2018 01:52
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 xtender/e771daf5581a12db15e3708c54678f5b to your computer and use it in GitHub Desktop.
Save xtender/e771daf5581a12db15e3708c54678f5b to your computer and use it in GitHub Desktop.
ash_full_scans.sql
select
h.sql_id
,h.SQL_PLAN_OPERATION
,h.SQL_PLAN_OPTIONS
,p.object_owner||'.'||p.OBJECT_NAME object_name
,count(*)
from v$active_session_history h,v$sql_plan p
where h.IN_SQL_EXECUTION='Y'
and h.sql_plan_operation in ('INDEX','TABLE ACCESS')
and p.object_name is not null
and p.object_owner!='SYS'
and p.SQL_ID = h.sql_id
and p.CHILD_NUMBER = h.SQL_CHILD_NUMBER
and p.ID = h.SQL_PLAN_LINE_ID
and h.sql_plan_options like '%FULL%'
group by
h.sql_id
,h.SQL_PLAN_OPERATION
,h.SQL_PLAN_OPTIONS
,p.object_owner||'.'||p.OBJECT_NAME
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment