top of page

Oracle errors

Открытая·2 пользователя

ORA-00054: resource busy and acquire with NOWAIT specified or timeout expired

RU

Что за проблема

Объект на текущий момент времени заблокирован другим процессом выполняющим манипуляции с ним.


Как определить кто удерживает блокировку

Определить процесс удерживающий блокировку можно запросом:

SELECT o.owner, o.object_name, o.object_type, o.last_ddl_time, o.status, l.session_id,
         l.oracle_username,
       Decode(l.locked_mode, 0, 'None',
                             1, 'Null (NULL)',
                             2, 'Row-S (SS)',
                             3, 'Row-X (SX)',
                             4, 'Share (S)',
                             5, 'S/Row-X (SSX)',
                             6, 'Exclusive (X)',
                             l.locked_mode) locked_mode,
       ss.SQL_ID,
       s.SQL_TEXT
FROM dba_objects o, v$locked_object l , v$session ss, v$sql s
WHERE o.object_id = l.object_id
  and l.SESSION_ID = ss.SID(+)
  and ss.SQL_ID = s.SQL_ID(+)
  and o.object_name = ':OBJECT_NAME'
  and o.owner = ':OWNER'

Решение

Завершить принудительно сессию удерживающую блокировку.

alter system kill session 'SID,SERIAL#'

Могут быть нюансы, блокировка может удерживаться сессией выполняющей откат или вызвана из pl/sql кода выполняющего обработку данных.


Подождать завершения сессии удерживающей блокировку

alter session set ddl_lock_timeout = 600; --10 минут


EN

What's the problem

The object is currently locked by another process that is manipulating it.


How to determine who is holding a lock

You can determine the process holding the lock by requesting:

SELECT o.owner, o.object_name, o.object_type, o.last_ddl_time, o.status, l.session_id,
         l.oracle_username,
       Decode(l.locked_mode, 0, 'None',
                             1, 'Null (NULL)',
                             2, 'Row-S (SS)',
                             3, 'Row-X (SX)',
                             4, 'Share (S)',
                             5, 'S/Row-X (SSX)',
                             6, 'Exclusive (X)',
                             l.locked_mode) locked_mode,
       ss.SQL_ID,
       s.SQL_TEXT
FROM dba_objects o, v$locked_object l , v$session ss, v$sql s
WHERE o.object_id = l.object_id
  and l.SESSION_ID = ss.SID(+)
  and ss.SQL_ID = s.SQL_ID(+)
  and o.object_name = ':OBJECT_NAME'
  and o.owner = ':OWNER'

Solution

Force terminate the session holding the lock.

alter system kill session 'SID, SERIAL#' 

There may be nuances, the lock can be held by the session performing the rollback or called from the pl/sql code that processes the data.


Wait for the session to end holding the lock

alter session set ddl_lock_timeout = 600; --10 minutes

287 просмотров

О группе

Discussion of family errors ORA-***** in Oracle DBMS and way...

Участники

bottom of page