This is the main script that you can use to call individual load test scripts, examples below.
#!/bin/bash
usage()
{
echo “Usage : Please supply TestDuration in secs,NoOfThreads,LogWriteFrequency in secs,RampUp in secs”
exit 1
}
#Set Local Parameters
TestDuration=”$1″
NoOfThreads=”$2″
LogWriteFreq=”$3″
RampUp=”$4″
ScriptLocation=”/home/oraobi/TestScripts/runtime/nqcmd*.sh”
#Call Usage if Parameters not passed
[[ $# -eq 0 ]] && usage
echo “Test Duration is :” $TestDuration
echo “No Of Threads /Users is :” $NoOfThreads
echo “Log Write Frequency is :” $LogWriteFreq
echo “Ramp Up Time is :” $RampUp
for i in $ScriptLocation;do
if [ “$?” != “0” ]; then
#Errors have occured
echo “Error occured : No Load Test Scripts files to process”
exit 1
fi
echo “Script to run is :$i”
$i $TestDuration $NoOfThreads $LogWriteFreq $RampUp
done
So have created the script above, it would then call this script in the runtime directory. This in turn calls the logical sql file which also needs to be present
#The basic parameters for load testing are
#-t – how many threads [aka Virtual Users]
#-td – test duration
#-ds – how frequently to write out load test statistics
#-T – enable time statistics [without this they will not be reported correctly]
#-q – flag to turn off row output
#-o – output log
#-i – rampup – seconds between launching threads / users
#So to run a test for a minute with 5 threads, writing load test stats to disk every 5 seconds, you’d run:
# nqcmd -d AnalyticsWeb -u user -p pass -s report01.lsql -q -T -td 60 -t 5 -ds 5 -o output
#!/bin/bash
. $HOME/obiee.env
. $ORACLE_INSTANCE/bifoundation/OracleBIApplication/coreapplication/setup/bi-init.sh
export LANG=UTF16
export NLS_LANG=UTF16
export ODBCINI=$ORACLE_INSTANCE/bifoundation/OracleBIApplication/$ORACLE_BI_APPLICATION/setup/odbc.ini
export SA_NQCMD_ADVANCED=Yes
usage()
{
echo “Usage : Please supply TestDuration in secs,NoOfThreads,LogWriteFrequency in secs,RampUp in secs”
exit 1
}
#Set Local Parameters
TestDuration=”$1″
NoOfThreads=”$2″
LogWriteFreq=”$3″
RampUp=”$4″
echo “Test Duration is :” $TestDuration
#Call Usage if Parameters not passed
[[ $# -eq 0 ]] && usage
$ORACLE_HOME/bifoundation/server/bin/nqcmd -d “AnalyticsWeb” -u loadtest_user1 -p national01 -s ve_grumbles_overall.sql -q -T -td $TestDuration -t $NoOfThreads -ds $LogWriteFreq -o $(date +%Y-%m-%d-%H%M%S)_ve_grumbles_overall.log -i $RampUp