BC remote Oracle DBA - Call (800) 766-1884
Free Oracle Tips

Oracle Consulting Oracle Training Development

Remote DBA

 

Remote DBA Plans
Remote DBA Service

 
Remote DBA Oracle Home
Remote DBA Oracle Training
Remote DBA SQL Tuning Consulting
Remote DBA Oracle Tuning Consulting
Remote DBA Data Warehouse Consulting
Remote DBA Oracle Project Management
Remote DBA Oracle Security Assessment
Remote DBA Unix Consulting
Burleson Books
Burleson Articles
Burleson Web Courses
Burleson Qualifications
Oracle Internals Magazine
Oracle Links
Remote DBA Oracle Monitoring
Remote DBA Support Benefits
Remote DBA Plans & Prices
Our Automation Strategy
What We Monitor
Oracle Apps Support
Print Our Brochure
Contact Us (e-mail)
Oracle Job Opportunities
Oracle Consulting Prices





   

 

 

 

 
 

Display rows processed and disk reads for an index

Oracle Tips by Burleson Consulting

Oracle 11g and Expert Systems Technology

Earl Shaffer of  OracleMan Consulting offers this handy script to display the disk reads and rows processed for a specific index.

clear break

col begintvtm heading 'Interval|Time|Begin' format a8

col objnm  heading 'Index Name' format a30

col dskrdstot heading 'Disk|Reads' format 99,999,999

col rwsprctot heading 'Proc-ed|Rows' format 99,999,999

break on begintvtm

spool indexsqlsnap.lis

select

 to_char(s.begin_interval_time,'mm-dd hh24') begintvtm ,

 p.object_name objnm ,

 sum(t.disk_reads_total) dskrdstot,

 sum(t.rows_processed_total) rwsprctot

from

 dba_hist_sql_plan p,

 dba_hist_sqlstat t,

 dba_hist_snapshot s

where

 p.sql_id = t.sql_id and

 t.snap_id = s.snap_id and

 p.object_type like '%INDEX%'

group by

 to_char(s.begin_interval_time,'mm-dd hh24'),

 p.object_name

order by

 begintvtm ,

 dskrdstot desc,

 objnm

/

spool off

ttitle off

clear col

clear break

set echo on feedback on lines 80 pages 60

 

OUTPUT

 

Interval
Time                                                                Disk     Proc-ed
Begin               Index Name                             Reads   Rows
--------              ------------------------------                       ------     -----------
02-12 14          I_IDL_UB11                           3,930   6,808
                        I_TYPE2                                  2,481   0
                        I_USER2                                 2,344   2,093
                        I_IDL_UB21                           1,362   3,828
                        I_OBJ4                                                1,100   948
                        I_IND1                                                886      948
                        I_LINK1                                  876      946
                        I_SUM$_1                               876      946
                        I_OBJ#_INTCOL#                  566      25,263
                        I_OBJ1                                                554      10,366
                        MGMT_TARGETS_PK           451      0

 

 
If you like Oracle tuning, see the book "Oracle Tuning: The Definitive Reference", with 950 pages of tuning tips and scripts. 

You can buy it direct from the publisher for 30%-off and get instant access to the code depot of Oracle tuning scripts.


Expert Remote DBA

BC is America's oldest and largest Remote DBA Oracle support provider.  Get real Remote DBA experts, call
BC Remote DBA today.

 

 

Remote DBA Service
 

Oracle Tuning Book

Free Oracle dictionary reference poster

BC Oracle support

Oracle books by Rampant

Oracle monitoring software

North Carolina Oracle Users Group

 

 Arabian horse breeder

Seeing eye horses

 

 

Burleson is the American Team

American Flag

 

 

BC Remote Oracle Support
P.O. Box 511 • Kittrell, NC, 27544

Remote DBA

Remote DBA Services

 

Copyright © 1996 -  2011 by Burleson Enterprises. All rights reserved.

Oracle® is the registered trademark of Oracle Corporation.



Hit Counter