- Syntax()
- {
- echo 'oramon 2.1 beta by Raymond Vermeern'
- echo 'Usage: oramon [ses cpu|disk [interval count records]]'
- echo ' oramon [usr sid statistic [interval count records]]'
- echo ' oramon [sql sid [interval count records]]'
- echo ' oramon [tbs [interval count records]]'
- echo ' oramon [dbf [interval count records]]'
- echo ' oramon [fio nodelta|delta [interval count records]]'
- echo ' oramon [rbs [interval count records]]'
- echo 'n'
- echo ' ses = session information'
- echo ' usr = user information'
- echo ' sql = user sql information'
- echo ' tbs = tablespace information'
- echo ' dbf = datafile information'
- echo ' fio = datafile io information'
- echo ' rbs = rollback information'
- echo 'n'
- echo ' default => oramon 5 99999999999999 20 ses disk'
- exit 0
- }
- DISPLAY=$1
- case $DISPLAY in
- '-h'|'-H'|'-?') Syntax
- ;;
- 'ses') INTERVAL=$3
- COUNT=$4
- NUMBER=$5
- case "${2}" in
- 'CPU'|'cpu') PAR1=6
- ;;
- 'DISK'|'disk') PAR1=5
- ;;
- *) PAR1=5
- ;;
- esac
- ;;
- 'usr') INTERVAL=$4
- COUNT=$5
- NUMBER=$6
- PAR1=$2
- PAR2=$3
- if [ "${PAR1}" = "" -o "${PAR2}" = "" ]
- then
- Syntax
- fi
- ;;
- 'sql') INTERVAL=$3
- COUNT=$4
- NUMBER=$5
- PAR1=$2
- if [ "${PAR1}" = "" ]
- then
- Syntax
- fi
- ;;
- 'fio') PAR1=$3
- PAR2=$4
- PAR3=$2
- if [ "${PAR3}" = "" ]
- then
- Syntax
- fi
- if [ "${PAR1}" = "" ]
- then
- PAR1=4
- fi
- if [ "${PAR2}" = "" ]
- then
- PAR2=99999999999999
- fi
- ;;
- *) INTERVAL=5
- COUNT=99999999999999
- NUMBER=20
- if [ "${1}" = "" ]
- then
- DISPLAY=ses
- PAR1=5
- fi
- ;;
- esac
- [ "${INTERVAL}" = "" ] && INTERVAL=5
- [ "${COUNT}" = "" ] && COUNT=99999999999999
- [ "${NUMBER}" = "" ] && NUMBER=20
- ##echo "@${DISPLAY}mon ${NUMBER} ${PAR1} ${PAR2} ${PAR3}"
- ##exit
- typeset -Z12 TELLER=0
- while [ "$TELLER" -lt ${COUNT} ]
- do
- (( TELLER = TELLER + 1 ))
- clear
- sqlplus -s / << EOF
- @hdrmon
- @${DISPLAY}mon ${NUMBER} ${PAR1} ${PAR2} ${PAR3}
- EOF
- if [ ${COUNT} -gt 1 ]
- then
- sleep ${INTERVAL}
- fi
- done