Hi,
The requirement is to ssh to unix servers and oracle databases, to perform some monitoring activity. I'm using shell script to perfom this.
I pass the server details and database to a variable ...
SERVERS="SERVER1 SERVER2 SERVER3"
DATABASE="DB1 DB2 DB3"
for i in $SERVERS
do
ssh $SERVERS
....#get some info on that server
for j in $DATABASE
do
sqlplus -s .......
# perform some activity on database
done
done
Above FOR LOOP doesnt work properly. It connects in this form...
SERVER1 DB1
SERVER1 DB2
SERVER1 DB3
SERVER2 DB1
SERVER2 DB2
SERVER2 DB3
SERVER3 DB1
SERVER3 DB2
SERVER3 DB3
Connections are getting repeated on a server. How can I control the iteration of two variables inside this FOR LOOP. Any other ways of achieving this. I want the result to be of this form...
SERVER1 DB1
SERVER2 DB2
SERVER3 DB3
Can someone please help!!