How to Remove a Session Lock or Kill a Blocking Session

Oracle R12: How to Remove a Session Lock or Kill a Blocking Session

When working with Oracle R12, you may encounter situations where a database session blocks other users or processes. In such cases, you can identify the blocking session and terminate it if necessary.

Step 1: Identify the Blocking Session

Run the following SQL query to find the SID and SERIAL# of the blocking session.

SELECT blocking_session,
       sid,
       serial#,
       event
FROM v$session
WHERE blocking_session IS NOT NULL;

Sample Output

BLOCKING_SESSIONSIDSERIAL#EVENT
12524056789enq: TX - row lock contention

Note: Record the SID and SERIAL# values from the output. These values are required to terminate the session.


Step 2: Kill the Blocking Session

Replace sid and serial# with the values returned by the previous query.

ALTER SYSTEM KILL SESSION 'sid,serial#' IMMEDIATE;

Example

ALTER SYSTEM KILL SESSION '240,56789' IMMEDIATE;

The IMMEDIATE option requests Oracle to terminate the session as soon as possible.



By identifying the blocking session and terminating it when appropriate, you can quickly resolve database locking issues in Oracle R12 and restore normal application performance. 

Comments

Popular posts from this blog

opaque schema xsd (standard file used in OIC)

DOCUMENTATION ON SANDBOX and PERSONALIZATION

EBS R12 QUERY TO GET ALL INVENTORY ORGANIZATIONS IN OPERATING UNITS