How to execute .SQL files from console
Very easy, just log in into sqlplus and type as follows if you are in the same path as your file:
SQL > @file_name.sql
If you are not in the same path as your file, you should type as follows:
SQL > @/path/to/file_name.sql
What if I need to pass a parameter? Well, not a problem, just type as follows:
SQL > @file_name.sql param1 param2
or
SQL > @/path/to/file_name.sql param1 param2
Sources: