What IS the RWP*Load Simulator? - oracle/rwloadsim GitHub Wiki
SQL*Plus is a great tool for executing ad hoc SQL and writing reports, PL/SQL is ideal for writing database centric application code, and the Bourne-Again SHell, bash, is very useful for scripting and programming. If you ever wanted the ability to program SQL*Plus, execute PL/SQL on the client side or use SQL directly in bash, you have come to the right place. This gap is exactly what the RWP*Load Simulator is filling in addition to its ability to actually simulate load.
The RWP*Load Simulator is a tool developed by the Real World Performance group at Oracle Corporation. While it on one side nicely fills the somewhat void space between the Oracle database, Linux scripting, and programming in e.g. C or Java, it also bridges a bit of the way into complex benchmarking tools.
If you ever had a need to do any of these:
- Write scripts for Linux (bash, awk, sed) that integrates easily with the Oracle database
- Simplify repeated work you would otherwise do using SQL*Plus
- Exercise behavior with concurrent execution possibly in combination with session pools
- Simulate workloads while experimenting with database or application side parameters
- Experiment with different connection methods or different sizes of session pools
- Exercise limits of your environment; find where the "hockey stick" curve bends
- Automatically create html reports with graphs showing scaling, performance, etc
- Get statistics about application or database performance to embed in reports
and you found the standard sqlplus tool to be too limited and found that writing a full application in e.g. Java, C++ or Python to be too complex, you are likely to find rwloadsim to suit you well.
If you think of a bit of bash and SQL, a dose of PL/SQL, a nip of C or Java, a dash of awk, a grain of sed plus a few drops of secret sauce and put it all into one tool, you will have an idea about what rwloadsim is. In its core, it is a programming language that takes a bit of each of these known tools and programming languages and integrates them into one. The RWP*Load Simulator comes complete with users guide, reference documentation (available after Linux install as classic man pages or online here), simple demos to get you started and a complete oltp workload. The latter is vaguely similar to Swingbench.
It is important to understand that although rwloadsim does allow quite advanced scripting, it is not a general purpose application programming environment. Its purpose is scripting and workload simulation tool. If you attempt using it beyond these design goals, you will observe limitations. As just one example, it does not include a graphical interface, and the only reason you can get html pages with graphics out of it is that you can write code that generates html and code that calls gnuplot.
You really should think of rwloadsim as four parts that in order of increasing complexity are:
- A prebuilt, ready to use set of command line utilities that can be helpful in your daily work with the Oracle Database. The purpose of these are to simplify routine things, and some do little more than you could do using SQL*Plus. Examples are utilities that measure Oracle Net performance, generate SQL monitor or report, explain plans, awr reports or exports, and one that is similar to scp except the "remote end" of the copy is a database directory.
- The rwl language interpreter, that you can use to create your own scripts or use to do many sorts of simulations and experiments.
- A comprehensive OLTP style workload that you can execute against your database for a diverse sort of experiments.
- The possibility to create your own workload from scratch simulating your real application.
The first two are readily available to be used as is without anything further, and they are available on Linux as well as Microsoft Windows. The various prebuilt utilities are described individually on these wiki pages. The OLTP style workload is available on Linux and it has some extra requirements such as a (preferably separate) database used as a results repository, and installation of several extra Linux utilities such as gnuplot and a httpd deamon.
It is strongly recommended that you start with a binary distribution (found at Github releases). It is suggested that you also have gnuplot and that you have a place to put html or image files such that you can view them from a browser; if you are going to run the standard OLTP workload these are required. If your interest only is the first of the four points above, there is a distribution that only contains those utilities.
To get under the hood, you can get the source code and build it yourself. It is written in C with use of flex and bison.
To get just a very brief understanding of the rwl language, this very small example will display rows from the EMP table that you probably have used before. If the following is in a file called emp.rwl (with proper credentials and connect string):
# declare a database
database db "scott/{password}@//host/service" default;
# and some variables
integer empno, deptno:=10, numemps:=0;
$useroption:deptno # allow user to provide --deptno
string ename;
for
select empno, ename -- select list element match variables
from emp where deptno=:deptno -- bind matches variable
/
loop # Execute a cursor loop
printf "%4d %s\n", empno, ename; # use printf to output something
numemps += 1; # count the number of rows
end loop;
if numemps=0 then # If there were no rows, print a message
printline "No employees in department", deptno;
end if;
You can execute rwloadsim --deptno=20 emp.rwl
and you will get a list of employees in department 20.