- Enter the DOS interface.
- Enter the SQL file directory.
- Run Sqlplus,c:\sql>sqlplus user_name/[email protected]_service_name at the command prompt
- Specify the SQL execution log file, log filename arbitrary, but must be a log suffix name: Sql>spool e:\temp\a.log
- Create a batch execution file. If you want to execute multiple SQL files in bulk, you can create a list file, such as List.sql, which lists each SQL file, starting with @@ 开头 for example
@@a.sql;
@@b.sql;
- Call the bulk Execute file,sql> @list. sql
- If only a single SQL file is executed, it can be called directly, Sql>@@a.sql
- After the SQL command finishes executing, look at the log file to see if there is an "error".
- If there is no error, call Sql>spool off
- Exit Sqlplus, the data will not be actually written after exiting Oracle,sql>exit
Note that the first line of the SQL command in the SQL file must end with a semicolon.
Oracle: Bulk import of data from SQL files