#!/bin/sh
#
#####  
#####  Written by Paul A. Luzzi  - on 07081998
#####    Script to tell who is on in the database.
#####
#####  Version 2.0 - now uses SVRMGR instead of SQL*Plus
#####
if [ ! ` id | awk -F"(" '{print $2}' | awk -F")" '{print $1}' ` = "oracle" ]
  then
    echo "Must be an oracle user to use this"
    exit 1
  fi

if [ "$#" -lt 1 ]
  then
    echo "USAGE: whos_on.sh <SID>"
    exit 1
  fi

#####
#####  Now setup the Oracle Sid
#####
## USER=$1
## PASSWORD=$2
## SID=$3
SID=$1

#####
#####  Now check the database for user sessions
#####
svrmgrl <<EOF
connect internal
select username, osuser, machine, terminal from v\$session ;
EOF

#####
#####  End of whos_on_db.sh
#####
