Little things worth knowing: creating the Swingbench order entry schema “lights out”

This is a little note, primarily to myself I guess, about the creation of the order entry schema (part of Swingbench, written by Dominic Giles) when no VNC sessions are available.

Instead, you can create the schema on the command line. I always execute commands on remote systems in a screen session for increased peace of mind. Should the network drop, the order entry generation will continue as if nothing ever happened.

This article was created using Swingbench 2.7, the latest version at the time of writing. It requires JDK 17 to be present which you might have to install first. The number of command line switches differs slightly depending on where you’re deploying Swingbench to, the typical use case (Autonomous Database, other deployments) are covered.

Download Swingbench

You first start by downloading Swingbench from its website and unzip it in a directory from where you want to run it. I decided to place it in /home/martin/swingbench/. It is usually a good idea to keep the load generator separate from the database server(s). As long as you can connect to the target database you should be fine.

Before you can run swingbench (or minibench/charbench) you need to create the SOE schema. The oewizard is the tool of choice for the Order Entry benchmark. This post expects that you installed JDK 17, and you also added the java executable to your path.

Invoking the oewizard displays all the possible options:

$ ./oewizard -h
usage: parameters:
-allindexes build all indexes for schema
-async_off run without async transactions
-async_on run with async transactions (default)
-bigfile use big file tablespaces
-bs <size> the batch size of rows inserted into the database
-c <filename> wizard config file
-cf <file> the location of a credentials file for Oracle
Autonomous Database
-cl run in character mode
[ content removed for brevity ]

If you see output rather than an error message, you’re all set. If you get something along the lines of java.lang.UnsupportedClassVersionError you probably have a JDK version mismatch. Are you using JDK 17/Swingbench 2.7?

Note that not all partitioning schemes are valid for the Order Entry benchmark, and neither are all compression methods, depending on your platform.

Creating the SOE schema on Autonomous Database

If you are targeting an ADB instance your command line switches depend on how you created the ADB instance. This post assumes you:

  • kept mutual TLS (mTLS) encryption enabled
  • only allow your laptop’s IP address to access the instance (aka Access Control Lists are enabled)
  • Use a public endpoint rather than a private one

Regardless of the options, you start by downloading the ADB instance’s wallet to get your hands on the connection details and the certificates. Place the wallet into the same directory as Swingbench, in my case it’s in /home/martin/swingbench/wallet/Wallet_db.zip.

Invoke the wizard on your shell, adjust as needed.

/home/martin/swingbench/bin/oewizard \
-cl -create -cs <TNS_NAME> \
-cf /home/martin/swingbench/wallet/Wallet_db.zip \
-allindexes -dba admin -dbap '"<ADMIN user password>"' \
-u soe -p '"<SOE password>"' \
-ts users -part -scale 2 -tc 8 -v

In the above snippet, replace the following placeholders with actual values:

  • <TNS_NAME>: this is the database connect identifier like databaseName_tp. Check your ADB instance using the GUI, clicking on Database Connection reveals all connection strings
  • <ADMIN user password>: your admin user password, without <>, enclosed in ‘””‘
  • <SOE password>: your SOE user’s password

Note that the SOE user’s password adheres to password complexity rules, pick a reasonably complex password.

Creating the SOE schema elsewhere

If your target database doesn’t use TCPS, and you host it yourself it is a little easier to create the SOE schema. After downloading/unzipping Swingbench, start the oewizard as follows:

/home/martin/swingbench/bin/oewizard \
-cl -create -cs <TNS_NAME> \
-allindexes -dbap '"<SYSDBA password>"' \
-u soe -p '"<SOE password>"' \
-ts users -part -scale 2 -tc 8 -v

Substitute appropriate values for TNS_NAME and SOE password and you’re off to the races. In the above example I’m connecting to the target database as SYS. All you need to do is provide the SYS user’s password, there is no need to provide the username.

Validating the installation

Once the wizard completes the data generation it’s time to ensure that everything that’s supposed to be present actually is.

Data Generation Runtime Metrics
+-------------------------+-------------+
| Description | Value |
+-------------------------+-------------+
| Connection Time | 0:00:00.001 |
| Data Generation Time | 0:03:36.219 |
| DDL Creation Time | 0:01:15.650 |
| Total Run Time | 0:04:51.873 |
| Rows Inserted per sec | 11,096 |
| Actual Rows Generated | 2,400,557 |
| Commits Completed | 179 |
| Batch Updates Completed | 12,067 |
+-------------------------+-------------+

Validation Report
The schema appears to have been created successfully.

Valid Objects
Valid Tables : 'ORDERS','ORDER_ITEMS','CUSTOMERS','WAREHOUSES','ORDERENTRY_METADATA','INVENTORIES','PRODUCT_INFORMATION','PRODUCT_DESCRIPTIONS','ADDRESSES','CARD_DETAILS'
Valid Indexes : 'PRD_DESC_PK','PROD_NAME_IX','PRODUCT_INFORMATION_PK','PROD_SUPPLIER_IX','PROD_CATEGORY_IX','INVENTORY_PK','INV_PRODUCT_IX','INV_WAREHOUSE_IX','ORDER_PK','ORD_SALES_REP_IX','ORD_CUSTOMER_IX','ORD_ORDER_DATE_IX','ORD_WAREHOUSE_IX','ORDER_ITEMS_PK','ITEM_ORDER_IX','ITEM_PRODUCT_IX','WAREHOUSES_PK','WHS_LOCATION_IX','CUSTOMERS_PK','CUST_EMAIL_IX','CUST_ACCOUNT_MANAGER_IX','CUST_FUNC_LOWER_NAME_IX','ADDRESS_PK','ADDRESS_CUST_IX','CARD_DETAILS_PK','CARDDETAILS_CUST_IX'
Valid Views : 'PRODUCTS','PRODUCT_PRICES'
Valid Sequences : 'CUSTOMER_SEQ','ORDERS_SEQ','ADDRESS_SEQ','LOGON_SEQ','CARD_DETAILS_SEQ'
Valid Code : 'ORDERENTRY'
Schema Created

You should see that the schema has been created successfully. Anything in an invalid state should be investigated. Older Swingbench versions required an execute grant on dbms_lock to SOE, but with the introduction of dbms_session.sleep in more recent Oracle Database versions this is no longer needed.

Response

  1. […] next step is to create a basic Order Entry schema. I wrote about this before, and so has Dominic Giles on his blog. For your reference, here is the command I […]