Database Reference
In-Depth Information
Listing 3-21. Additional shell scripting added to make events sequential
MYSTATUS='Scheduled'
STATCOUNT=6
while [ "$MYSTATUS" == "Scheduled" ]; do
if [ $STATCOUNT -lt 1 ]; then
echo "Blackout1 stuck in scheduled status"
exit 1
fi
let STATCOUNT-=1
sleep 5
MYSTATUS=$(emcli get_blackout_details -name='Blackout1' \
-noheader -format='name:csv' | cut -d ',' -f 1)
done
if [ "$MYSTATUS" != "Started" ]; then
echo 'Blackout Blackout1 not started'
exit 1
fi
<Maintenance Script>
When maintenance is completed, the same script can use EM CLI commands to both close and delete the blackout:
emcli stop_blackout -name='Blackout1'
emcli delete_blackout -name='Blackout1'
Task: Create Targets
Adding targets can be painful if EM doesn't auto-discover them. This is especially true if the targets are using
non-default settings, which sometimes make them hard for the agent to detect. Fortunately, EM CLI is able to add
targets with much more flexibility than EM.
Which parameters need to be specified greatly depends on the target type being added. For example, when
adding a database, the properties parameter needs to include:
SID
Port
OracleHome
MachineName
The credentials for a database are almost always going to be for the “dbsnmp” user unless they are for a standby
database that is not open and therefore requires a privileged password file account. Listing 3-22 shows an example of
adding a target through EM CLI command-line mode.
 
Search WWH ::




Custom Search