Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am trying to run a SQL script on remote Oracle database. Something like this, the shell script contains:

sqlplus / @db 

I want to add something to this command so that is is able to run a SQL script on the database db.

share|improve this question

closed as too localized by James Feb 24 '12 at 17:13

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

This question appears to be abandoned as there hasn't been any activity for a longer period of time. I'm voting to close it for now. If by any reason you think this question is still viable or useful in anyways or that there is still a good chance it will be answered please flag it to a moderator or add a comment with the reasons why you want it reopened. Thanks! – James Feb 24 '12 at 17:13

Create a file (let's say: my_sql_commands.sql) containing your SQL commands, for example:

select table_name from user_tables;

And then:

sqlplus username/password@oracle_instance @my_sql_commands.sql

That's all!

share|improve this answer