运行下列SQL,找出数据库的serial#,执行结果如下图所示
SELECT T2.USERNAME, T2.SID, T2.SERIAL#, T2.LOGON_TIME FROM V$LOCKED_OBJECT T1, V$SESSION T2 WHERE T1.SESSION_ID = T2.SID ORDER BY T2.LOGON_TIME;
然后运行下列SQL关闭锁表的Session,其中sid和serial#是查到的导致锁表的session
alter system kill session 'sid,serial#';
另一种方法是重启Oracle程序~