查詢程式使用的cursor 數量

tolywang發表於2010-06-23


SELECT   a.inst_id,
         a.sid,
         a.USERNAME,
         a.SCHEMANAME,
         a.OSUSER,
         a.machine,
         a.TERMINAL,
         a.LOGON_TIME,
         a.PROGRAM,
         a.STATUS,
         b.name,
         b.used
  FROM   gv$session a,
         (SELECT   n.inst_id, sid, n.name, s.VALUE used
            FROM   gv$statname n, gv$sesstat s
           WHERE   n.name IN
                         ('opened cursors current',
                          'session cursor cache count')
                   AND s.statistic# = n.statistic# and n.inst_id=s.inst_id ) b
 WHERE   a.sid = b.sid and a.inst_id = b.inst_id
 and b.name <> 'session cursor cache count'
 order by b.used desc   

 

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/35489/viewspace-665939/,如需轉載,請註明出處,否則將追究法律責任。

相關文章