Skip to content

Instantly share code, notes, and snippets.

@RichVRed
Forked from ryanthames/stmt_not_using_bindv.sql
Created April 28, 2017 23:55
Show Gist options
  • Select an option

  • Save RichVRed/cf040ebc2ffcc8f3dc50995bf3e5e926 to your computer and use it in GitHub Desktop.

Select an option

Save RichVRed/cf040ebc2ffcc8f3dc50995bf3e5e926 to your computer and use it in GitHub Desktop.
with statements as
(
select force_matching_signature,
count(1) over (partition by force_matching_signature) as statement_count,
row_number() over (partition by force_matching_signature order by last_load_time desc) as row_index,
parsing_schema_name,
sql_text
from v$sql
where force_matching_signature > 0
and force_matching_signature <> exact_matching_signature
)
select
force_matching_signature, parsing_schema_name,
sql_text, statement_count
from statements
where row_index = 1 and statement_count >= 5;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment