Ошибка ora 08103 object no longer exists

Портал IT-специалистов: программирование, администрирование, базы данных

Интересная ошибка – «Объект больше не существует». Но в словаре о нем есть сведения. То в чем же дело?

Возможные варианты:

  • После начала рабочие мероприятия вашей сессии, кто-то удалил таблицу. Хотя реально я не представляю, как это может быть. Есть же блокировки.
  • Было выполнено неполное восстановление на момент времени, когда таблица удалялась.
  • Таблица имеет логическую коррупцию
  • Проблемы с индексами.

Как побороть эту ошибку? Варианты:

  • Нужна ли на самом деле эта таблица? Если не нужна, то удаляем. Нет таблицы — нет проблемы.
  • Пересоздать индексы ( удалить, а затем создать)
  • Перенести таблицу в другое табличное пространство
  • Удалите таблицу и восстановите ее из копии

Обычно

ANALYZE TABLE  VALIDATE STRUCTURE
DBV

в этом случае беспомощны.

Вас заинтересует / Intresting for you:

blaginov1955 аватар

Спасибо за подсказанное решение с ошибкой ORA-08103

apv аватар

apv ответил в теме #8757 5 года 8 мес. назад

Да, ошибка довольно частая. Перестройка индексов действительно часто решает проблему.

ildergun аватар

Спасибо за предложенное практическое решение проблемы!

Ваш аккаунт

Разделы

ORA-08103 occurs when we try to run a DDL statement against an object which doesn’t exist. Ah, but you say

they are always there. They will never be dropped

Database objects like tables have two identifiers in the data dictionary, the OBJECT_ID and the DATA_OBJECT_ID: we can see these in the ALL_OBJECTS view. The OBJECT_ID is constant for the lifetime of the table but the DATA_OBJECT_ID — the «dictionary object number of the segment that contains the object» — changes any time DDL is executed against the object. For instance, when a table is truncated or an index is rebuilt.

So to your situation: the ORA-08103 error indicates that the DATA_OBJECT_ID has changed since you ran the cursor. That is while you were running your procedure somebody else executed DDL against one of the tables, constraints or underlying indexes.

Probably this is an unfortunate coincidence and it won’t happen the next time you run the procedure. But you can minimize the chances of another occurrence by changing the way you run the query:

declare
    tabs dbms_debug_vc2coll := dbms_debug_vc2coll ('TABLE_01', 'TABLE_02', 'TABLE_03', 'TABLE_04');
BEGIN
    for idx in 1..tabs.count() loop
        FOR c IN (
            SELECT
                c.owner,
                c.table_name,
                c.constraint_name
            FROM user_constraints c
            WHERE c.table_name = tabs(idx)
            AND c.status = 'DISABLED'
          ) LOOP
             EXECUTE IMMEDIATE 'ALTER TABLE ' || c.table_name || ' ENABLE CONSTRAINT ' || c.constraint_name;
        END LOOP;
    END LOOP;
END;

Enabling constraints takes time (because of the need to validate them). So selecting tables one by one reduces the time you need the DATA_OBJECT_ID to remain fixed.


«How does your procedure above minimize the chance of the same error?»

Your cursor selects all four tables, and hence all four DATA_OBJECT_IDs. Suppose another session modifies TABLE_04 while you are enabling constraints on TABLE_01. When your procedure gets round to TABLE_04 the DATA_OBJECT_ID has changed and you’ll get ORA-08103.

