upog upog - 3 months ago 45
Linux Question

running sqlplus in background in unix

I am trying to run an .sql file from an

SQLPLUS
in unix environment as a back ground process.
and I am connecting to unix using tectia or putty, i want the sql file to be running in backgroung , even if my terminal closes

Please let me know the command/script

works

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


when trying to start in background fails

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

Answer

& will put it in the background

but if you actually want to close your terminal and leave for the day

you need to use nohup

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