Showing posts with label Kill Long Running Job in R12. Show all posts
Showing posts with label Kill Long Running Job in R12. Show all posts

Tuesday, March 10, 2020

How to Kill Long Running Concurrent Job in R12


Step1 : Find SID and Serial Number for Concurrent Job
SELECT a.request_id, d.sid, d.serial# ,d.osuser,
d.process , c.SPID ,d.inst_id
FROM apps.fnd_concurrent_requests a,
apps.fnd_concurrent_processes b,
gv$process c,
gv$session d
WHERE a.controlling_manager = b.concurrent_process_id
AND c.pid = b.oracle_process_id
AND b.session_id=d.audsid
AND a.request_id =:REQUESTID
AND a.phase_code = 'R';

Step2: Kill the long running session 

--ALTER SYSTEM KILL SESSION 'SID, serial#' IMMEDIATE;
ALTER SYSTEM KILL SESSION '1201, 40153' IMMEDIATE;

Step3 : Terminate the Concurrent Request and commit the transaction

 update fnd_concurrent_requests
   set status_code='X', phase_code='C'
   where request_id=:REQUESTID;
  
  
commit;