Saturday, July 16, 2011

Information to get the current session SQL statement execution details

Very often we need to know which SQL statement is running within a running concurrent program.Below SQL script can give you details of the same.

select vsq.sql_text
from  fnd_concurrent_requests fcr
       , V$PROCESS vp
       , V$SESSION vs
       , V$SQL vsq   
where fcr.request_id = :request_id
and  fcr.oracle_process_id=vp.spid
and  vs.sql_address = vsq.address    
and  vs.paddr=vp.ADDR ;

> You can also query the V$SQL table with Concurrent Program short name and can get all the SQLs   running.

Select vsq.sql_text
   from V$SQL vsq
 where  module = :Conc_prog_Short_name ;

> If you are using TOAD, you can also check the running Concurrent Program details in Schema browser.

No comments:

Post a Comment