RelationalDBDesign  
prev next prev next
  Course navigation
 
Lesson 11
Objective
The SPOOL Command
Use Server Manager's SPOOL command.
 
The SPOOL command is used to echo Server Manager's output to a text file. Spooling output to a file is a good thing to do whenever you run a script, or any other command that produces a lot of output. It enables you to review the output later, without having to worry about it scrolling off the top of the screen.
To begin writing output to a file, use the SPOOL command followed by the name of the file to which you want to write the output. You can specify the full directory path of the file if you like. The following examples will work on Windows NT and UNIX respectively:
SPOOL c:\output.txt
SPOOL $HOME/output.txt
All the output will now be written to a file named output.txt in the root directory of your C drive (Windows NT), or to your home directory (UNIX). To stop spooling, use the following command:
SPOOL OFF
I use the SPOOL command whenever I run a critical script, or whenever I execute a critical set of commands, because it gives me a record that I can turn to later if I find out that something went awry.
  Spool Command Exercise
Click on the link below to attempt the [Spool Command Exercise].
Spool Command Exercise
  Course navigation