SQLPLUS automatically saves the executed SQL. When learning oracle, it wants to record the executed commands and results. However, it is not a way to use SQLPLUS to save each time. It is quite troublesome to manually execute the spool, so I made a BAT script for SQLPLUS to implement automatic SPOOL to the file. The content of the www.2cto.com script [plain] @ echo off color 0a echo ************ from you can define SQLPLUS *************** echo ***** to automatically output the date format LOG to the specified location ***** echo ****** * ** Created by Cryking ************ echo *************** 2012.12.25 ******** * ****** sqlplus "/as sysdba" @ d: \ script \ autospool. SQL exit -- autospool. the SQL statement is as follows: [SQL] set feedback off set trimspool on set term off column dt1 new_value filename SELECT TO_CHAR (SYSDATE, 'yyyymmdd') dt1 FROM DUAL; SPOOL D: \ exercise \ study & filename .. txt append runs the script every time to start SQLPLUS, so you don't need to manually SPOOL every time.