You may save your SQL commands into a script file and retrieve/use it later.
The script will significantly improve your efficiency and consistency. It
is a necessary tool for database administration.
If you like to save your commands in SQL Plus buffer and reuse it later,
you may issue the following command:
SQL>SAVE d:\tec5323\ exmaple.sql
You may save your file in different directory other than
d:\tec5323 directory. However, you will need to create the directory before
you use it. The default file extension is sql if you do not specify
it. It is a good idea to specify the SQL file extension.
If the file already exists and you want to replace the file, you may
use:
SQL>SAVE d:\tec5323\ exmaple.sql REPLACE
If you like to retrieve your saved SQL script file into your SQL Plus
buffer, use the following command:
SQL>GET d:\tec5323\example1.sql
After the file is retrieved into the SQL Plus buffer, you may edit, list
or execute it as described on tips above.
Another way to use the script is to use the following command:
SQL>@d:\tec5323\example1.sql
In this way, you will be able to execute all the actions with one command
and run them consistently over time.