The long and short of it is that the command is as below.
SET SERVEROUTPUT ON
There’s quite a misconception between DBMS_OUTPUT.ENABLE and SERVEROUTPUT directives. The SERVEROUTPUT tells Oracle to dump the buffer(i.e, sent via DBMS_OUTPUT.PUT_LINE) while the DBMS_OUTPUT.ENABLE starts the buffer messages which you may access by GET_LINE/GET_LINES.
SERVEROUTPUT directive does two things:
- Issue DBMS_OUTPUT.ENABLE command
- Tells SQLPLUS to dump the output after each statement
Relevant discussion is at AskTom’s question and answer page