28
34

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Oracleでテーブルロックしているsessionを殺す

Posted at

例: テーブルfoobarをロックしているsessionを探す

SELECT
  object_name,
  oracle_username,
  s.sid,
  s.serial#,
  s.logon_time,
  sql_address
FROM v$locked_object l,
  dba_objects o, 
  v$session s
WHERE l.OBJECT_ID = o.OBJECT_ID
  AND l.SESSION_ID = s.SID
  AND object_name = 'foobar'
;

見つけたsessionをkill

ALTER SYSTEM kill session 'sid, serial';
28
34
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
28
34

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?