Find full table Scan query in Oracle
This query help to identified the full table scan query for identifying the need of creating index on objects if execution plan is showing more cost and I/O activities.
Find the SQL id and object name which is having full table access
select sql_id,object_owner,object_name from V$SQL_PLAN where
operation='TABLE ACCESS' and
options='FULL' and
object_owner not in ('SYS','SYSTEM','DBSNMP');
Find the SQL Queries which is having full table scans
SELECT s.object_owner, s.object_name,
(SELECT sql_text
FROM v$sqlarea sa
WHERE sa.address = s.address
AND sa.hash_value = s.hash_value) sqltext,
(SELECT executions
FROM v$sqlarea sa
WHERE sa.address = s.address
AND sa.hash_value = s.hash_value) no_of_full_scans
FROM v$sql_plan s
WHERE operation = 'TABLE ACCESS'
AND options = 'FULL'
AND object_owner not in ('SYS','SYSTEM','DBSNMP');