第一步:找出被锁的表及相关信息
SELECT 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;
OBJECT_NAME MACHINE SID SERIAL#
------------------------------------------------------------ ----------------------------------- ------- ------------
TEAM_CHECK_ORDER_SPLIT z-PC 600 25
TEAM_CHECK_ORDER_SPLIT z-PC 20 2865
TEAM_CHECK_ORDER_SPLIT z-PC 32 19
TEAM_CHECK_ORDER_SPLIT z-PC 598 193
TEAM_CHECK_SETTLEMENT_DETAIL z-PC 600 25
TEAM_CHECK_SETTLEMENT_DETAIL z-PC 32 19
TEAM_CHECK_SETTLEMENT_DETAIL z-PC 598 193
------------------------------------------------------------ ----------------------------------- ------- ------------
TEAM_CHECK_ORDER_SPLIT z-PC 600 25
TEAM_CHECK_ORDER_SPLIT z-PC 20 2865
TEAM_CHECK_ORDER_SPLIT z-PC 32 19
TEAM_CHECK_ORDER_SPLIT z-PC 598 193
TEAM_CHECK_SETTLEMENT_DETAIL z-PC 600 25
TEAM_CHECK_SETTLEMENT_DETAIL z-PC 32 19
TEAM_CHECK_SETTLEMENT_DETAIL z-PC 598 193
第二步:清理会话
alter system kill session 'sid, serial#';
> ALTER system kill session '600,25';
System altered.
> ALTER system kill session '20,2865';
System altered.
> ALTER system kill session '32,19';
System altered.
> ALTER system kill session '598,193';
System altered.
System altered.
> ALTER system kill session '20,2865';
System altered.
> ALTER system kill session '32,19';
System altered.
> ALTER system kill session '598,193';
System altered.
再次查询:
no rows selected
参考文档:
-The End-
Tank
20180530