You are on page 1of 1

-------------- Query to find the SQL text of procedure running in MIS---------select module, a.sid,machine, b.

SQL_TEXT,piece from v$session a,v$sqltext b


where status='ACTIVE'
and a.SQL_ADDRESS=b.ADDRESS
and a.USERNAME='MIS'
--and sid=23
order by sid,piece;
---------NOTE:- if proc runs on biadhoc then a.usrename= 'BIADHOC'-------------------------------total no. of distinct SID(for proc)------------select count(distinct sid) from v$session a,v$sqltext b
where status='ACTIVE'
and a.SQL_ADDRESS=b.ADDRESS
and a.USERNAME='MIS';

You might also like