DBAsupport.com Forums - Powered by vBulletin
Results 1 to 3 of 3

Thread: Query to find if FULL TABLE SCANS are running in the Database

  1. #1
    Join Date
    Nov 2001
    Posts
    110

    Query to find if FULL TABLE SCANS are running in the Database

    What query can be used to see what FULL TABLE SCANS are taking place in the database? How does Oracle decide whether it should perform a FULL TABLE SCAN vs. using an index that is present on the table.

    Thanks.

  2. #2
    Join Date
    May 2005
    Location
    Boracay
    Posts
    681
    You can select text in v$sqlarea where diskreads>10000...
    Well, i guess its a little wild
    Behind The Success And Failure Of A Man Is A Woman

  3. #3
    Join Date
    Apr 2001
    Location
    Bangalore, India
    Posts
    727
    Quote Originally Posted by yxez
    Well, i guess its a little wild
    Not just wild.. It is completely wild... BTW, Which woman is behind you?

    Natik:

    Use AWR Statistics if your are in 10g

    Code:
    ttile ‘Large Full-table scans|Per Snapshot Period’
    col c1 heading ‘Begin|Interval|time’ format a20
    col c4 heading ‘FTS|Count’           format 999,999
    break on c1 skip 2
    break on c2 skip 2
    select  to_char(sn.begin_interval_time,'yy-mm-dd hh24')  c1,  count(1) c4
    from  dba_hist_sql_plan p,   dba_hist_sqlstat   s, dba_hist_snapshot sn,dba_segments o
    where   p.object_owner <> 'SYS'  and    p.object_owner = o.owner  
    and    p.object_name = o.segment_name   and  o.blocks > 1000 
    and    p.operation like '%TABLE ACCESS%' and  p.options like '%FULL%'
    and    p.sql_id = s.sql_id and  s.snap_id = sn.snap_id   
    group by  to_char(sn.begin_interval_time,'yy-mm-dd hh24')
    order by  1;
    Oracle will identify the best optimized way - query plan - of excuting a query thru a costing method. Read manuls to understand more about STATISTICS and how Oracle identifies a best excution plan.

    Note: Read about statistics_level when you use AWR.
    http://www.oracle-base.com/articles/...icsLevel9i.php
    Thomas Saviour(royxavier@yahoo.com)
    Technical Lead (Databases)
    Thomson Reuters (Markets)

    http://ora600tom.wordpress.com/

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width