Top IO session


/* create table */ INSERT INTO  t1 /* AS */  SELECT s.sid,s.value FROM v$sesstat s, v$statname n WHERE s.statistic# = n.statistic#
 AND  n.name = 'physical reads' ORDER BY value DESC;
 
 exec dbms_lock.sleep(20);
 
 /* CREATE TABLE */ INSERT INTO  t2 /* AS */ SELECT s.sid,s.value FROM v$sesstat s, v$statname n WHERE s.statistic# = n.statistic#
 AND  n.name ='physical reads' ORDER BY value DESC;
 
 commit;
 
 SELECT t1.sid, t2.value-t1.value,p.spid,s.username,s.machine,s.module,s.program,a.SQL_TEXT  FROM t1, t2,v$session s , v$process p ,v$sql a  WHERE 
 t1.sid=t2.sid  AND
 t1.sid=s.sid AND
 s.paddr=p.addr  AND
 s.SQL_HASH_VALUE=a.HASH_VALUE  
 ORDER BY   t2.value-t1.value DESC ;
 
 
 /* drop table t1;  */
 /* drop table t2;  */
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: