Generally we use
sqlplus spool command to record the sql command outputs to a file. It will
record the command outputs between spool
on and spool off. Generally once
you done with the spool off command the output file will be closed from the
Oracle 10g onwards
one more option added to the spool
command to append the sql command to an existing file.