Skip to content

Commit 3f99b0b

Browse files
committed
Merge branch 'oramain' into 'obakhir'
# Conflicts: # src/rwlerror.h
2 parents af09762 + 89b1426 commit 3f99b0b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+4164
-3350
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ lib/*.o
1414
lib/*.obj
1515
lib/*.lib
1616
dist-rwl-bin.sh
17+
dist-rwldev.sh
1718
push_to_remotes.sh
1819
make.generated.sh
1920
*.tgz

BUILDING.md

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@
33
## Prerequisites
44

55
* An Oracle client environment (release 19.9 or higher) used for building the tool; Instant Client including basiclite, sdk and sqlplus is fine.
6-
* Potentially client environments for other releases than the primary build release, these can similarly use full client or Instant Client; releases 11, 12, 18, 19, 21, 23 are supported.
6+
* Potentially client environments for other releases than the primary build release, these can similarly use full client or Instant Client; releases 11, 12, 19, 21, 23 are supported.
77
* For client release 19, you must have at least 19.9.
8-
* A database (release 19 or higher, release 21.3 preferred) that can be used to run test scripts.
8+
* A database (release 19 or higher, release 21.9 preferred) that can be used to run test scripts.
99
* An environment with the gcc compiler and tools like make.
1010
* Both bison (3.0.4 or newer) and flex must be installed.
1111
* Installing ctags and cscope is recommended if you want to work on the source.
1212
* The Bourne Again Shell, /bin/bash.
13-
* Installing gnuplot is highly recommended, although not required for compiling or running test suite. It is required for running the oltp workload.
13+
* Installing gnuplot is highly recommended, although not required for compiling or running test suite. It is required for running the oltp workload and several standard utilities
1414
* On Solaris, you must have GNU utilities installed and they _must_ be before ordinary utilities in your PATH. Typically, this means your PATH should have /usr/gnu/bin among the first parts.
1515

1616
## Building rwloadsim
@@ -63,6 +63,15 @@ It contains a set of defines that must be provided for the new platform.
6363
At present, the following platforms are in _Beta_ state, which means they are not yet ready for production use.
6464
If you complete a port, please contact the rwloadsim developer.
6565

66+
### Microsoft Windows
67+
68+
For building on Microsoft Windows, you need the following:
69+
70+
* Microsoft Visual Studio 2017 or later
71+
* nmake, cl, link (command line C compiler and linker)
72+
* Oracle Instant client for Windows release 19.21 or newer
73+
* For certain utilities (ashplot, ociping in concurrency mode), an installation of gnuplot is required
74+
6675
### Apple OS X
6776

6877
For building on OS X, please be aware of the following:

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
* Printf format for KiB, MiB, etc
77
* Oltp workload can show connection storm effects
88
* Oltp workload can optionally query gv$osstat to usr/sys on db server
9+
* The ashplot command can output a running graph
910
* Added -= assignment
1011
* Various improvements to statistics gathering
1112

admin/.vim/syntax/rwl.vim

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
" Copyright (c) 2023 Oracle Corporation
55
" Licensed under the Universal Permissive License v 1.0
66
" as shown at https://oss.oracle.com/licenses/upl/
7-
" Latest Revision: 28 feb 2024
7+
" Latest Revision: 4 jun 2024
88

99
if exists("b:current_syntax")
1010
finish
@@ -141,6 +141,8 @@ syn match rwlDirective '\$maxmesg:\d\+'
141141
syn match rwlDirective '\$readbuffer:\d\+'
142142
syn match rwlDirective '\$ora01013:stop'
143143
syn match rwlDirective '\$ora01013:continue'
144+
syn match rwlDirective '\$ora01013:break'
145+
syn match rwlDirective '\$ora01013:reset'
144146
syn match rwlDirective '\$oraerror:showoci'
145147
syn match rwlDirective '\$oraerror:noshowoci'
146148
syn match rwlDirective '\$oraerror:stop'

bin/mtitxcset

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
11
#!/bin/bash
2-
# Copyright (c) 2023 Oracle Corporation
2+
# Copyright (c) 2024 Oracle Corporation
33
# Licensed under the Universal Permissive License v 1.0
44
# as shown at https://oss.oracle.com/licenses/upl/
55

66
. oltp-setup-env
77

88
# Changes
99
#
10-
# bengsig 10-may-2023 Creation
10+
# bengsig 30-may-2024 - loadfactor used to mute threads
11+
# bengsig 10-may-2023 - Creation
1112

1213
# External control
1314

14-
options="hHk: -l help,key:,hostname:,mtittype:,rowspins:,arraysize:,affinity:,no-stopnow,stopnow,finishnext,finishnow,proccount:,default,no-show"
15+
options="hHk: -l help,key:,hostname:,mtittype:,rowspins:,arraysize:,affinity:,no-stopnow,stopnow,finishnext,finishnow,proccount:,loadfactor:,default,no-show"
1516
usage="$commandname [-H] [--{parameter}=value]"
1617

1718
help=no
@@ -23,6 +24,7 @@ rowspins=''
2324
arraysize=''
2425
affinity=''
2526
stopnow=''
27+
loadfactor=''
2628
proccount=''
2729
default=no
2830

@@ -36,6 +38,8 @@ do
3638
;;
3739
--hostname) hostname=$2; shift; shift;
3840
;;
41+
--loadfactor) loadfactor=$2; shift; shift;
42+
;;
3943
--mtittype) mtittype=$2; shift; shift;
4044
;;
4145
--rowspins) rowspins=$2; shift; shift;
@@ -71,11 +75,12 @@ cat <<END
7175
-H -h --help : show this help
7276
-k|--key key : Change values for this key ($key)
7377
--hostname name : Change values for hostname ($hostname)
74-
--mtittype N : Set the mtit type (0-7)
78+
--mtittype N : Set the mtit type (0-7, 202)
7579
--rowspins N : Set the number of rows per insert
7680
--arraysize : Set the array size of the insert
77-
--affinity D : Set the affinity for relevant type in range [0..1]
81+
--affinity D : Set the affinity for relevant type in range [0..4]
7882
--proccount N : Set the process count for the next run
83+
--loadfactor D : Set proportion of threads to be active [0..1]
7984
--stopnow : Stop current run, start a new one
8085
--finishnow : Stop current run and finish completely
8186
--finishnext : Let current run complete, then finish
@@ -96,6 +101,11 @@ then
96101
rwloadsim -q xcchange.rwl --myhost=$hostname --mykey=$key --mtittype=$mtittype;
97102
fi
98103

104+
if test x$loadfactor != x
105+
then
106+
rwloadsim -q xcchange.rwl --myhost=$hostname --mykey=$key --loadfactor=$loadfactor;
107+
fi
108+
99109
if test x$rowspins != x
100110
then
101111
rwloadsim -q xcchange.rwl --myhost=$hostname --mykey=$key --rowspins=$rowspins;

bin/oltpconnect

Lines changed: 161 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,161 @@
1+
#!/bin/bash
2+
# Copyright (c) 2021 Oracle Corporation
3+
# Licensed under the Universal Permissive License v 1.0
4+
# as shown at https://oss.oracle.com/licenses/upl/
5+
6+
save_oracle_path="$ORACLE_PATH"
7+
8+
. oltp-setup-env
9+
10+
# This shell script will return the credentials for the specified connection
11+
#
12+
13+
# History
14+
#
15+
# 4-jun-2024 bengsig Created
16+
help=no
17+
side2=no
18+
username=''
19+
password=''
20+
usage="Usage: $commandname [-2] [-b|--batch] [-p|--pool] [-H|--help] [-C|--cruser] [-A|--awr] [-S|--system] [-R|--results] [-r|--run] [-a|--aw] [-o|--oe]"
21+
22+
# Get directory names from parameters.rwl
23+
24+
eval `rwloadsim -q parameters2shell.rwl`
25+
26+
export ORACLE_PATH="$save_oracle_path"
27+
28+
options='2pbhHASCRrao -l cruser,help,awr,system,results,run,aw,oe,batch,pool'
29+
30+
if getopt -Q -o $options -- "$@"
31+
then
32+
:
33+
else
34+
# output something likely to cause proper errors in
35+
# actual utility if $(oltpconnect) is given invalid options
36+
tty -s <&1 || echo unknown/{password}@unknown
37+
exit 1
38+
fi
39+
40+
set -- `getopt -u -n $commandname -o $options -- "$@"`
41+
42+
while test $1 != '--'
43+
do
44+
case $1 in
45+
--system|-S)
46+
username=$system_username
47+
password=$system_password
48+
connect=$system_connect
49+
shift
50+
;;
51+
--awr|-A)
52+
username=$sysawr_username
53+
password=$sysawr_password
54+
connect=$sysawr_connect
55+
shift
56+
;;
57+
--cruser|-C)
58+
username=$cruser_username
59+
password=$cruser_password
60+
connect=$cruser_connect
61+
shift
62+
;;
63+
--oe|-o)
64+
username=$rwl_oe_username
65+
password=$rwl_oe_password
66+
shift
67+
;;
68+
--aw|-a)
69+
username=$rwl_aw1_username
70+
password=$rwl_aw1_password
71+
shift
72+
;;
73+
--run|-r)
74+
username=$rwl_run1_username
75+
password=$rwl_run1_password
76+
shift
77+
;;
78+
--results|-R)
79+
username=$results_username
80+
password=$results_password
81+
connect=$results_connect
82+
shift
83+
;;
84+
-b|--batch)
85+
if test -z "$connect"
86+
then
87+
connect=$batch_connect
88+
fi
89+
shift
90+
;;
91+
-p|--pool)
92+
if test -z "$connect"
93+
then
94+
connect=$pool_connect
95+
fi
96+
shift
97+
;;
98+
-2)
99+
side2=yes;
100+
shift;
101+
;;
102+
--help|-H|-h) help=yes; shift;
103+
;;
104+
esac
105+
done
106+
107+
if test x$help = xyes
108+
then
109+
echo "$usage"
110+
cat <<END
111+
-H : Show this help
112+
-A --awr : Return credentials for the user doing awr etc
113+
-S --system : Return credentials for the user running v$ queries etc
114+
-C --cruser : Return credentials for the user creating schemas
115+
-R --results : Return credentials for your repository user
116+
-r --run : Return credentials for the normal runtime user
117+
-a --aw : Return credentials for the user owning the artificial workload tables
118+
-o --oe : Return credentials for the user owning the order entry tables
119+
-2 : Use side 2 as used by oltpforever2 for -r, or -a
120+
-p --pool : Use the pool_connect connect string rather than normal_connect
121+
for -r, -o, -a
122+
-b --batch : Use the batch_connect connect string rather than normal_connect
123+
for -r, -o, -a
124+
END
125+
exit
126+
fi
127+
128+
if test -z "$username"
129+
then
130+
# use --run as default
131+
username=$rwl_run1_username
132+
password=$rwl_run1_password
133+
fi
134+
135+
# If no connect, it must be the normal
136+
if test -z "$connect"
137+
then
138+
connect=$normal_connect
139+
fi
140+
141+
if test $side2 = yes
142+
then
143+
# Change the username/password
144+
if test $username = $rwl_run1_username
145+
then
146+
username=$rwl_run2_username
147+
password=$rwl_run2_password
148+
fi
149+
if test $username = $rwl_aw1_username
150+
then
151+
username=$rwl_aw2_username
152+
password=$rwl_aw2_password
153+
fi
154+
fi
155+
156+
if tty -s <&1
157+
then
158+
echo $username/@$connect
159+
else
160+
echo $username/$password@$connect
161+
fi

bin/rwloadsim

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#
1212
# History
1313
#
14+
# bengsig 13-jun-2023 - exec line wihtout full path
1415
# bengsig 4-jan-2023 - Add version 23
1516
# bengsig 23-dec-2020 - Desupport release 20 (see rwl.h)
1617
# bengsig 17-dec-2020 - Add release 21
@@ -68,13 +69,15 @@ then
6869
exit 1
6970
fi
7071

71-
# Do our own search such that the full path is used
72-
# in the exec command line
72+
# Do our own search so that we can do our own error reporting
73+
# in case of missing rwloadsimNN in PATH
7374
for dir in `echo $PATH | sed 's/:/ /g'`
7475
do
7576
if test -x "$dir"/$rwloadsim
7677
then
77-
exec "$dir"/$rwloadsim "$@"
78+
# We used to have full path, but just name makes
79+
# e.g. ps and top nicer
80+
exec $rwloadsim "$@"
7881
fi
7982
done
8083

bin/sqlmonitor

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/bin/sh
2+
3+
# RWP*Load Simulator
4+
#
5+
# Copyright (c) 2024 Oracle Corporation
6+
# Licensed under the Universal Permissive License v 1.0
7+
# as shown at https://oss.oracle.com/licenses/upl/
8+
#
9+
# call rwloadsim -u sqlmonitor.rwl
10+
11+
# bengsig 13-jun-2024 - Created
12+
13+
exec rwloadsim --pretend-gen-banner='RWP*SQL Monitor' -u sqlmonitor.rwl "$@"

bin/sqlreport

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/bin/sh
2+
3+
# RWP*Load Simulator
4+
#
5+
# Copyright (c) 2024 Oracle Corporation
6+
# Licensed under the Universal Permissive License v 1.0
7+
# as shown at https://oss.oracle.com/licenses/upl/
8+
#
9+
# call rwloadsim -u sqlreport.rwl
10+
11+
# bengsig 13-jun-2024 - Created
12+
13+
exec rwloadsim --pretend-gen-banner='RWP*SQL Report' -u sqlreport.rwl "$@"

docs/ERRORLIST.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1310,6 +1310,11 @@ error.
13101310
### RWL-321 warning: "nostatistics has no effect here"
13111311
The nostatistics statement only has an effect inside a declared proedure.
13121312

1313+
### RWL-322 error: "user requested break"
1314+
The $ora01013:break directive is in effect and ctrl-c has caused a break.
1315+
You need to also have a $ora01013:reset directive later in your rwl program
1316+
to allow any clean up procedures to be called.
1317+
13131318
### RWL-600 internal error: '%s'
13141319
An abnormal situation caused an internal error in rwloadsim.
13151320
This is in most cases due to a programming error and it

0 commit comments

Comments
 (0)