Oracle-DB: Run TPC benchmark with hammerdb on Standard Edition
we are running on Oracle Linux and want to benchmark a SE2 instance.
Assuming an DB Docker instance is already running on port 1521.
Start hammerdb container:
Assuming an DB Docker instance is already running on port 1521.
Start hammerdb container:
docker run --network=host -it --name hammerdb tpcorg/hammerdb:oracle bashCreate a config script config.tcl:
# Select the Oracle database. dbset db ora # Select the TPC-C benchmark. dbset bm TPC-C # Oracle DBA user (e.g., SYSTEM) diset connection system_user SYSTEM # DBA user's password diset connection system_password oracle # Your TNS Service Name or Easy Connect diset connection instance ORCLPDB1 # Scaling Factor (Number of Warehouses), e.g. 100 diset tpcc count_ware 1 # Virtual Users for schema build/load, e.g. 8 diset tpcc num_vu 1 # Benchmark schema user (will be created) diset tpcc tpcc_user TPCC # Benchmark schema password diset tpcc tpcc_pass pdcc # Tablespace name for data. diset tpcc tpcc_def_tab USERSCreate a schema build script build.tcl:
puts "--- Loading Configuration ---"
source config.tcl
puts "--- Building Schema (this may take time) ---"
buildschema
# Function to wait for the build to complete
global complete
proc wait_to_complete {} {
global complete
set complete [vucomplete]
if {!$complete} {
after 5000 wait_to_complete
} else {
puts "--- Schema Build Complete ---"
}
}
# Start the wait loop
wait_to_complete
create the benchmark run script run.tcl
puts "--- Loading Configuration ---"
source config.tcl
# --- Driver Script Settings ---
# Use the Timed Driver (generates AWR snapshots in EE)
diset tpcc ora_driver timed
# Ramp-up time in minutes (ignored for result calculation)
diset tpcc ora_rampup 5
# Test duration in minutes (used for result calculation)
diset tpcc ora_duration 15
# --- Virtual User Settings ---
# Virtual users for the load test (more than the build VUs)
diset tpcc num_vu 50
# Load the TPC-C driver script
loadscript
# Create and connect the Virtual Users
vucreate
# Run the test workload
vurun
# Function to wait for the test duration to complete
proc wait_for_test_completion {} {
global complete
set complete [vucomplete]
if {!$complete} {
after 10000 wait_for_test_completion
} else {
# Get the final result after test completion
puts [vuresult]
puts "--- Benchmark Run Complete ---"
}
}
wait_for_test_completion
Bukd the schema and run the benchmark:
./hammerdbcli auto build.tcl ./hammerdbcli auto run.tcl
Comments
Post a Comment