Home » Other » Client Tools » Generating lots of concurrent sessions (DB 23c on Linux)
Generating lots of concurrent sessions [message #689690] Wed, 20 March 2024 10:40 Go to next message
John Watson
Messages: 8937
Registered: January 2010
Location: Global Village
Senior Member
I need to simulate a high logon workload (never mind why....) so that I end up with lots of sessions, and I can't get it working. This is the sort of thing I'm trying, which doesn't work:
[oracle@ip-172-30-4-252 ~]$ for i in {1..10}; do  echo $i ; nohup sqlplus -S scott/tiger@pdb1 & ; done
-bash: syntax error near unexpected token `;'
[oracle@ip-172-30-4-252 ~]$
If I escape the &, the command runs but SQL*Plus doesn't connect:
[oracle@ip-172-30-4-252 ~]$ for i in {1..10}; do  echo $i ; nohup sqlplus -S scott/tiger@pdb1 \& ; done
1
nohup: ignoring input and appending output to 'nohup.out'
2
nohup: ignoring input and appending output to 'nohup.out'
3
nohup: ignoring input and appending output to 'nohup.out'
4
nohup: ignoring input and appending output to 'nohup.out'
5
nohup: ignoring input and appending output to 'nohup.out'
6
nohup: ignoring input and appending output to 'nohup.out'
7
nohup: ignoring input and appending output to 'nohup.out'
8
nohup: ignoring input and appending output to 'nohup.out'
9
nohup: ignoring input and appending output to 'nohup.out'
10
nohup: ignoring input and appending output to 'nohup.out'
[oracle@ip-172-30-4-252 ~]$
[oracle@ip-172-30-4-252 ~]$ more<nohup.out

SQL*Plus: Release 23.0.0.0.0 - Developer-Release
Version 23.2.0.0.0

Copyright (c) 1982, 2023, Oracle.  All rights reserved.

Use SQL*Plus to execute SQL, PL/SQL and SQL*Plus statements.

Usage 1: sqlplus -H | -V

    -H             Displays the SQL*Plus version and the
                   usage help.
    -V             Displays the SQL*Plus v
Thankyou for any insight. It must be possible!



Re: Generating lots of concurrent sessions [message #689693 is a reply to message #689690] Wed, 20 March 2024 11:33 Go to previous messageGo to next message
Michel Cadot
Messages: 68658
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
I have no Linux by hand but using Cygwin I have the same behavior.

The following partly works (I have only 2 lines in nohup.out surely due concurrent accesses):
$ for i in {1..10};
> do
>   echo Launching session $i
>   nohup sqlplus -s / <<EOF &
> set echo off
> prompt From session $i
> exit;
> EOF
> done
Launching session 1
[1] 2356
Launching session 2
[2] 5608
Launching session 3
nohup: appending output to `nohup.out'
[3] 5136
Launching session 4
nohup: appending output to `nohup.out'
[4] 3884
Launching session 5
nohup: appending output to `nohup.out'
[5] 5992
Launching session 6
nohup: appending output to `nohup.out'
[6] 3012
Launching session 7
[7] 920
Launching session 8
nohup: appending output to `nohup.out'
[8] 1068
Launching session 9
nohup: appending output to `nohup.out'
[9] 5492
Launching session 10
nohup: appending output to `nohup.out'
nohup: appending output to `nohup.out'
[10] 4716

$ nohup: appending output to `nohup.out'
nohup: appending output to `nohup.out'

[1]   Done                    nohup sqlplus -s /  <<EOF
set echo off
prompt From session $i
exit;
EOF

[2]   Done                    nohup sqlplus -s /  <<EOF
set echo off
prompt From session $i
exit;
EOF

[3]   Done                    nohup sqlplus -s /  <<EOF
set echo off
prompt From session $i
exit;
EOF

[4]   Done                    nohup sqlplus -s /  <<EOF
set echo off
prompt From session $i
exit;
EOF

[5]   Done                    nohup sqlplus -s /  <<EOF
set echo off
prompt From session $i
exit;
EOF

[6]   Done                    nohup sqlplus -s /  <<EOF
set echo off
prompt From session $i
exit;
EOF

[7]   Done                    nohup sqlplus -s /  <<EOF
set echo off
prompt From session $i
exit;
EOF

[8]   Done                    nohup sqlplus -s /  <<EOF
set echo off
prompt From session $i
exit;
EOF

[9]-  Done                    nohup sqlplus -s /  <<EOF
set echo off
prompt From session $i
exit;
EOF

[10]+  Done                    nohup sqlplus -s /  <<EOF
set echo off
prompt From session $i
exit;
EOF


$ cat nohup.out
From session 9
From session 7
Adding a "sleep 1" between launches it works:
$ rm nohup.out

$ for i in {1..10};
> do
>   echo Launching session $i
>   nohup sqlplus -s / <<EOF &
> set echo off
> prompt From session $i
> exit;
> EOF
>   sleep 1
> done
Launching session 1
[1] 4620
nohup: appending output to `nohup.out'
[1]+  Done                    nohup sqlplus -s /  <<EOF
set echo off
prompt From session $i
exit;
EOF

Launching session 2
[1] 5096
nohup: appending output to `nohup.out'
[1]+  Done                    nohup sqlplus -s /  <<EOF
set echo off
prompt From session $i
exit;
EOF

Launching session 3
[1] 2848
nohup: appending output to `nohup.out'
[1]+  Done                    nohup sqlplus -s /  <<EOF
set echo off
prompt From session $i
exit;
EOF

Launching session 4
[1] 5504
nohup: appending output to `nohup.out'
[1]+  Done                    nohup sqlplus -s /  <<EOF
set echo off
prompt From session $i
exit;
EOF

Launching session 5
[1] 5980
nohup: appending output to `nohup.out'
[1]+  Done                    nohup sqlplus -s /  <<EOF
set echo off
prompt From session $i
exit;
EOF

Launching session 6
[1] 2476
nohup: appending output to `nohup.out'
[1]+  Done                    nohup sqlplus -s /  <<EOF
set echo off
prompt From session $i
exit;
EOF

Launching session 7
[1] 5588
nohup: appending output to `nohup.out'
[1]+  Done                    nohup sqlplus -s /  <<EOF
set echo off
prompt From session $i
exit;
EOF

Launching session 8
[1] 5744
nohup: appending output to `nohup.out'
[1]+  Done                    nohup sqlplus -s /  <<EOF
set echo off
prompt From session $i
exit;
EOF

Launching session 9
[1] 4972
nohup: appending output to `nohup.out'
[1]+  Done                    nohup sqlplus -s /  <<EOF
set echo off
prompt From session $i
exit;
EOF

Launching session 10
[1] 5044
nohup: appending output to `nohup.out'
[1]+  Done                    nohup sqlplus -s /  <<EOF
set echo off
prompt From session $i
exit;
EOF

$ cat nohup.out
From session 1
From session 2
From session 3
From session 4
From session 5
From session 6
From session 7
From session 8
From session 9
From session 10

[Updated on: Sat, 23 March 2024 05:48]

Report message to a moderator

Re: Generating lots of concurrent sessions [message #689697 is a reply to message #689693] Sat, 23 March 2024 04:17 Go to previous message
John Watson
Messages: 8937
Registered: January 2010
Location: Global Village
Senior Member
Thanks for replying, but I can't make it work the way I need. I guess my bash shell must be a bit different from your Cygwin. Have to give up on this for now.
Previous Topic: How to capture Error Code in sqlplus
Next Topic: PL/SQL Developer settings FAQ
Goto Forum:
  


Current Time: Sat Jun 15 14:40:43 CDT 2024