How to execute sql file via command line for Oracle

by

Use sql*plus run SQL file

sqlplus username/password@databasename @/path/to/test.sql

If you want to see whats going on like this, including any error messages, you need connect to SQL*Plus with

sqlplus username/password@databasename

Then run the script from the SQL*Plus prompt:

set echo on
@/path/to/test.sql