ORA-20000 ORU-10027 Using DBMS_OUTPUT Procedure (Doc ID 1034353.6)

Last updated on JULY 05, 2017

Applies to:

PL/SQL - Version 9.2.0.8 and later
Oracle Database - Enterprise Edition - Version 9.2.0.8 and later
Information in this document applies to any platform.
***Checked for relevance on 14-Jun-2017***

Symptoms

When running a procedure that uses DBMS_OUTPUT an ORA-20000 and an ORU-10027 error may return even if serveroutput was not enabled in SQL*Plus.


ORA-20000: <application_specific_message>
Cause: The stored procedure RAISE_APPLICATION_ERROR was called,
       which causes this message to be generated.
Action: Correct the problem as described in the message or contact
        the application administrator or database administrator 
        for more information.


The following example demonstrates the error.

1 - Create the stored procedure.

create or replace procedure blowup as
   i number;
begin
   for i in 1..2000 loop
      dbms_output.put_line('123456789012345678901234567890123456789012345');
   end loop;
end;
/


2 - Execute the procedure

SQL> execute blowup

PL/SQL procedure successfully completed.


3 - This enables the output and shows the serveroutput is off.

SQL> execute dbms_output.enable(2000);

PL/SQL procedure successfully completed.

SQL> show serveroutput
serveroutput OFF


4 - The following executes the procedure and produces the error.

SQL> execute blowup
BEGIN blowup; END;

*
ERROR at line 1:
ORA-20000: ORU-10027: buffer overflow, limit of 2000 bytes
ORA-06512: at "SYS.DBMS_OUTPUT", line 32
ORA-06512: at "SYS.DBMS_OUTPUT", line 97
ORA-06512: at "SYS.DBMS_OUTPUT", line 112
ORA-06512: at "T1.BLOWUP", line 5
ORA-06512: at line 1

Cause

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 hundreds of Community platforms