SLOB-Harness.sh (Deprecated)

slob ghostNote: This page covers SLOB version 1. SLOB2 is now available so rather than read this, please click here.

This page contains the SLOB-Harness.sh shell script used to generate physical I/O with the SLOB benchmarking tool. For more information read this first.

The tools and scripts found here are supplied for education purposes only and come with no warranty, either expressly or implied. Use at your own risk and please test thoroughly before use in a environment where you care about data and availability.

Be sure to edit the variables shown below in red before execution.

#!/bin/bash
# SLOB Harness - script for driving the Silly Little Oracle Benchmark (SLOB)
# For information on SLOB go to: http://lmgtfy.com/?q=oracle+slob
#
# For educational purposes only - no warranty is provided
# Test thoroughly - use at your own risk
#
# Uses first argument as metadata file
# If no arguments specified defaults to slob-harness.inf

# Edit the next two variables prior to execution

# FILENAME_PREFIX is the naming convention for AWR files coming out of the harness
FILENAME_PREFIX="awr-slob"

# SLOB_HOME is the location at which SLOB was installed on your system
SLOB_HOME="/home/oracle/SLOB"

# Check environment
if [ \! -x $SLOB_HOME/runit.sh ]; then
	echo "Cannot locate SLOB executable at $SLOB_HOME/runit.sh - exiting..."
	exit 1
elif [ -z "$ORACLE_SID" ]; then
	echo "ORACLE_SID not set - exiting..."
	exit 1
fi

DEFAULT_FILENAME="slob-harness.inf"
# Check to see if metadata file was passed as a parameter otherwise use default filename
if [ $# -gt 0 ]; then
	if [ -r "$1" ]; then
		echo Found metadata file $1
		METADATA_FILENAME="$1"
	else
		echo Cannot open metadata file $1 - exiting...
		exit 1
	fi
elif [ \! -r slob-harness.inf ]; then
	echo Cannot find metadata file slob-harness.inf - exiting...
	exit 1
else
	echo Using default metadata file slob-harness.inf
	METADATA_FILENAME=$DEFAULT_FILENAME
fi

# Read metadata file
RO_WORKER_LIST=`cat $METADATA_FILENAME | sed '/^\#/d' | sed -n -e '/<READ-ONLY>/,/<\/READ-ONLY>/p' | grep -v "READ-ONLY"`
RW_WORKER_LIST=`cat $METADATA_FILENAME | sed '/^\#/d' | sed -n -e '/<READ-WRITE>/,/<\/READ-WRITE>/p' | grep -v "READ-WRITE"`
echo Read-Only worker list : $RO_WORKER_LIST
echo Read-Write worker list: $RW_WORKER_LIST

echo Starting slob-harness for read-only workload at `date`

for slobreaders in $RO_WORKER_LIST; do
	echo Running: $SLOB_HOME/runit.sh 0 $((10#$slobreaders))
	$SLOB_HOME/runit.sh 0 $((10#$slobreaders))
	mv awr.txt ${FILENAME_PREFIX}-ro-0-${slobreaders}.txt
	echo Read-Only: $slobreaders complete
done

echo Starting slob-harness for read-write workload at `date`

for slobwriters in $RW_WORKER_LIST; do
	echo Running: $SLOB_HOME/runit.sh $((10#$slobwriters)) 0
	$SLOB_HOME/runit.sh $((10#$slobwriters)) 0
	mv awr.txt ${FILENAME_PREFIX}-rw-${slobwriters}-0.txt
	echo Read-Write: $slobwriters complete
done

echo Completed slob-harness at `date`

The script requires a configuration file to drive the number of processes that will be tested for both read-only and read-write workloads. By default it will look for a file called slob-harness.inf, or you can pass in the name of another configuration file as the first parameter. Here is the sample slob-harness.inf file I use:

# slob-harness.inf
# Metadata file for slob-harness
# Requires a section for read-only tests and another for read-writes
<READ-ONLY>
001
002
003
004
005
006
007
008
009
010
011
012
013
014
015
016
017
018
019
020
021
022
023
024
025
026
027
028
029
030
031
032
036
040
048
056
064
072
080
088
096
104
112
120
128
192
256
</READ-ONLY>
<READ-WRITE>
001
002
003
004
005
006
007
008
009
010
011
012
013
014
015
016
017
018
019
020
021
022
023
024
025
026
027
028
029
030
031
032
036
040
048
056
064
072
080
088
096
104
112
120
128
192
256
</READ-WRITE>

Sample Execution

To save on screen real estate I’ll use a cut-down version of the configuration file (called test.inf) to run just one read-only and one read-write job. Note that I am calling the harness with the nohup command:

[oracle@server2 SLOB]$ nohup ./slob-harness.sh test.inf > slob-harness.out 2>&1 &
[1] 18412
[oracle@server2 SLOB]$ tail -100f slob-harness.out
nohup: ignoring input
Found metadata file test.inf
Read-Only worker list : 001
Read-Write worker list: 002
Starting slob-harness for read-only workload at Tue Mar 19 15:29:13 GMT 2013
Running: /home/oracle/SLOB/runit.sh 0 1
Tm 1
Read-Only: 001 complete
Starting slob-harness for read-writeworkload at Tue Mar 19 15:29:25 GMT 2013
Running: /home/oracle/SLOB/runit.sh 2 0
Tm 4
Read-Write: 002 complete
Completed slob-harness at Tue Mar 19 15:29:41 GMT 2013
^C
[1]+  Done                    nohup ./slob-harness.sh test.inf > slob-harness.out 2>&1
Advertisements

2 Responses to SLOB-Harness.sh (Deprecated)

  1. adeelusman says:

    Hi Sir,
    i’m getting following error while running this script….

    nohup: ignoring input
    20141111-061121 Info : Update Pct list : 0 10 20 30
    20141111-061121 Info : SLOB Worker list : 001 002 004 006 008 010 012 014 016 018 020 022 024 026 028 030 032 034 036 038 040 042 044 046 048 052 056 060 064 068 072 076 080 088 096 112 128
    20141111-061121 Info : 148 runs of SLOB will be required
    20141111-061121 Info : Starting slob-harness…
    20141111-061121 Info : Starting loop for UPDATE_PCT=0
    20141111-061121 Info : Calling SLOB with 001 workers
    20141111-061121 Error: SLOB returned error code 1 – exiting…
    20141111-061121 Info : ———————————–
    20141111-061121 Info : Total submitted SLOB : 148: No such file or directory
    20141111-061121 Info : Total completed SLOB jobs: 0
    20141111-061121 Info : ———————————–
    20141111-061121 Info : FAILURE of slob-harness

    • flashdba says:

      It looks like you are not running this from the correct directory? “No such file or directory”.

      Also, this is for SLOBv1 which has now been superseded by SLOB v2.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s