oracle数据库 select 'alter system kill session '''||+b.sid||','||b.SERIAL#||''';',b.username,b.sid,b.serial#,logon_time from v$locked_object a,v$session b where a.session_id = b.sid order by b.logon_time; sql server数据库 exec p_lockinfo 0,0;--查看死锁 exec p_lockinfo 1,1;--解锁