function get_tablespace()
{
## Get the current size of the tablespace
size=`su -l oracle -c 'db-control report' |egrep "DATA_TBS" | awk '{print $5}'|tr -d '%'`
## Loop through until the size is 82 or less
count=0
while [ $size > 82 ] && [ $count < 3 ]
do
# For safty, lets not run this more than 3 times
count=expr count + 1
`su -l oracle -c 'db-control extend DATA_TBS'`
report "Increased tablespace size"
size=`su -l oracle -c 'db-control report' |egrep "DATA_TBS" | awk '{print $5}'|tr -d '%'`
done
report "Tablespace is 90 or below: $size $count"
}
Assume $size ends up being 83, the output I get is:
script.sh: line 34: 3: No such file or directory
Line 34 is:
while [ $size > 82 ] && [ $count < 3 ]