Database Reference
In-Depth Information
# --------------------------------------------------------------------------------------------------
# Get OEM agent names, including ports, for both nodes
# Agents are always installed on a static file system and never fail over
# --------------------------------------------------------------------------------------------------
NEW_EMD=`$EMCLI get_targets | grep ${ONLINE_NODE} | grep oracle_emd | awk '{print $NF }'`
OLD_EMD=`$EMCLI get_targets | grep ${OFFLINE_NODE} | grep oracle_emd | awk '{print $NF }'`
# --------------------------------------------------------------------------------------------------
# This string will be used several times during emcli script construction
# --------------------------------------------------------------------------------------------------
EMCLI_AGENT_STRING=`echo "-src_agent=\"${OLD_EMD}\" -dest_agent=\"${NEW_EMD}\""`
echo "\n\nOEM names for the host targets related to this change:"
echo " Host after relocation ${NEW_EMD}"
echo " Local host name ${OLD_EMD}"
# --------------------------------------------------------------------------------------------------
# Create and distill lists of OEM targets
# Not all targets are managed by OEM, so we need to get a list from the repository
# that we'll compare with the list from VCS
# --------------------------------------------------------------------------------------------------
$EMCLI get_targets | grep oracle_database | awk '{print $NF}' | sort -fu >${EMCLI_DATABASES}
echo "\n\nDatabase targets managed through OEM:"
thisFILE=${EMCLI_DATABASES}
ListNicely
$EMCLI get_targets | grep oracle_listener | awk '{print $NF}' | sort -fu >${EMCLI_LISTENERS}
echo "\n\nListener targets managed through OEM:"
thisFILE=${EMCLI_LISTENERS}
ListNicely
# --------------------------------------------------------------------------------------------------
# Now we'll do the same thing for targets known to the local EM agent. This list
# may include targets ignored or unpromoted in the repository, so we'll treat the
# agent list as a better choice. If the local agent has no targets we'll use
# the full list from the repository
# --------------------------------------------------------------------------------------------------
$EMCTL config agent listtargets | grep oracle_database | cut -d"[" -f2 | cut -d, -f1 | sort -fu
>${EMCTL_DATABASES}
echo "\n\nLocal database targets currently associated with ${NEW_EMD}:"
thisFILE=${EMCTL_DATABASES}
ListNicely
$EMCTL config agent listtargets | grep oracle_listener | cut -d"[" -f2 | cut -d, -f1 | sort -fu
>${EMCTL_LISTENERS}
echo "\n\nLocal listener targets currently associated with ${NEW_EMD}:"
thisFILE=${EMCTL_LISTENERS}
ListNicely
Search WWH ::




Custom Search