Database Reference
In-Depth Information
# ==============================================================================
# General Functions
# ==============================================================================
function CleanUpFiles {
# --------------------------------------------------------------------------------------------------
# CleanUpFiles is called at the beginning of every script to ensure that older
# copies of temporary workfiles are removed to start fresh
# CleanUpFiles is also called by the ExitCleanly function to clean up the
# --------------------------------------------------------------------------------------------------
# files when script execution is complete
# ..............................................................................
[ $WORKFILE ] && rm -f ${WORKFILE}
[ $WORKFILE01 ] && rm -f ${WORKFILE01}
[ $WORKFILE02 ] && rm -f ${WORKFILE02}
}
function ExitCleanly {
# --------------------------------------------------------------------------------------------------
# ExitCleanly is called whenever a script is instructed to exit, whether the
# script ended in success or failure. A clean server is a happy server
# --------------------------------------------------------------------------------------------------
echo "Ending emcli session ..."
emcli logout
CleanUpFiles
echo ""
exit 0
}
function GetAgentNames {
# --------------------------------------------------------------------------------------------------
# As it says in the echo statement, GetAgentNames can be used to list all
# targets of the oracle_emd target type known to OEM
# --------------------------------------------------------------------------------------------------
emcli login -user=sysman -pass="${SysmanPassword}"
echo "Getting the names of all EM agents from OMS ..."
emcli get_targets | grep oracle_emd | sort -u | awk '{ print $4 }'
}
function GetTargetName {
# --------------------------------------------------------------------------------------------------
# This function should be used by any script or function to find
# the exact of a database. If the database isn't known to OEM it returns a
# clear failure message.
# You could easily adapt GetTargetName to find host or agent names
Search WWH ::




Custom Search