Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Running sqlplus in background in Unix

I am trying to run an .sql file from sqlplus in Unix environment as a background process.

I am connecting to Unix using Tectia or Putty, and I want sqlplus to continue running in background even if my terminal closes.

This command works

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

but when trying to start it in background it fails

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

What is the right command/script?

like image 749
upog Avatar asked Dec 04 '14 23:12

upog


1 Answers

& 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 &
like image 180
Dave Bennett Avatar answered Sep 27 '22 23:09

Dave Bennett