Unlock An Oracle Table Unlock An Oracle Table oracle oracle

Unlock An Oracle Table


Option 1:

Well, one of the options is to rollback the locked SQL statement. For an instance,

lock table table1 in exclusive mode;  -- is what you should've used to lock the table.

To unlock: rollback;

Option 2:

To find username and sid:

select * from v$locked_object;

To find serial# using sid:

select * from v$session where sid= put the sid you found on v$locked_object;

To kill session:

alter system kill session 'sid, serial#'; -- Execute this command as sysdba as normal user won't have privilege. 


You can also try to execute just

COMMIT;

or

ROLLBACK;

in this session.