Thursday, 3 July 2014

Terminating Concurrent Programs and Locks

Terminating Concurrent Request:

 
Following steps explains to terminate concurrent request completely.

  • Terminate the concurrent request from SRS window and take the concurrent request id.
  • Use below query to know the 'OS.Process id'
 SELECT request_id
             ,oracle_process_id
             ,os_process_id
     FROM fnd_concurrent_requests
    WHERE request_id = &request_id
  • Use the below query to know the 'Session id', 'session serial#'.
 SELECT vs.sid,vp.spid,vs.serial#
     FROM , v$sessions vs
                , v$process  vp
     WHERE vs.paddr = vp.addr
           AND vs.process = &os_process_id
 
  • Kill the session
ALTER SYSTEM KILL SESSION 'session_id, serial#'
or
$kill -9 <server process id>

Terminating locks in database:


Use below query to know the locks.
SELECT   c.owner
       , c.object_name
       , c.object_type
       , b.SID
       , b.serial#
       , b.status
       , b.osuser
       , b.machine
       , b.program
       , b.module
       , b.action
FROM     v$locked_object a
       , v$session b
      , dba_objects c
WHERE    b.SID = a.session_id
AND a.object_id = c.object_id
ORDER BY module

Use below ALTER command to kill the SID and serial combination.

Syntax:
alter system kill session 'SID, serial#' immediate;

Eg:
alter system kill session '816, 8347' immediate;

No comments:

Post a Comment