Run this SQL to see what's locking what:
SELECT SUBSTR(TO_CHAR(session_id),1,5) "SID",
SUBSTR(lock_type,1,15) "Lock Type",
SUBSTR(mode_held,1,15) "Mode Held",
SUBSTR(blocking_others,1,15) "Blocking?"
FROM dba_locks
Use this command to get the serial number of the session:
SELECT s.inst_id,
s.sid,
s.serial#,
p.spid,
s.username,
s.program
FROM gv$session s
JOIN gv$process p ON p.addr = s.paddr AND p.inst_id = s.inst_id
WHERE s.type != 'BACKGROUND';
Use this command to kill the session that's holding the lock:
ALTER SYSTEM KILL SESSION '
e.g.
ALTER SYSTEM KILL SESSION '126,19703';
Some good references:
http://www.oracle-base.com/articles/misc/KillingOracleSessions.php
http://www.broadh2o.net/docs/database/oracle/oracleLocks.html
No comments:
Post a Comment