Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> RE: oracle full table scan

RE: oracle full table scan

From: DENNIS WILLIAMS <DWILLIAMS_at_LIFETOUCH.COM>
Date: Thu, 03 Apr 2003 07:23:46 -0800
Message-ID: <F001.0057961B.20030403072346@fatcity.com>


Arvind - If you want to locate tables that are being scanned and the SQL statement, I have found the following script posted by Mohammed to work quite effectively.

Dennis Williams
DBA, 40%OCP, 100% DBA
Lifetouch, Inc.
dwilliams_at_lifetouch.com

REM From: Mohammed Shakir [mailto:mshakir08816_at_yahoo.com] REM Sent: Thursday, October 10, 2002 5:14 PM REM To: Multiple recipients of list ORACLE-L REM Subject: RE: Table Scans
REM Try the following script. I am not sure where I found it on the web. REM However, this script I use to find the bottlenecks in the system. REM Run it while your application is running. REM Look for wait event 'db_file_scattered_read'. REM Check the related SQL.
REM You can remove other wait events if you do not need them. set echo off feedback off timing off pause off set pages 100 lines 500 trimspool on trimout on space 1 recsep each

col sid format 990
col program format a15 word_wrap
col event format a8 word_wrap
col ospid format 9999990 heading "Srvr|PID" col name format a15 word_wrap heading "OBJECT NAME" col sql_text format a30 word_wrap
select /*+ rule */

    w.sid,
    w.event,
    s.program,
    p.spid ospid,
    e.owner || '.' || e.segment_name || ' (' || e.segment_type || ')'
name,

    a.sql_text

from    sys.v_$sqlarea      a,
    sys.dba_extents     e,
    sys.v_$process      p,
    sys.v_$session      s,

    sys.v_$session_wait w
where w.event in ('write complete waits',

'latch free',
'log buffer space',
'free buffer waits',
'buffer busy waits',
'db file scattered read',
'db file sequential read',
'library cache pin',
'log file switch completion',
'enqueue',
'log file parallel write',
'db file parallel write',
'log file sync',
'file open',
'direct path write',
'library cache lock')

and s.sid = w.sid
and p.addr = s.paddr
and e.file_id = to_number(w.p1)

and to_number(w.p2) between e.block_id and (e.block_id + (e.blocks - 1))
and a.address (+) = s.sql_address;

-----Original Message-----
Sent: Wednesday, April 02, 2003 10:59 PM To: Multiple recipients of list ORACLE-L

Dear All,

      is there any way to find which tables (table name) are suffering from full table scan ,so that i can create indexes on them to enhance the performance.

Thanks

Arvind

-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.net
-- 
Author: Arvind Kumar
  INET: arvindk_at_sqlstarintl.com

Fat City Network Services    -- 858-538-5051 http://www.fatcity.com
San Diego, California        -- Mailing list and web hosting services
---------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).
-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.net
-- 
Author: DENNIS WILLIAMS
  INET: DWILLIAMS_at_LIFETOUCH.COM

Fat City Network Services    -- 858-538-5051 http://www.fatcity.com
San Diego, California        -- Mailing list and web hosting services
---------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).
Received on Thu Apr 03 2003 - 09:23:46 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US