chris01
chris01

Reputation: 12331

Oracle SQLPLUS: immediately flush SPOOL output

I am logging my SQLPLUS session to a file.

SPOOL mylog.txt

But if I doing commands with a short output

e.g.

SELECT * FROM DUAL;

it is not immediately put into the file. It takes some commands. If it is a command with a large output it happens instantly.

So I think it is some sort of buffer that needs to be filled before writing to the file.

I tried

SET FLUSH ON

but is did not do the trick.

How can I tell SPOOL to flush the buffer immediately?

Upvotes: 1

Views: 2093

Answers (1)

Littlefoot
Littlefoot

Reputation: 142733

You can't (as far as I can tell).

Data is spooled in chunks of 8K (typically, as Ask Tom says) so, until you fill the buffer (or issue spool off), you won't see anything.

Upvotes: 4

Related Questions