步骤1:用以下SQL查看进程列表,判断出被锁定的表
SELECT dob.OBJECT_NAME Table_Name,lo.SESSION_ID||', '||vss.SERIAL# 删除号,
lo.locked_mode,lo.SESSION_ID, vss.SERIAL#,vss.action Action,vss.oSUSEr OSUSER, vss.LOGON_TIME,
vss.process AP_PID, VPS.SPID DB_PID ,vss.*
From v$locked_object lo, dba_objects dob, v$session vss, V$PROCESS VPS
Where lo.OBJECT_ID = dob.OBJECT_ID
and lo.SESSION_ID = vss.SID
AND VSS.paddr = VPS.addr
order by 2,3,DOB.object_name
或者
SELECT /*+ rule */ lpad(' ',decode(l.xidusn ,0,3,0))||l.Oracle_username User_name,
o.owner,o.object_name,o.object_type,s.sid,s.serial#
FROM v$locked_object l,dba_objects o,v$session s
WHERE l.object_id=o.object_id
AND l.session_id=s.sid
ORDER BY o.object_id,xidusn DESC
--查找被锁表
步骤2 删除进程,如之前的“删除号”查找出的结果为“286, 2184”,则运行以下SQL
ALTER system kill session '286, 2184'
相关阅读:
Oracle 10g 安装后重启系统,用PLSQL连接报没有监听
ORA-03114 PLSQL过程编译断开连接错误
PLSQL 连接 Oracle简单配置
PLSQL批量Forall操作性能提升详解
使用Oracle SQLDeveloper连接数据库并创建用户
Oracle自带的PL/SQL Developer导入导出数据
在64位Win7系统下安装Oracle 11g和Oracle SQL Developer客户端