Find the SQL Queries from Literal Values in Oracle

Find the SQL Queries from Literal Values

Find the SQL plan hash value using literal values

select * from (
select plan_hash_value, count(distinct(hash_value)), sum(executions),
sum(parse_calls)
from gv$sql
group by plan_hash_value
having count(distinct(hash_value)) > 10
order by 2 desc
) where rownum<21;

Find the SQL Queries using literal values

select sql_text from v$sql where plan_hash_value in (
select plan_hash_value from (
select plan_hash_value, count(distinct(hash_value)), sum(executions),
sum(parse_calls)
from gv$sql
group by plan_hash_value
having count(distinct(hash_value)) > 10
order by 2 desc
) where rownum<21 );

This entry was posted in Oracle on by .

About SandeepSingh

Hi, I am working in IT industry with having more than 15 year of experience, worked as an Oracle DBA with a Company and handling different databases like Oracle, SQL Server , DB2 etc Worked as a Development and Database Administrator.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.