Remove Oracle table row lock
STEP 1: To identify the SID for the table with the lock, you will use this system ID in a later query to get the serial number for the table row lock:
Output :
STEP 2: The next step is a script to find the Serial# for the table row lock :
STEP 3: Finally, we can use the "alter system" command to kill the session that is holding the table lock:
SQL> select * from dba_dml_locks;
SQL> select
session_id
from
dba_dml_locks
where
name = 'EF_AP_BALANCE';
session_id
from
dba_dml_locks
where
name = 'EF_AP_BALANCE';
Output :
SID
___
607
___
607
STEP 2: The next step is a script to find the Serial# for the table row lock :
SQL> select
sid,
serial#
from
v$session
where
sid in (
select
session_id
from
dba_dml_locks
where
name = 'F_AP_BALANCE');
sid,
serial#
from
v$session
where
sid in (
select
session_id
from
dba_dml_locks
where
name = 'F_AP_BALANCE')
Output :
SID SERIAL#
---- -------
607 1402
---- -------
607 1402
alter system kill session 'SID,SERIALl#';
SQL> alter system kill session '607,1402';
No comments:
Post a Comment