Home » Infrastructure » Unix » using at command to submit oracle commands
using at command to submit oracle commands [message #97478] Wed, 05 June 2002 11:43 Go to next message
Toyn
Messages: 36
Registered: April 2001
Member
Hi,
I'm using the below syntax:
$ at 1500 < test >> test.out
for my file. As a test for using this at command with Oracle my test file looks like the below:
sqlplus test/test1
desc test

What's happening is the file is opening sqlplus, and then closing it before I can get to the command.

Connected to:
Oracle8 Enterprise Edition Release 8.0.5.1.0 - Production
PL/SQL Release 8.0.5.1.0 - Production

SQL> Disconnected from Oracle8 Enterprise Edition Release 8.0.5.1.0 - Production
PL/SQL Release 8.0.5.1.0 - Production
desc: Command not found

How can I instruct at, or properly write my file to ensure that oracle stays open so I can execute my commands? Thanks.
Re: using at command to submit oracle commands [message #97479 is a reply to message #97478] Wed, 05 June 2002 15:34 Go to previous messageGo to next message
andrew again
Messages: 2577
Registered: March 2000
Senior Member
Write your commands to a sql script and then call that on the sql command line. Try the following:

sqlplus -s test/test1 @myfile.sal >> test.out

You can also use "here documents". See the URL below (see the EOF tags. Some shells want the closing tag (EOF) to be in column 1 so no indenting allowed.)

http://www.orafaq.net/msgboard/unix/messages/1319.htm
Re: using at command to submit oracle commands [message #97490 is a reply to message #97479] Thu, 20 June 2002 10:38 Go to previous message
andrew again
Messages: 2577
Registered: March 2000
Senior Member
I haven't tested these but you could try them:
at now sqlplus -s test/test1 @myfile.sal >> test.out
sqlplus -s test/test1 @myfile.sal >> test.out &
nuhup sqlplus -s test/test1 @myfile.sal >> test.out
Previous Topic: Oracle's interaction with Unix.
Next Topic: oracle script in background using nohup in Unix ??
Goto Forum:
  


Current Time: Wed Sep 23 14:23:00 CDT 2020