检查锁表语句 SELECT substr(v$lock.sid,1,4) "SID", serial#, V$SESSION.sid, substr(username,1,12) "UserName", substr(object_name,1,25) "ObjectName", v$lock.type "LockType", decode(rtrim(substr(lmode,1,4)), '2','Row-S (SS)','3','Row-X (SX)', '4','Share', '5','S/Row-X (SSX)', '6','Exclusive', 'Other' ) "LockMode", substr(v$session.program,1,25) "ProgramName" FROM V$LOCK,SYS.DBA_OBJECTS,V$SESSION WHERE (OBJECT_ID = v$lock.id1 AND v$lock.sid = v$session.sid AND username IS NOT NULL AND username NOT IN ('SYS','SYSTEM') AND SERIAL# != 1); 杀死所占用线程 alter system kill session 'sid, serial#'; -- 对于部分通过此命令无法杀死的线程,可通过执行如下操作解决: -- 1. 查看系统Oracle SPID select spid, osuser, s.program from v$session s,v$process p where s.paddr=p.addr and s.sid='sid' -- 2. 登陆Oracle所在宿主机,使用对应用户,执行如下命令 $ kill -9 spid