SQL*Plus not showing headings

On one database, I noticed that SQL*Plus did not show the heading of the columns when I ran a query. The result was this:

SQL> select instance_name,status from v$instance;
mydb          OPEN

Even when entering “set heading on” didn’t change anything. I then investigated and found out that someone had changed the $ORACLE_HOME/sqlplus/admin/glogin.sql file (SQL*Plus runs this file on startup) and added the following lines:

SET LINESIZE 150
SET PAGESIZE 0

While this is quite nice and replaced the suboptimal default values, this was the cause for my problems mentioned above. Changing the line “SET PAGESIZE 0” to “SET PAGESIZE 1000” solved the problem and now, the query shows up the way I wanted:

SQL> select instance_name,status from v$instance;

INSTANCE_NAME    STATUS
---------------- ------------
mydb             OPEN

Hello world

My name is Simon Krenger, I am a Technical Account Manager (TAM) at Red Hat. I advise our customers in using Kubernetes, Containers, Linux and Open Source.

Elsewhere

  1. GitHub
  2. LinkedIn
  3. GitLab