Pavan DBA's Blog

The DBA Knowledge Store

Script to identify users generating more redo

Posted by Pavan DBA on February 7, 2012


Many a times we would need to know the users who are causing more redo generation. Hope the following script will help us from now onwards

col machine for a15 
col username for a10 
col redo_MB for 999G990 heading “Redo |Size MB”
column sid_serial for a13; 
  

select b.inst_id,  
       lpad((b.SID || ‘,’ || lpad(b.serial#,5)),11) sid_serial,  
       b.username,  
       machine,  
       b.osuser,  
       b.status,  
       a.redo_mb   
from (select n.inst_id, sid,  
             round(value/1024/1024) redo_mb 
        from gv$statname n, gv$sesstat s 
        where n.inst_id=s.inst_id 
              and n.name = ‘redo size’
              and s.statistic# = n.statistic# 
        order by value desc
     ) a, 
     gv$session b 
where b.inst_id=a.inst_id  and a.sid = b.sid  and   rownum <= 10  and b.username is not null;

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: