This chapter explains how you create, execute and monitor Oracle Site Guard operation plans.
This chapter includes the following sections:
Oracle Site Guard operation plans contain steps that must be executed during a disaster-recovery activity. In addition to the steps defined in an operation plan, the operation plan allows for such concepts as serial and parallel execution of steps, ignoring or retrying steps upon error, and so on.
Figure 5-1 shows the roadmap for managing Oracle Site Guard operations. Steps marked optional are required if the site topology and operation plans require the configuration. However, since most enterprise deployments are large, they typically require all the configuration steps listed in the figure below.
Note:
Before you create operation plans, ensure that you complete the tasks listed in Chapter 4, "Configuring Oracle Site Guard".
You must log in using the EM_SG_ADMINISTRATOR
role privilege to perform configuration tasks. Ensure that you have created the required user credentials as described in Section 3.2.2, "Creating Oracle Site Guard Administrator Users".
An operation plan contains the execution flow for the Oracle Site Guard operation. It is a pre-configured workflow consisting of a set of ordered actions (steps).
Before you execute any Oracle Site Guard disaster-recovery operation, you must create a plan for that operation.
Steps such as the following, can be included in an operation plan:
Stopping Oracle HTTP Servers.
Stopping the node managers, managed servers, and administration server in an Oracle WebLogic domain.
Performing a database role reversal with Oracle Data Guard.
Executing custom user scripts at certain points in the operation plan sequence.
Oracle Site Guard creates a default version of the operation plan based on the site topology and the Oracle Site Guard configuration. You can use this default operation plan or customize it depending on your configuration.
This section contains the following topics:
To create an operation plan, use one of the following methods:
To create an operation plan with the Enterprise Manager Cloud Control Console, follow these tasks:
Log in to Enterprise Manager as a user with EM_SG_ADMINISTRATOR
role privileges.
From the Targets menu, click Systems.
The Systems page is displayed.
On the Systems page, click the name of the system (Generic System) for which the plan is being created.
The Generic System page for this site is displayed.
Click Generic System > Site Guard > Operations.
The Site Guard Operations page is displayed.
Click Create.
The Create New Operation Plan dialog is displayed.
Enter the following details:
Plan Name: Enter a name for the plan.
Operation Type: Select an operation type from the following options:
Switchover
Failover
Start
Stop
Open for Validation
Revert to Standby
Note:
For information about Oracle Site Guard operation types, see Section 2.4, "Oracle Site Guard Workflows".
The options displayed in the dialog change depending on the operation type you select. For switchover and failover operation types, you must select the standby system for the plan. For start and stop operations, select the current role for the system.
Primary System: This field displays the name of the system for which this plan is being created. You cannot change the values in this field.
Standby System: Select a standby system from the list. Note that this option is enabled only when you select Switchover or Failover in the Operation Types field.
Current Role: Select either Primary or Standby. This is the role of the system that this plan applies to. The plan can only run when the system is assigned a role. Note that this option is enabled only when you select Start or Stop in the Operation Type field.
Depending on the Operation Type you select, configure the standby system accordingly.
Click Save.
Run the following emcli
commands in the command-line interface to create a new operation plan:
emcli create_operation_plan [-primary_system_name="name_of_primary_system"] [-standby_system_name="name_of_standby_system"] [-system_name="name_of_the_system"] [-operation="name_of_the_operation"] [-name="name_of_the_operation_plan"] [-role="role_associated_with_the_system"] [-like="name_of_the_operation_plan_from_which_the_steps_are_to_be_copied"
Note:
[ ]
indicates that the parameter is optional.Parameter | Description |
---|---|
-primary_system_name |
The name of your system associated with the primary site. This option is used for switchover or failover operations. |
-standby_system_name |
The name of your system associated with the standby site. This option is used for switchover or failover operations. |
-system_name |
The name of the system. This option is used for start or stop operations. |
-operation |
The function of the operation. Example: switchover , failover , start , stop , openforvalidation , or reverttostandby . |
-name |
The name of the operation plan. |
-role |
The role associated with a system, when you run an operation (start or stop ). |
-like |
Name of the operation plan from which the steps are to be copied. If this option is specified, system name, operation, and role are ignored. |
You can create and configure new operation plans by cloning (copying) an existing plan. This applies to all types of plans.
To clone a plan with the Enterprise Manager Cloud Control Console:
Log in to Enterprise Manager as an EM_SG_ADMINISTRATOR
user.
From the Targets menu, click Systems.
The Systems page is displayed.
Select the system name (Generic System) for which the operation plan is created. The Generic System page for that site is displayed.
Click Generic System > Site Guard > Operations.
The Site Guard Operations page is displayed.
Select an existing operation plan from the table and click Create Like.
Enter a name for the new plan.
Click Save.
You can perform the following tasks to update or edit an operation plan:
Change the order of the steps in an operation plan.
Enable or disable individual steps in the operation plan.
Choose to stop or continue a step in an operation plan if Oracle Site Guard encounters an error while running the operation plan.
Customize each step to execute steps in a serial order or parallel on different hosts.
Customize execution groups to sequence operation plan steps in a specific order.
Change the timeout for an individual operation step.
You can modify the steps in an operation plan, and save the updated operation plan at any point in time.
To edit and update operation plans use one of the following methods:
To edit and update an operation plan with Enterprise Manager Cloud Control Console, follow these steps:
Log in to Enterprise Manager with EM_SG_ADMINISTRATOR
role privileges.
From the Targets menu, click Systems.
The Systems page is displayed.
On the Systems page, click the name of the system (Generic System) for which this plan is being created.
The Generic System page for that site is displayed.
On the system's home page, from the Generic System > Site Guard > Operations.
The Site Guard Operations page is displayed.
A list of configured operation plans is displayed in the Operation Plans tab.
Select an existing operation plan by clicking on the plan listed in the Plan Name column.
The steps associated with the selected operation plan are listed in the Operation Details table located below the Operation Plan table. Each row in the table represents a step that is executed as part of the operation plan.
Select View > Columns > Show All to display all columns in the Operation Plan details table, including the additional columns for Script Id, Execution Group and Timeout (sec).
Click Edit to enable the options for updating and customizing the steps in the operation plan.
Select Move Up (green arrow), Move Down (red arrow), or Delete Step to sequence the steps in the operation plan.
In addition, select the attribute from the Error Mode, Execution Mode, or Run Mode columns.
An operation plan step cannot be moved out of the group it belongs to.
To use execution groups to sequence operation steps in a operation group:
Set the Execution Mode for the operation group to Parallel.
Select the Execution Group for each step in the operation group
All the steps in an execution group are executed in parallel. All the steps that share an execution group will not begin execution until all the steps in the previous execution group have finished execution.
If the execution mode is Serial, execution groups do not apply. The steps are always executed sequentially in the order they are listed.
To change the timeout for a step in the plan, type in a new timeout value for that step.
Click Save to update the plan.
To edit or update the operation plan, run the following emcli commands in the command-line interface:
Get the list of configured operation plans by running the following command:
emcli get_operation_plans
[-name="name_of_the_operation_plan"]
[-operation="type_of_operation"]
[-system_name="name_of_the_system"]
[-primary_system_name="name_of_the_primary_system"]
[-standby_system_name="name_of_the_standby_system"]
Note:
[ ]
indicates that the parameter is optional.Parameter | Description |
---|---|
-name |
The name of the operation plan. |
-operation |
The name of the operation. For example, switchover , failover , start , stop , openforvalidation , or reverttostandby .
This is an optional parameter. If you do not specify this parameter, then all the operation plans will be listed. |
-system_name |
The name of system used in the operation plan. If you specify this value, then you do not need to specify values for -primary_system_name and -standby_system_name . |
-primary_system_name |
The name of primary system used in the operation plan. You can specify the values for this parameter instead of the value -system_name . You can also use the -standby_system_name parameter for better filtering. |
-standby_system_name |
The name of the standby system used in the operation plan. You can specify the value for this parameter instead of the value for -system_name . The -primary_system_name parameter can also be additionally used for better filtering. |
Get the details of an operation plan that you want to update by running the following command:
emcli get_operation_plan_details
-name="name_of_the_operation_plan"
Parameter | Description |
---|---|
-name |
The name of the operation plan. |
Update the plan by running the following command:
emcli update_operation_plan -plan_name="name of the plan" -step_number="plan step number to update" -target_host="name of the target host" -target_name="name of the target" [-error_mode="the error mode"] [-enabled="flag specifying whether the step should be enabled"] [-execution_mode="execution mode"] [-execution_group="when execution_mode is parallel, then targets sharing the same execution group will execute in parallel"] [-timeout="timeout in seconds"] [-move="direction in which to move step"] [-delete "flag specifying whether step should be deleted"]
Note:
[ ]
indicates that the parameter is optional.Parameter | Description |
---|---|
-plan_name |
The name of the operation plan. |
-step_number |
The number of the step that should be updated. |
-target_host |
The name of the system. Updates all the steps related to this target host. |
-target_name |
The database target name. |
-error_mode |
The function of the operation. For example:stop or continue . |
-enabled |
Enter true or false . |
-execution_mode |
The execution mode. For example: Serial or Parallel When set to Parallel , then targets sharing the same execution group execute in parallel. |
-execution_group |
The execution group (a value between 1 and n, where n is the number of targets in the bucket) |
-timeout |
The timeout in seconds for the execution of the step. Value must be between 1 and 86400 (24 hours). |
-move |
Change the order by specifying Up or Down . |
-delete |
Whether you want to delete steps. Enter true or false . |
You can assign tags (alphanumeric identifier strings) to operation plans, or delete tags already assigned to operation plans, as follows:
To assign one or more tags to an existing operation plan run the following emcli command in the command-line interface:
emcli add_operation_plan_tags -name="name_of_the_operation_plan" -tags="names_of_tags separated by ;"
Parameter | Description |
---|---|
-name |
The name of the operation plan. |
-tags |
A semicolon-separated list of tags to add to the operation plan. The comma (,) is an invalid character. |
To delete one or more tags assigned to an existing operation plan run the following emcli command in the command-line interface:
emcli delete_operation_plan_tags -name="name_of_the_operation_plan" -tags="names_of_tags separated by ;" -all
Parameter | Description |
---|---|
-name |
The name of the operation plan. |
-tags |
A semicolon-separated list of tags to add to the operation plan. The comma (,) is an invalid character. |
-all |
Deleted all tags in the operation plan. Optional. This flag overrides all values passed to the tags argument. |
To delete an operation plan, use one of the following methods:
To delete an operation plan with Enterprise Manager Cloud Control Console, follow these steps:
Log in to Enterprise Manager with EM_SG_ADMINISTRATOR
role privileges.
From the Targets menu, click Systems.
The Systems page is displayed.
On the Systems page, click the name of the system (Generic System) for which this plan is being created.
The Generic System page for that site is displayed.
On the system's home page, from the Generic System > Site Guard > Operations.
The Site Guard Operations page is displayed.
A list of configured operation plans is displayed in the Operation Plans tab.
Select an existing operation plan by clicking on the plan listed in the Plan Name column.
Click Delete to delete the selected operation plan.
A confirmation pop-up window appears. Click Yes to confirm the action.
To delete an operation plan, run the following emcli
command in the command-line interface:
emcli delete_operation_plan
–name="name_of_the_operation_plan"
Parameter | Description |
---|---|
-name |
The name of the operation plan. |
Oracle Site Guard runs the Precheck utility before performing any operation, by default. You can also run the Precheck utility separately, before executing any Oracle Site Guard operations.
Oracle Site Guard performs the following Prechecks:
Checks the agent status on all hosts involved in the operation.
Checks if any new targets are added to the generic system after the operation plan is created.
Checks if all targets involved in the operation plan exist in the Enterprise Manager repository.
Detects if any targets are moved out or deleted from the generic system after the operation plan is created.
Performs Storage Role Reversal.
Runs Oracle Data Guard Broker Prechecks to ascertain whether the Database is ready for role reversal (for switchover/failover operation).
Performs Database Role Checks.
Performs Database Lag (Apply and Transport) Checks.
Runs checks on ZFS storage appliances to assert the role-change readiness.
To run the Precheck utility, use one of the following methods:
To run a Precheck utility with Enterprise Manager Cloud Control follow these steps:
Log in to Enterprise Manager Cloud Console as a user with EM_SG_ADMINISTRATOR
role privileges.
From the Targets menu, click Systems.
The Systems page is displayed.
On the Systems page, click the name of the system (Generic System) for which the Prechecks are to be run.
Click Generic System > Site Guard > Operations. The Site Guard Operations page is displayed.
Select an operation plan from the list by clicking on the plan name from the list.
Click Run Prechecks.
A dialog box is displayed. Click Yes to confirm the action.
To track the progress and results of the Precheck, click the click here link in the Confirmation pane at the top of the page, or navigate to Enterprise > Provisioning and Patching > Procedure Activity.
For more details about monitoring a procedure activity see Section 5.6, "Monitoring Oracle Site Guard Operations".
To run the Oracle Site Guard Precheck utility with EMCLI, run the following command:
emcli run_prechecks
-operation_plan="operation_plan_name"
[-database_lag_checks="true"|"false"]
Note:
[ ]
indicates that the parameter is optional.Parameter | Description |
---|---|
-operation_plan |
Enter the name of your operation plan. |
-database_lag_checks |
Run database lag checks as part of Prechecks for all data guard configured databases. This parameter is optional.
The default value is |
To schedule a health check for an operation plan, use one of the following methods:
Scheduling a Health Check with Enterprise Manager Cloud Control Console
Stopping a Health Check with Enterprise Manager Cloud Control Console
To schedule Health Checks with Enterprise Manager Cloud Control follow these steps:
Log in to Enterprise Manager Cloud Console as a user with EM_SG_ADMINISTRATOR
role privileges.
From the Targets menu, click Systems.
The Systems page is displayed.
On the Systems page, click the name of the system (Generic System) for which the Prechecks are run.
Click Generic System > Site Guard > Operations.The Site Guard Operations page is displayed.
Select an operation plan from the list by clicking on the plan name from the list.
Click Schedule Health Checks.
The Schedule Health Checks for operation plan dialog box is displayed.
Configure the schedule for the health check.
Click Save.
To inspect the results for each Health Check, navigate to Enterprise > Provisioning and Patching > Procedure Activity.
For more information about monitoring procedure activity see Section 5.6, "Monitoring Oracle Site Guard Operations".
If the Enterprise Manager job system cannot start the execution of a job within a time period equal to the scheduled time plus grace period, it sets the job status to Skipped. By default, health check jobs are scheduled with indefinite grace periods.
To schedule a Health Check with EMCLI, run the following command in the command-line interface:
emcli schedule_siteguard_health_checks -operation_plan={name of the operation plan} -schedule= { start_time:yyyy/MM/dd HH:mm; [tz:{java timezone ID};] [frequency:interval/weekly/monthly/yearly;] [repeat:tx;] [end_time:yyyy/MM/dd HH:mm;] [grace_period:xxx;] }
Note:
[ ]
indicates that the parameter is optional.Parameter | Description |
---|---|
-operation_plan |
Enter the name of your operation plan. |
-schedule |
The schedule for the health check. Enter the values for the following parameters:
- - - If the frequency is set to If the frequency is set to If the frequency is set to - - If frequency is set to If the frequency is set to - - - For example: Examples: start_time:2014/06/10 15:45 start_time:2014/10/29 2:00;frequency:interval;repeat:1d start_time:2014/08/10 01:00;frequency:interval;repeat:1w start_time:2014/08/10 01:00;frequency:weekly;days:6,7;grace_period:60;tz:America/New_York |
-notify |
If set, a health check report is mailed. |
-email |
The email address to use for notifications. This email address must be a configured email address for the current user. |
A grace period is a period of time that defines the maximum permissible delay when attempting to start a scheduled job (all health checks are scheduled as jobs).
When configuring the initial delay (grace period) for a health check ensure that you correctly calculate the grace period.
To stop a scheduled Health Check with the Enterprise Manager Cloud Control:
Log in to Enterprise Manager Cloud Console as a user with EM_SG_ADMINISTRATOR
role privileges.
From the Targets menu, click Systems.
The Systems page is displayed.
On the Systems page, click the name of the system (Generic System) for which the Prechecks are run.
Click Generic System > Site Guard > Operations.The Site Guard Operations page is displayed.
Select an operation plan from the list by clicking on the plan name from the list. This operation plan must already have a health check scheduled.
Click the Stop Health Checks button.
Click Yes in the confirmation dialog.
To stop a Health Check with EMCLI, run the following command in the command-line interface:
emcli stop_siteguard_health_checks -operation_plan={name of the operation plan}
Parameter | Description |
---|---|
-operaton_plan |
The name of your operation plan. |
Use one of the following methods to start an operation plan:
Executing Oracle Site Guard Operation Plan with Enterprise Manager Cloud Control Console
Executing Oracle Site Guard Operation Plan with EMCLI Command
To execute an operation plan with Enterprise Manager Cloud Control console, complete the following tasks:
Log in to Enterprise Manager using the EM_SG_ADMINISTRATOR
role privileges.
From the Targets menu, click Systems.
The Systems page is displayed.
On the Systems page, click the name of the system (Generic System) for which the operation plan is being executed.
On the Generic System page, click Generic System > Site Guard > Operations.
The Site Guard Operations page is displayed.
Select an operation plan from the list.
Click Execute Operation.
A dialog box is displayed.
Select Run Prechecks check box (selected by default) to run Prechecks before executing the operation plan.
Click Yes to confirm the action.
To track the progress and results of the operation, click the click here link in the Confirmation pane at the top of the page, or navigate to Enterprise > Provisioning and Patching > Procedure Activity.
For more details about monitoring a procedure activity see Section 5.6, "Monitoring Oracle Site Guard Operations".
To execute an operation plan, run the following EMCLI
command in the command-line interface:
emcli submit_operation_plan -name="name_of_operation_plan" [-run_prechecks="true | false"] [-stop_primary="flag_specifying_whether_primary_site_to_be_stopped_during_failover"] [-database_lag_checks="true"|"false"]
Note:
[ ]
indicates that the parameter is optional.Parameter | Description |
---|---|
-name |
The name of the operation plan. |
-run_prechecks |
The run_prechecks value (true or false ).
By default, the value of this parameter is If you set the value to |
-stop_primary |
Whether to stop targets on primary site during a Failover operation. Set value true or false . |
-database_lag_checks |
Run database lag checks as part of Prechecks for all Data Guard configured databases. This parameter is optional.
The default value is |
To monitor an operation activity, use one of the following methods:
This section contains the following topics:
To monitor an operation activity submitted for execution, complete the following steps:
Log in to Enterprise Manager using the EM_SG_ADMINISTRATOR
role privileges.
In the Enterprise menu, click Provisioning and Patching and then click Procedure Activity. The Provisioning page is displayed.
Alternately, navigate to a Site's operation activities page as follows:
On the Systems page, click the name of the system (Generic System) for which the operation plan was executed.
Click Generic System > Site Guard > Operations
Click the Operation Activities tab.
In the Procedure Activity table, click the name of the activity of operation you want to monitor.
The Procedure Activity page for that operation is displayed. See Figure 5-2.
Click the drop-down symbol next to the top-level step to view the sub-steps. The hierarchical steps of the activity are displayed. See Figure 5-3.
Operations in progress can be suspended and resumed later. You can also stop the operations that you do not want to resume. Follow these steps:
Log in to Enterprise Manager using the EM_SG_ADMINISTRATOR
role privileges.
In the Enterprise menu, click Provisioning and Patching and then click Procedure Activity. The Provisioning page is displayed.
In the Procedure Activity table, click the name of the operation you want to monitor.
The Procedure Activity page for that operation is displayed.
Click Procedure Actions located on the right-hand side of the page.
Click an action from the drop-down menu. See Figure 5-4.
To monitor the status of an operation plan with EMCLI, complete the following steps in the command-line interface:
Get a list of procedures by running the following command:
emcli get_instances [-type={procedure type}] [-format=name:] [-script] [-noheader]
Note:
[ ]
indicates that the parameter is optional.Parameter | Description |
---|---|
-type |
The procedure type. This parameter is optional. |
-format |
The output format of the list of instances. Enter pretty , script, or csv . This parameter is optional and the default value is pretty . |
-script |
Whether the output format is script or not. This parameter is optional. |
-noheader |
Do not display column headers. This parameter is optional. |
Note down the GUID for the operation in the list of operations displayed by the emcli get_instances
command.
Get the status of the operation:
emcli get_instance_status -instance="GUID"
Oracle Site Guard uses the Enterprise Manager Cloud Control deployment procedures framework to orchestrate disaster-recovery operations on remote hosts. The framework provides error management support through error modes.
Errors encountered during operation plan execution can be managed in multiple ways. Oracle Site Guard provides an option to define the error mode for individual steps, and also lets you enable or disable steps. For example, if an operation step has an associated error mode of 'Stop on Error', Oracle Site Guard stops the operation while executing that step.
To retry that step and continue the operation, complete the following steps:
Log in to Enterprise Manager using the EM_SG_ADMINISTRATOR
role privileges.
In the Enterprise menu, click Provisioning and Patching and then click Procedure Activity. The Provisioning page is displayed.
In the Procedure Activity table, click the name of the operation you want to change.
The Procedure Activity page for that operation is displayed.
Click the drop-down symbol next to the top-level steps to view the sub-step. The hierarchical steps of the activity are displayed. Click the drop-down symbols at the hierarchical step until you reach the step that encountered the error.
See Figure 5-5.
Select the step, and click Actions. A drop-down menu is displayed.
From the drop-down menu, click the action that you want Oracle Site Guard to perform to manage this error.
Click Ignore to ignore the error, and continue with the other steps in the plan.
Click Retry to re-run the step.
Click Update and Retry to update the parameters for this step, and re-run the step.
Note:
You cannot change the error mode of a step with the steps provided in this section. To change an error mode of a step, edit the operation as described in Section 5.2.3, "Editing and Updating Operation Plans."
For further information about how to diagnose execution errors, see Chapter 6, "Troubleshooting Oracle Site Guard."
While using Oracle Site Guard to test disaster recovery work flows or isolated parts of work flows, you might encounter a situation where you need to manually reconfigure site roles, and explicitly designate a site as the primary site. When you designate a site as a primary site, or manually reconfigure site roles, the other site is automatically designated as the Standby site.
To manually reconfigure site roles, use one of the following methods:
To manually reconfigure site roles with Enterprise Manager Cloud Control Console, complete the following steps:
Log in to Enterprise Manager Cloud Console as a user with EM_SG_ADMINISTRATOR
role privileges.
From the Targets menu, click Systems.
The Systems page is displayed.
Click the name of the system (Generic System) that you want to designate as the primary site.
The Generic System page for the site is displayed.
On the home page of the system, from the Generic System menu, click Site Guard, and then click Configure.
The Site Guard Configuration page is displayed.
Click Set as Primary.
To manually reverse the roles of the primary and standby sites, run the following EMCLI commands in the command-line interface:
Note:
For information about logging in to the Enterprise Manager Command-Line Interface, see Oracle Enterprise Manager Command Line Interface Guide.emcli update_siteguard_configuration -primary_system_name="primary_system_name" -standby_system_name="standby_system_name" [-reverse_role="flag_specifying_whether_system_roles_to_be_reversed"] [-role="new role for the standby site"]
Note:
[ ]
indicates that the parameter is optional.Parameter | Description |
---|---|
-primary_system_name |
The name of the system that is the current primary site and needs to be designated as the new standby site. |
-standby_system_name |
The name of the system that is the current standby site and needs to be designated as the new primary site. |
-reverse_role |
Reverse roles between primary and standby systems. Optional. If specified, only one standby system can be specified with the -standby_system_name parameter. |
-role |
The new role for the site. Optional. One of the following:Primary, Standby, or ValidateStandby. Optional flag.
|