Hi All, is there a way to find how & why the database package got locked? I am using the following query to see who locked it. But is it possible to see the reason for lock? Please share your thoughts
Oracle Version: 19.14
Query
*******
SELECT s.sid,
l.lock_type,
l.mode_held,
l.mode_requested,
l.lock_id1,
'alter system kill session '''|| s.sid|| ','|| s.serial#|| ''' immediate;' kill_sid
FROM dba_lock_internal l,
v$session s
WHERE s.sid = l.session_id
AND UPPER(l.lock_id1) LIKE '%&package_name%'
AND l.lock_type = 'Body Definition Lock'