Quote:
Originally Posted by Disha_Pandey
I want to run several other shell scripts from this script to run them in parallel (not serially)...save the output of those scripts in different files and they should all show the date (in the saved files, not on screen)..
How can I modify the below script accordingly?
#!/bin/bash
sqlplus -s performance/oracle@WAMS<<eof
set serveroutput on;
SELECT SYSDATE FROM dual;
eof
|
It is unclear what you want. The script you have cannot be parallelized as there is only one sql job to be run. But if you have loads of these jobs they can be run in parallel using parallel and sql (both part of GNU Parallel):
Code:
$ cat sqljobs
SELECT SYSDATE FROM dual;
SELECT 1+2 FROM dual;
SELECT * FROM foo;
... (other SQL statements you want to run in parallel - one per line)
Code:
$ cat sqljobs | parallel -j10 sql oracle://scott:tiger@ora.example.com/xe ">"{#}
It will save the output from each job into a file called the job number of sqljobs.
Adjust -j10 to run more/less jobs in parallel (-j0 = as many as possible - which may overload your Oracle server).
If that is not what you want you need to give 3 examples of the jobs you want run in parallel and the corresponding file names they should be saved as.