Crave for Oracle
This blog holds the content which will be helpful for Oracle developers.
Saturday, July 3, 2021
Monday, June 21, 2021
How to kill an active session in Oracle apps
Hi, This post shows the queries to find an active sessions for an object and kill the session.
Note: Use the query to kill a session only if you have authorized to kill the session.
Query to see if the object has an active session:
SELECT B.Owner, B.Object_Name, A.Oracle_Username, A.OS_User_Name, session_id
FROM V$Locked_Object A, All_Objects B
WHERE A.Object_ID = B.Object_ID
and b.object_id =:p_object_id;
Query to find the sis and serial# based on session id that is fetched from the above query:
select * from v$session where sid = '2777';
Command to kill the session using sis and serial#:
alter system kill session '2777,23685';
Happy learning. Cheers!!
Subscribe to:
Comments (Atom)