How to dump Oracle sqlplus output to a file

Vignesh A Sathiyanantham
1 min readFeb 8, 2020

--

The SPOOL is a command causes SQLPlus to write the results to a file on the operating system.

Once spool is set, SQLPlus will continue to spool the output until the command SPOOL OFF.

Note that the file cannot be seen or used until the SPOOL OFF command.

The spool command is very useful when you want to generate SQL from the data dictionary. Here is the Syntax of a SQLPlus spool command:

SPOOL <output file path>
SPOOL OFF

Example:

spool begin_backup.log;
alter database begin backup;
spool off;

Originally published at asvignesh.

--

--

Vignesh A Sathiyanantham
Vignesh A Sathiyanantham

Written by Vignesh A Sathiyanantham

Decade of experience in building product related to private datacenter and public cloud #Java #AWS #VMware #Python

No responses yet