Find locks on a table

Using the step below one can find the locks on the table by looking for object id. Example: Window 1: SQL> update scott.test1 set x = 200; 16 rows updated. SQL> select userenv(‘sid’) from dual; USERENV(‘SID’) ————– 19 Window 2: SQL> select object_id from dba_objects where object_name = ‘TEST1’ and owner = ‘SCOTT’; OBJECT_ID ———- 13846 SQL> select * FROM V$lock where id1 = 13846; … Continue reading Find locks on a table

How to resolve user locking problems

Method 1: Check and remove session locking other from Database Find the USER locking others Select a.serial#, a.sid, a.username, b.id1, c.sql_text from v$session a, v$lock b, v$sqltext c where b.id1 in (select distinct e.id1 from v$session d, v$lock e where d.lockwait = e.kaddr) and a.sid = b.sid and c.hash_value = a.sql_hash_value and b.request = 0; Output: USER SERIAL# SID USERNAME ID1 SQL_TEXT 13 23 ALIMA … Continue reading How to resolve user locking problems