When the observer is “checking” several dataguard configurations, we can use this server to easily make queries on all of them, for instance using:
for db in `ps -ef | grep observer | awk -F '/' '{print $6}' | sort`; do conn=`sed -n 1p /u00/app/oracle/admin/${db}/observer/fsfo_${db}.conf` conndb=`echo $conn | cut -d "@" -f2` dgmgrl -silent ${conn} "show configuration" | grep -E 'Primary' done;
It does for every observed configuration:
- gets the DB name
- find the connection string in the config file
- connects to DGMGRL in silent more and runs a command