ORA-01631 max # extents (string) reached in table string.string
Cause: A table tried to extend past MAXEXTENTS.
ORA-20000: buffer overflow, limit of 2000 bytes
ORA-20000
Programs that rely on PL/SQL can often be hit with run-time errors that occur due to faults in design, problems with coding and a number of other issues. However, one of the great aspects of working with PL/SQL in Oracle is that the user can plan for the errors that frequently arise by creating warnings, or exceptions, to signal them.
The user can have exceptions for items in a database such as “insufficient_budget” that signal when more funding is allocated to a particular budget category than what is owned. When the error occurs, an exception is raised and users can write routines called ‘exception handlers’ that essentially skip over the procedure to allow continuous running. The ORA-20000 concerns these type of user-defined errors as well as other errors that are artificially tacked onto a program to facilitate a database manager’s needs.
The ORA-20000 is a generic error that almost always accompanies another error or a stack of errors. It is part of the reserved section of PL/SQL user-defined errors. The error is caused when a stored procedure (‘raise_application_error’) is called upon. Oracle raises exceptions from the innermost to the outermost error, so when the ORA-20000 is seen in front of a stack of errors, the user knows that the innermost error, or bottom, is the block that can serve as the catalyst.
The amount of information available on the ORA-20000 is minimal due primarily to its open-endedness. Essentially, when a user sees an ORA-20000, their goal is not necessarily to correct the ORA-20000. Instead, they need to resolve the error accompanying an ORA-20000, regardless of whether it is a user-created error or a reserved error. Because the error accompanies several other error messages, let us look at some of the more common combinations for the ORA-20000.
The Solution
One example of the ORA-20000 conjoined with another set of errors is shown below. Suppose the following stack of exceptions are thrown together:
ORA-20000: ORA-20000: ORA-0000: normal, successful completion Update failed for the ch_clnt_mast Line: 632 Execution of ap_old_ib_terms_xfer_dr failed Line: 1045 ORA-06512: at “AEPRDFCRH.ORA_RAISERROR”, line 16 ORA-06512: at “AEPRDFCRH.AP_OL_IB_TERMS_XFER_DR”, line 935
To review, the ORA-06512 is an error caused when the stack is unwound by unhandled exceptions in the code. As previously mentioned, the ORA-06512 error and ORA-20000 error are often triggered together. To fix these errors, the user would need to correct the condition causing the errors or write an exception handler.
To begin correcting the stack of errors, check the code in the lines indicated in the error message. In this particular case, the user-defined error likely occurred due to being place in a WHEN OTHERS exception. Check over the code in line 632 (update failed for the ch_clnt_mast) as well as line 1045 (ap_old_ib_terms_xfer_dr failed). The user will have to remove or work with the exception handlers that are masking the real error message so they can rerun the code to discover what is occurring in the system.
Another common error combination is the ORA-20000: ORU-10027: buffer overflow. DBMS_OUTPUT has various default buffer sizes that all depend on the user’s version of Oracle. In the system, the buffer size limit is 2000 bytes. The user can extend the buffer all the way to 1,000,000 bytes by issuing the statement below:
DBMS_OUTPUT.ENABLE(1000000);
The comparable SQL*Plus statement looks like this:
set serveroutput on size 1000000
If the user is working with Oracle’s 10g release or something more recent, unlimited buffer settings can be set with the following:
DBMS_OUTPUT.ENABLE (buffer_size => NULL);
And the SQL*Plus version:
set serveroutput on size unlimited
This should offset the ORA-20000: ORU-10027, but, if the user conducts this approach and is still triggering the error, it is recommended to look back through the code in full to see if any items are overriding the buffer settings.
Looking forward
The ORA-20000 can be confusing and has such a wide range of responses that it would be impossible to cover them all here. If you find that you are having a difficult time managing the stack, contact your database manager or a licensed Oracle consultant to receive further instruction on correcting the error.
Обработка ошибок Oracle PL/SQL
Я создал триггер, который позволяет пользователю иметь 10 текущих размещенных заказов. Итак, теперь, когда клиент пытается разместить номер заказа 11, база данных оракула возвращает ошибку. Ну, 3 ошибки.
ORA-06512: в строке “C3283535.TRG_ORDER_LIMIT”, строка 12
ORA-04088: ошибка во время запуска триггера C3283535.TRG_ORDER_LIMIT ‘
Верхняя ошибка – это то, что я создал, используя:
raise_application_error (-20000: “В настоящее время у вас 10 или более заказов”.);
Я просто задался вопросом после поиска и пытался много способов изменить сообщения об ошибках для двух других ошибок или даже не показать их всем вместе с пользователем?
Вот код, который я использовал
Большое спасибо Ричард
Происхождение исключения идет от внутреннего к внешнему блоку, в отличие от переменной области, которая идет от внешнего к внутреннему блоку. Для получения дополнительной информации об этом, прочитайте “Макрофлин” “Программирование с помощью PL/SQL”, глава 5.
То, что вы получаете здесь, представляет собой стек исключений – исключения, полученные от самых внутренних блоков до самых внешних блоков.
Когда вы вызываете исключение из триггера, оператор raise_application_error возвращает ошибку.
Если вы используете внешнюю программу, такую как страницы сервера Java или PHP, вы сначала поймаете поднятую ошибку – 20000. Таким образом, вы можете отобразить то же самое для своего конечного пользователя.
РЕДАКТИРОВАТЬ :
Фактически, это характер стека исключений Oracle. Возникают все ошибки от самого внутреннего до самого внешнего блока. Это очень полезно для нас, чтобы определить точный источник ошибок.
В триггере вы можете добавить часть обработки исключений, как показано ниже:
Я вижу, что это довольно старый пост, но я думаю, что читатели должны знать, что
Подобное бизнес-правило непросто обеспечить. Но если вы решите сделать это в триггере, вам лучше сделать это в триггер после инструкции (таким образом, не в триггере перед строкой). Триггер after after по-прежнему не будет видеть результаты других незафиксированных транзакций, но, по крайней мере, текущий оператор находится в определенном состоянии.
ORA-20000 Cause and Solution
Have you gotten the ORA-20000 error when working with Oracle PL/SQL? Learn what causes it and how to resolve it in this article.
ORA-20000 Cause
The ORA-20000 error code is displayed when there is some PL/SQL code that calls RAISE_APPLICATION_ERROR.
Also, the code is displayed along with another, more helpful, error code.
Similar to the ORA-06550 error, the ORA-20000 error often has another error that is the cause of this error.
There are a few common errors that appear when you see the ORA-20000 error, so I’ll mention them here.
ORA-20000 Solution: ORA-10027
Often, the ORA-20000 error is accompanied by the ORA-10027 error:
The ORA-20000 error occurs when using the DBMS_OUTPUT package. This package has all kinds of default buffer sizes, the values of which depend on your version of Oracle.
This example shows that the buffer limit is 2000 bytes, which means you can only output 2000 bytes at a time.
When the ORA-10027 error happens, it means that you have tried to output something that is more than the buffer limit.
To resolve this error, you can increase the buffer limit:
This increases it to 10,000 bytes. You can increase it up to 1,000,000 bytes:
Other Solutions of ORA-20000
Because ORA-20000 is such a generic error and is always accompanied by another error, focus on those errors first.
You can read my guide to the Oracle errors here to find out how to resolve all of the Oracle errors.
Lastly, if you enjoy the information and career advice I’ve been providing, sign up to my newsletter below to stay up-to-date on my articles. You’ll also receive a fantastic bonus. Thanks!
Leave a Comment Cancel Reply
This site uses Akismet to reduce spam. Learn how your comment data is processed.
Ben Brumm DatabaseStar
Popular Posts
Get my book: Beginning Oracle SQL for Oracle Database 18c
ORA-20000: Oracle Text Error (Doc ID 2559087.1)
Last updated on FEBRUARY 10, 2020
Applies to:
Symptoms
SUMMARY_TEXT search is failing intermittently with below errors.
ERROR ———————— Caused By: java.sql.SQLException: ORA-00604: error occurred at recursive SQL level 1 ORA-20000: Oracle Text error: DRG-50610: internal error: drexdsync DRG-50857: oracle error in drekrtd (reselect rowid row locator) ORA-01591: lock held by in-doubt distributed transaction 92.23.227524 ORA-06512: at «CTXSYS.SYNCRN», line 1 ORA-06512: at line 1
Observation:
SUMMARY_TEXT search is working for table FLX_WRF_TRK_SUMMARY_ENTITY_B whereas it is not working for table FLX_DD_NON_FIN_STMT_SUMMARY_B.
Changes
Cause
To view full details, sign in with your My Oracle Support account.
Don’t have a My Oracle Support account? Click to get started!
My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.
Oracle offers a comprehensive and fully integrated stack of cloud applications and platform services. For more information about Oracle (NYSE:ORCL), visit oracle.com. пїЅ Oracle | Contact and Chat | Support | Communities | Connect with us | | | | Legal Notices | Terms of Use