Call now: 252-767-6166  
Oracle Training Oracle Support Development Oracle Apps

 
 Home
 E-mail Us
 Oracle Articles
New Oracle Articles


 Oracle Training
 Oracle Tips

 Oracle Forum
 Class Catalog


 Remote DBA
 Oracle Tuning
 Emergency 911
 RAC Support
 Apps Support
 Analysis
 Design
 Implementation
 Oracle Support


 SQL Tuning
 Security

 Oracle UNIX
 Oracle Linux
 Monitoring
 Remote s
upport
 Remote plans
 Remote
services
 Application Server

 Applications
 Oracle Forms
 Oracle Portal
 App Upgrades
 SQL Server
 Oracle Concepts
 Software Support

 Remote S
upport  
 Development  

 Implementation


 Consulting Staff
 Consulting Prices
 Help Wanted!

 


 Oracle Posters
 Oracle Books

 Oracle Scripts
 Ion
 Excel-DB  

Don Burleson Blog 


 

 

 


 

 

 
 

Find SQL with most updates

Oracle Database Tips by Donald BurlesonMay 29, 2015

 

Question:  I want to find the SQL statements that are generating the largest amount of redo log activity.  I don't see a correlation between v$session and the redo log activity.  How can I find the DML session hogs?

 

Answer:  Yes, you are correct that there is no direct connection between DML activity and redo log activity, but you can inspect v$session and v$bgprocess and get an idea which sessions are doing lots of DML.  The SQL (DML) statements updates data blocks and the DBWR process writes these block back to the database, causing redo.

Another indirect way to see the top DML causing redo activity is to use Oracle LogMiner, which re-constructs the DML statements based upon the redo log entries.

For advanced DBA's, there are also scripts in the the Oracle scripts download.  

This script queries the v$statname, v$sesstat, v$session, and v$bgprocess views.  This script will show SQL with high updates to the database:

select
   sid,
   username,
   round(100 * total_user_io/total_io,2) tot_io_pct
from
(select
     b.sid sid,
     nvl(b.username,p.name) username,
     sum(value) total_user_io
 from
     sys.v_$statname c, 
     sys.v_$sesstat a,
     sys.v_$session b,
     sys.v_$bgprocess p
 where
   see code depot for full script
      a.statistic#=c.statistic# and
      p.paddr (+) = b.paddr and
      b.sid=a.sid and
      c.name in ('physical reads',
                 'physical writes',
                 'physical writes direct',
                 'physical reads direct',
                 'physical writes direct (lob)',
                 'physical reads direct (lob)')
group by
      b.sid, nvl(b.username,p.name)),
(select
      sum(value) total_io
 from
      sys.v_$statname c,
      sys.v_$sesstat a
 where
      a.statistic#=c.statistic# and
      c.name in ('physical reads',
                 'physical writes',
                 'physical writes direct',
                 'physical reads direct',
                 'physical writes direct (lob)',
                 'physical reads direct (lob)'))
order by
      3 desc;

If you are a DBA that wants to see the total I/O picture (in other words, both logical and physical I/O), then use the totpctio.sql  query instead.

See other session I/O detection scripts here.

 

   
Oracle Training from Don Burleson 

The best on site "Oracle training classes" are just a phone call away! You can get personalized Oracle training by Donald Burleson, right at your shop!

Oracle training
 
 


 

 

Burleson is the American Team

Note: This Oracle documentation was created as a support and Oracle training reference for use by our DBA performance tuning consulting professionals.  Feel free to ask questions on our Oracle forum.

Verify experience! Anyone considering using the services of an Oracle support expert should independently investigate their credentials and experience, and not rely on advertisements and self-proclaimed expertise. All legitimate Oracle experts publish their Oracle qualifications.

Errata?  Oracle technology is changing and we strive to update our BC Oracle support information.  If you find an error or have a suggestion for improving our content, we would appreciate your feedback.  Just  e-mail:  

and include the URL for the page.


                    









Burleson Consulting

The Oracle of Database Support

Oracle Performance Tuning

Remote DBA Services


 

Copyright © 1996 -  2017

All rights reserved by Burleson

Oracle ® is the registered trademark of Oracle Corporation.

Remote Emergency Support provided by Conversational

 

 

��  
 
 
Oracle Training at Sea
 
 
 
 
oracle dba poster
 

 
Follow us on Twitter 
 
Oracle performance tuning software 
 
Oracle Linux poster