SQL> select username,sid,serial# from v$session;
USERNAME SID SERIAL#
------------------------------ ---------- ----------
SYS 10141 53
ADRIANO 10234,24
已选择2行。
SQL> alter system kill session'10234,24';
系统已更改。
SQL> drop user ADRIANO cascade;
先杀session之后,再删除用户对象
select sess.sid,
sess.serial#,
lo.oracle_username,
lo.os_user_name,
ao.object_name,
lo.locked_mode
from v$locked_object lo,
dba_objects ao,
v$session sess
where ao.object_id = lo.object_id and lo.session_id = sess.sid;
SELECT *
FROM V$SESSION s, sys.x$kglob o, sys.x$kglpn p
WHERE upper(o.kglnaobj) LIKE upper('%不能编译的包体%')
AND p.kglpnhdl = o.kglhdadr
AND s.SADDR = p.kglpnuse;
select * from v$session t1, v$locked_object t2 where t1.sid = t2.SESSION_ID;
alter system kill session '144,46679' ;
SELECT * FROM V$DB_OBJECT_CACHE WHERE OWNER='TJSPFMS2008_LOGIN' AND LOCKS !='0';
SELECT SID,SERIAL#,PADDR FROM V$SESSION WHERE SID=385
SELECT SPID FROM V$PROCESS WHERE ADDR='0000000269230498'
再一次查询目前锁定的对象,若发现以上方法不能解除锁定的表,则用以下方法: