看由各Session 的各Client下SQL指令個數

2013-09-14 12:06
select B.MACHINE,A.sid,A.CNT,to_char(B.LOGON_TIME,'yyyymmdd HH24MIss') as LDATE ,A.SQL_TEXT
from (
 select  sid, SQL_TEXT,count(*) as CNT
   from v$open_cursor
   group by sid,SQL_TEXT order by CNT
) A , v$session B
where A.sid = B.sid
--and B.MACHINE = 'cclsunap2'
order by B.MACHINE,CNT