troubleshooting Question

Staring multiple sqlplus sessions from a shell script

Avatar of dplinnane
dplinnaneFlag for United States of America asked on
Oracle DatabaseScripting LanguagesShell Scripting
6 Comments2 Solutions5172 ViewsLast Modified:
I wrote the following shell script to start multiple sqplus sessions running the same procedure. But is running one procedure after the other and not creating a new session, how do I make my script creat a new session? Thanks in advance.
 [oracle@linux3 scripts]$ sqlplus_proc_in1.sh 'simulate_workload_with_binds(2000)'

0 [oracle@linux3 scripts]$ sqlplus_proc_in1.sh 'simulate_workload_with_binds(2000)'
Enter the number of sessions
3

PL/SQL procedure successfully completed.

0
PL/SQL procedure successfully completed.

1
PL/SQL procedure successfully completed.



#!/bin/ksh

echo "Enter the number of sessions"
read session

num=0                   # Initialize num
while (( $num < $session ))   # or  while [ num -lt 10 ]
do

#if exit; is not here there will be no result printed to the screen
$ORACLE_HOME/bin/sqlplus -s admin/limk1234 <<EOF
begin
$1;
end;
/

EOF
      echo  -n "$num "
      let num+=1           # Increment num
done
exit;
echo -e "\nAfter loop exits, continue running here"
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 2 Answers and 6 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 2 Answers and 6 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros