Database Reference
In-Depth Information
frequency:yearly
requires => duration, days, months
optional => start_time, end_time, tzinfo, tzoffset
A Robust Solution for Scheduled Blackouts
The author's environment contains a handful of application training databases that get refreshed from a cold backup
nightly. Of course, as soon as these targets were added to OEM he started getting pager notifications at night caused
by these planned outages. You can imagine his reaction.
The simplest solution is to blackout these targets all night on a schedule in the console.
What if you need to run this refresh during the day?
Do you really want these targets to be unmonitored overnight?
What if the refresh failed? Trainers are not typically patient customers, particularly with a
roomful of idle trainees waiting for their lab.
Here's a solution that involves shell functions, EM CLI, and their related run-time scripts. We'll start by taking
a look at how the process would typically be done without shell functions, and then we will convert the script into
portable, scalable functions.
Create and Stop Blackouts Using Shell Scripts
Blackouts can be created through a series of CLI verbs to perform the following steps to test, execute, and then verify
the blackout status.
1.
Determine whether the target is already under blackout.
2.
If a blackout already exists, stop and delete it (to get the full duration of your new
blackout).
3.
Create and start a new blackout.
4.
Verify that the blackout is started by echoing its values to the screen and also to the log file.
These steps are illustrated in this simplified script. Your real script would test whether the database name
was passed as the $1 value at the command line and would then prompt or fail based on run-time conditions. For
instance, if the script is being executed by a live user, it should prompt for the database name, otherwise it will fail and
echo the cause to the logfile.
#!/bin/ti
# =====================================================
# File: create_blackout.sh
# Purpose: Create and initiate an OEM blackout
# Parameters: Blackout name as BO_NAME
# =====================================================
export BO_NAME=${1}_scripted_blackout
echo "\n\nCreating blackout named '${BO_NAME}' ...\n"
 
Search WWH ::




Custom Search