Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

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 want to run a command on remote database (oracle) from local server using sqlplus, eg:

sqlplus user/pass@db "command"

What's the syntax for it?

I want to use the command exit (from database) just to test something in a unix script.

share|improve this question

try this in the below example i am calling test_procedure.

sqlplus "username/password@tns_name" <<\!

exec test_procedure();

share|improve this answer
Use this from comment --> sqlplus "username/password@tns_name" <<! exec test_procedure(); ! – SrikanthM Mar 7 '11 at 14:43

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.