Shell script to read list of databases from a file.
while read line;
do
DBNAME=`echo $line |awk {'print $1'}`
TBS_THRESHOLD=`echo $line |awk {'print $2'}`
DBA=`echo $line |awk {'print $3'}`
RMANCAT=`echo $line |awk {'print $4'}`
INSTANCES=`echo $line |awk {'print $5'}`
. /orahome/work/sk/dbmon.sh $DBNAME
. /orahome/work/sk/tbsmon.sh $DBNAME $TBS_THRESHOLD
. /orahome/work/sk/dbimon.sh $DBNAME
done < /orahome/work/sk/Listofdatabases.txt
Above script will execute following for every db listed in /orahome/work/sk/Listofdatabases.txt
. /orahome/work/sk/dbmon.sh $DBNAME
. /orahome/work/sk/tbsmon.sh $DBNAME $TBS_THRESHOLD
. /orahome/work/sk/dbimon.sh $DBNAME
<@dbax1:/orahome/work/sk>cat Listofdatabases.txt
db1 15 SK rmandbq 2
db2 15 SK rmandbq 2
db3 15 SK rmandbq 2
db4 15 SK rmandbq 2
db1,db2..are database names in tnsnames.ora file.
No comments:
Post a Comment