# Run only 3 sqlplus session at a time

**URL:** <https://community.unix.com/t/run-only-3-sqlplus-session-at-a-time/370275>\
**Category:** UNIX for Advanced & Expert Users\
**Created:** [January 8, 2018, 10:47am UTC](https://community.unix.com/t/run-only-3-sqlplus-session-at-a-time/370275 "2018-01-08T10:47:29Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![MadeInGermany](https://community.unix.com/letter_avatar/madeingermany/32/5_5575768a8748004e209b776fc1b2916d.png) [@MadeInGermany](https://community.unix.com/u/MadeInGermany)\
**Post date:** [January 8, 2018, 1:44pm UTC](https://community.unix.com/t/run-only-3-sqlplus-session-at-a-time/370275/4 "2018-01-08T13:44:55Z")

</div>

The `wait` waits for all jobs to finish.  
If your jobs have a different run time and you want to keep the running jobs near the allowed maximum, then count them with the `jobs` command

```nohighlight
parallel=3
while read name
do
  echo "running $name"
  ( 
    sqlplus ...
  ) &
  while [`jobs | wc -l` -ge $parallel]; do sleep 2; done
done < abc.txt

```

---

_[View the full topic](https://community.unix.com/t/run-only-3-sqlplus-session-at-a-time/370275)._
