User resource usage

posted Sep 27, 2010, 6:37 AM by Sachchida Ojha   [ updated Sep 27, 2010, 6:38 AM ]
SELECT   DECODE(ses.username, NULL, 'SYS', ses.username) username,
         TO_CHAR(ses.SID) SID, sn.NAME, sest.VALUE, ins.instance_name,
         DECODE(ses.username, NULL, 'SYS', ses.username) || TO_CHAR(ses.SID) usersid
    FROM gv$session ses, gv$statname sn, gv$sesstat sest, gv$instance ins
   WHERE ses.SID = sest.SID
     AND sn.statistic# = sest.statistic#
     AND sest.VALUE IS NOT NULL
     AND sest.VALUE != 0
     AND ses.INST_ID = sn.INST_ID
     AND ses.INST_ID = sest.INST_ID
     AND ses.INST_ID = ins.INST_ID
ORDER BY ses.username, ses.SID, upper(sn.NAME);
Comments