You can use the following SQL statement in PL/SQL to query which tables in the current database are locked and which users are locking these tables:
Select
A. Owner, -- user to which the object belongs
A. object_name, -- Object Name (table name)
B. xidusn,
B. xidslot,
B. xidsqn,
B. session_id, -- lock the table user's session
B. oracle_username, -- Oracle username of the table lock user
B. OS _user_name, -- lock table user's operating system login Username
B. process,
B. locked_mode,
C. Machine, -- lock table user's computer name (for example, workgroup \ USERNAME)
C. Status, -- lock Table Status
C. server,
C. Sid,
C. Serial #,
C. Program-database management tools used by table lock users (for example, ob9.exe)
From
All_objects,
V $ locked_object B,
SYS. GV _ $ Session C
Where
A. object_id = B. object_id
And B. Process = C. Process
Order by 1 and 2 can be used to kill the items in the current lock table at the same time by the following command:
Alter system kill session 'sid, serial #'
-- For example: Alter system kill session '201801025'
From: http://hi.baidu.com/crsky2008/blog/item/1402fa3889ecb1d0d562259f.html