Running sqlplus in the background on Unix

I am trying to run a file .sql

from sqlplus

within a Unix environment as a background process.

I am connecting to Unix using Tectia or Putty and want to sqlplus

keep running in the background even if my terminal is closed.

This command works

$ sqlplus USERNAME/password@SCHEMA
SQL>@test.sql
SQL> quit

      

but when trying to run it in the background it fails

$ sqlplus USERNAME/password@SCHEMA&
SQL>@test.sql
SQL> quit

      

What is the correct command / script?

+5


source to share


2 answers


&

will put it in the background

but if you really want to close your terminal and leave for a day



you need to use nohup

nohup sqlplus USERNAME/password@DBNAME @test.sql &

      

+12


source


Pass the script name on the SQLPlus command line:



sqlplus USERNAME/password@SCHEMA @test.sql &

      

+2


source







All Articles