But if you were running my version of the code it wouldn’t matter, because you would not select the DATA_OBJECT_ID for TABLE_04 until you were ready to process it. So you would get the changed DATA_OBJECT_ID (without knowing it was changed.

Причины появления ошибки ORA-08103: object no longer exists при работе с партиционированными таблицами.
Проблемая ситуация: при асихронной работе нескольких процессов возникает ошибка  ORA-08103. Каждый процесс работает с одной таблицей, партиционированной по составному ключу; использовались операторы DDL для работы с партициями (создание, очистка) и DML (запросы, пакетная вставка). Каждый процесс работает только со своим диапазоном партиций, а запросы ограничиваются для чтения только из этих партиций. Ошибка возникает только при параллельной работе нескольких процессов.

Итак, вот ситуации, при которых возникает ошибка ORA-08103:

  • при выполнении запроса в сессии 1 к непартиционированной таблице происходит TRUNCATE TABLE в сессии 2. Причина: TRUNCATE вызывает обновление адреса сегмента, связанного с таблицей (SYS.DBA_OBJECTS.DATA_OBJECT_ID). Решение: пересмотр алгоритма;
  • при выполняющимся запросе в сессии 1 происходит создание партиций с помощью SPLIT PARTITION в сессии 2. Причина: при разрезании партиции DEFAULT на две у партиции DEFAULT обновляется адрес сегмента данных. Решение: использовать ADD PARTITION — в этом случае имеющиеся партиции остаются без изменений;
  • при выполняющимся запросе в сессии 1, выбирающим данные из партиции А происходит TRUNCATE PARTITION A в сессии 2. Причина: та же, что и в предыдущих случаях. Решение: пересмотр алгоритма. Деталь: даже если в плане запроса фигурирует PARTITION LIST ALL, но запрос не выбирает данные из очищаемой партиции (например, where id = p_id or p_id is null), ошибка не возникает.

Yesterday, application team informed us about production job failure with error: ORA-08103 Object no longer exists. It was simple select query on object with type VIEW. I tried rerunning query which ran without any issue.

I tried to investigate, if the underlying objects have been dropped when job was running. But object creation time was in the year 2014 so definitely object was not dropped & recreated and it was present during job execution.

I tried to search in metalink support & found following note explaining issue:

OERR: ORA-8103 “object no longer exists” Master Note / Troubleshooting, Diagnostic and Solution (Doc ID 8103.1)

According to note: We get this error when, tables are being dropped/truncated while a SQL statement for those tables is still in execution. In the case of an index, it might be caused by an index rebuild. In other words the object has been deleted by another session since the operation began.

I had a look into aud$ & found one of the underlying table in view was truncated at same time when job was executing select on view. So I got the culprit 🙂

But why oracle gave error: ORA-08103 Object no longer exists even when object was present???

If you check DBA_OBJECTS dictionary view, it has two columns OBJECT_ID & DATA_OBJECT_ID. Each object is assigned a unique number to recognise it in the database (OBJECT_ID). In the same manner, each object is linked to a segment. The data object id is assigned to that segment and any kind of change done on the physical segment would lead to give a change in that number (DATA_OBJECT_ID). Both the numbers are same initially but when the modifications happen on the segment, the DATA_OBJECT_ID changes. Both the OBJECT_ID and DATA_OBJECT_ID are the numbers used by oracle to denote the metadata for the object that is used within the data dictionary. Operations such as Truncate, Move, Rebuild Index, Spilt Partition etc would cause change in DATA_OBJECT_ID of the objects.

So this gives enough justification for oracle error: ORA-08103 Object no longer exists!!

Hope so u will find this post very useful:-)

Cheers

Regards,

Adityanath

I am getting this error from Oracle intermittently. A trigger is truncating a partition from a partitioned table while a long-running query is running against it.

Since I’m truncating a different partition than the ones I’m intending to query, I expect this to work. I suspect a rogue query plan, doing PARTITION LIST (ALL) where I want (ITERATOR) or (JOIN-FILTER).

The query is complex, joining multiple partitioned tables.

So my question is: can I get any more detail out of Oracle to figure out precisely which table (or index) in the query is causing the problem? And is there any way I can capture the query plan that was in effect when the error occurred? (which could be different than the plan if I look at it right now)

Colin 't Hart's user avatar

asked Jul 22, 2012 at 2:02

wrschneider's user avatar

How intermittently are you getting the error?

Do you have any logging in the trigger that is truncating a partition? You could use a simple procedure that writes (in an autonomous transaction) some information about which partition is being truncated.

Also create the on servererror trigger as suggested by Leigh Riffel, and log the query and error stack.

Finally, I would enable tracing of all occurrences of the long running query (assuming this query isn’t executed all too often!):

alter session set sql_trace = true;
alter session set tracefile_identifier = wrschneider08103;

before the query and

alter session set sql_trace = false;

after.

Then, once the error has again reared its ugly head, run tkprof on the last trace file with ‘wrschneider08103’ in its name…

Hopefully you’ll be able to correlate the information you’ve thus collected.

answered Jul 25, 2012 at 19:58

Colin 't Hart's user avatar

Colin ‘t HartColin ‘t Hart

9,10215 gold badges34 silver badges43 bronze badges

1

You should be able to get some of this information using a ServerError Trigger.

answered Jul 23, 2012 at 13:02

Leigh Riffel's user avatar

Leigh RiffelLeigh Riffel

23.8k16 gold badges76 silver badges149 bronze badges

2

  • Ошибка ora 06550 pls 00201
  • Ошибка ora 06413 соединение не открыто
  • Ошибка ora 04088 error during execution of trigger
  • Ошибка ora 03113 end of file on communication channel
  • Ошибка ora 02291 integrity constraint