How does ORACLE query the locked table and how to unlock and release the session

When ORACLE EBS operates a certain FORM interface, or when the background database operates a certain table, it is found that it has been in a "suspended death" state. It may be that the table is locked by a certain user, which prevents other users from continuing to operate. 

copy code code show as below:

--锁表查询SQLSELECT object_name, machine, s.sid, s.serial# 
FROM gv$locked_object l, dba_objects o, gv$session s 
WHERE l.object_id = o.object_id 
AND l.session_id = s.sid; 


Find the locked table, unlock it 

copy code code show as below:

--释放SESSION SQL: 
--alter system kill session 'sid, serial#'; 
ALTER system kill session '23, 1647'; 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326277662&siteId=291194637