Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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 jrg 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! –  jrg Feb 24 '12 at 17:13

1 Answer 1

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

select table_name from user_tables;
exit;

And then:

sqlplus username/password@oracle_instance @my_sql_commands.sql

That's all!

share|improve this answer