In my previous post, I talked about how to set a Enterprise Manager blackout with the Agent’s emctl utility on the command line. Everything was working fine until I tried to set a blackout with a clustered database. When trying to set a blackout on a clustered database target you will get an error similar to the following:
./emctl start blackout testblackout orcl
Oracle Enterprise Manager 11g Release 1 Grid Control 11.1.0.1.0
Copyright (c) 1996, 2010 Oracle Corporation. All rights reserved.
"orcl" is a cluster target, hence skipping it. Please use EM console.
From Metalink Note 419740.1, we find that we cannot use the Agent’s emctl utility to set blackouts on RAC databases. You do have the option of scheduling blackouts in Enterprise Manager, but I still wanted to do this via the command-line. The trick is to use EM’s emcli (Command Line Interface) utility on the OMS server.
export JAVA_HOME=/u01/app/oracle/product/middleware/oms11g
export PATH=$JAVA_HOME/jdk/bin:$PATH
cd /u01/app/oracle/product/middleware/oms11g/bin
./emcli login -username=bpeasland
./emcli create_blackout -name="Standby Snapshot" -add_targets="resp:cluster_database" -description="Standby taken down to perform cold snapshot" -schedule="duration::10" -reason="backup"
./emcli logout
Unfortunately, this option requires me to login and if I want to put this in a shell script, I would be required to code the password.