Skip Headers
Oracle® Enterprise Manager Lifecycle Management Administrator's Guide
12c Release 2 (12.1.0.2)

Part Number E27046-08
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Index
Index
Go to Feedback page
Contact Us

Go to previous page
Previous
Go to next page
Next
PDF · Mobi · ePub

30 Using Oracle Site Guard

This chapter describes how to set up Oracle Site Guard for your existing Oracle Fusion Middleware disaster recovery solution, to perform operations like switchover and failover on the primary site and the standby site.

It contains the following topics:

New Features of Oracle Site Guard in Enterprise Manager Cloud Control 12c Release 2

This section provides an overview of the new features available in Oracle Site Guard in Enterprise Manager Cloud Control 12c Release 2 (Fusion Middleware plug-in release 12.1.0.3).

User Interface for Creating Oracle Site Guard Configuration

You can use the Enterprise Manager Cloud Control Console user interface to perform the following tasks:

  • Define Sites

  • Associate Credentials for Site

  • Associate Pre-Scripts and Post-Scripts

  • Associate Storage Scripts

For more information, see "Configuring Oracle Site Guard".

Preferred Credential Support

In this release, you can use named credentials or preferred credentials to run an operation plan.

Preferred credentials are used to simplify access to managed targets by storing target login credentials in the Management Repository. With preferred credentials set, users can access an Enterprise Manager target that recognizes those credentials, without being prompted to log in to the target. Preferred credentials are set on a per-user basis, thus ensuring the security of the managed enterprise environment.

  • Default Credentials: Default credentials can be set for a particular target type, and will be available for all the targets of the target type. It will be overridden by target preferred credentials.

  • Target Credentials: Target credentials are preferred credentials set for a particular target. They could be used by applications such as the job system, notifications, or patching. For example, if the user chooses to use preferred credentials while submitting a job, then the preferred credentials set for the target (target credentials) will be used. If the target credentials are not present, the default credentials (for the target type) will be used. If the default credentials are not present, the job will fail. If not specified, by default, preferred credentials refer to preferred target credentials.

For more information about setting up preferred credentials, see "Setting Preferred Credential Using EMCLI Commands".

Re-Order Execution Order

For more information, see "Changing Execution Orders".

Important Notes Before You Begin

Read the following notes before you start configuring Oracle Site Guard for Oracle Fusion Middleware components:

Ensure that the disaster recovery environment is set up according to Oracle-recommended guidelines. For more information, see the following sections in the Oracle Fusion Middleware Disaster Recovery Guide:

Overview of Oracle Site Guard

Oracle Site Guard primarily orchestrates switchover and failover between two disaster recovery sites. These sites should be created, as described in this chapter. Oracle Site Guard offers the following features:

This section includes the following topics:

Benefits of Oracle Site Guard

Oracle Site Guard provides the following benefits:

Reduction of Errors Due to Prepared Responses

Oracle Site Guard helps in reducing the possibility of human error in case of disasters. The recovery strategies are mapped out, tested, and rehearsed in prepared responses within the application. After starting an Oracle Site Guard operation for disaster recovery, human intervention is not required.

Storage Integration

Oracle Site Guard provides an easy mechanism to integrate with any storage. It integrates with storage appliances to perform switchover or failover, by using callouts to any user-specified storage role reversal scripts in the operation workflow.

Target Dependencies

Oracle Site Guard automatically handles dependencies between the targets while starting or stopping a site.

End-to-End Disaster Recovery Automation

Oracle Site Guard provides an end-to-end orchestration of the Oracle Site Guard operations by loosely integrating with storage appliances, to perform storage role reversals. It simultaneously integrates with Oracle Data Guard Broker to perform database role reversals. Oracle Site Guard then shuts down the primary site before performing disaster recovery operations like switchover or failover and brings up the standby site after the Oracle Site Guard operation is completed.

After Oracle Site Guard is configured, it manages all components in an application during an operation such as failover and switchover, and ensures that these operations are complete.

Oracle Site Guard Operations

Oracle Site Guard ensures high availability, data protection, and disaster recovery for Oracle Fusion Middleware 11g. It automates the following Oracle Site Guard operations:

  • Stopping a site

  • Starting a site

  • Site Switchover

  • Site Failover

Site Representation in Enterprise Manager Cloud Control

A site is a collection of related targets in a data center. Oracle Site Guard performs operations like start-site, stop-site, switchover, and failover, on the site. It is required to run a group of applications simultaneously. For example, a site could consist of Oracle Fusion Middleware instances, databases, and storage devices. Oracle Site Guard uses the Enterprise Manager Cloud Control generic system target to represent a site. Every site, whether primary or standby, is represented as a generic system, which is a collection of other target types, such as Oracle Database and Oracle Fusion Middleware Domain. Oracle Site Guard only supports Enterprise Manager deployments where both primary and standby sites are managed by a single Enterprise Manager Cloud Control instance.

Figure 30-1 shows an overview of an Oracle Fusion Middleware Disaster Recovery topology managed by a single Enterprise Manager Cloud Control instance.

Figure 30-1 Primary and Standby Site for Oracle Fusion Middleware Disaster Recovery Topology Managed by Enterprise Manager Cloud Control

Description of Figure 30-1 follows
Description of "Figure 30-1 Primary and Standby Site for Oracle Fusion Middleware Disaster Recovery Topology Managed by Enterprise Manager Cloud Control"

The following are the key aspects of the topology in Figure 30-1:

  • A single Enterprise Manager Cloud Control instance monitors the primary site and the standby site.

  • Oracle Management Agent (EM Agent) is installed on all hosts in the primary site and the standby site. For example:

    • OPMN managed system components (WEBHOST1 and WEBHOST2)

    • Oracle Fusion Middleware Applications (APPHOST1 and APPHOST2)

    • Oracle RAC Database (DBHOST1 and DBHOST2)

    Oracle Management Agent (EM Agent) is one of the core components of Enterprise Manager Cloud Control that enables you to convert an unmanaged host to a managed host in the Enterprise Manager system. The Management Agent works in conjunction with the plug-ins to manage the targets running on that managed host.

  • When there is a failure or planned outage of the primary site, Oracle Site Guard automates the following steps to enable the standby site to assume the production role in the topology:

    1. Stops services and applications running on the primary site, and unmounts the storage on the primary site.

    2. Stops the replication from the primary site to the standby site (when a failure occurs, replication stops due to the failure), and performs storage role reversal.

    3. Performs a failover or switchover of the Oracle Databases using Oracle Data Guard Broker.

    4. Mounts the storage on the standby site.

    5. Starts the services and applications on the standby site, and assumes the production role.

    Note:

    If continuous replication is not configured, Oracle recommends that you create a final replication between the primary and the standby sites, before the storage switchover.

Terminology Used in Oracle Site Guard

The following terms are used throughout this chapter when discussing about Oracle Site Guard:

Using Oracle Site Guard: Task Overview

This section briefly describes how to use Oracle Site Guard to orchestrate switchover or failover operations between two sites. It contains the following topics:

Task Overview

Figure 30-2 shows a flow chart of the tasks that you need to perform while using Oracle Site Guard for switchover or failover operations.

Figure 30-2 Task Overview of Oracle Site Guard

Surrounding text describes Figure 30-2 .

Task Roadmap

Table 30-1 describes each of the steps in the task-overview flow chart, which is shown in Figure 30-2. The table also provides pointers for to get more information about each of the task in the process.

Table 30-1 Table Describing the Steps for Using Oracle Site Guard

Task Description More Information

Discover targets on the primary site and the standby site

The Oracle Enterprise Manager Cloud Control Administrator's Guide guide provides a high-level overview of how to discover targets on a primary site.

Discovering Targets on the Primary Site and the Standby Site

Create generic systems for primary site and standby site using EMCC

Oracle Site Guard uses the Enterprise Manager Cloud Control generic system target to represent a site. Oracle Site Guard only supports Enterprise Manager deployments where both primary and standby sites are managed by single Enterprise Manager Cloud Control.

Creating Generic Systems for the Primary and Standby Sites

Create credentials for Oracle Site Guard using EMCC

Create named and preferred credentials before associating them with the Oracle Site Guard configuration.

Creating Credentials

Configure software library using EMCC

Oracle Software Library (Software Library) is a repository that stores scripts that Oracle Site Guard requires, to execute the operation plan. Configuring Oracle Software Library is a one-time process.

Configuring the Software Library

Configure Oracle Site Guard on primary sites and standby sites

You need to create pre-scripts, post-scripts, and storage scripts before configuring Oracle Site Guard on primary sites and standby sites.

Configuring Oracle Site Guard

Create custom pre scripts and post scripts

Custom scripts (pre-scripts and post-scripts) can be created and executed at the site level, for a given Oracle Site Guard operation. This is an optional configuration.

Creating Pre-Scripts and Post-Scripts

Create storage mount or unmount, or switchover or failover scripts

Create storage scripts (mount, unmount, switchover, failover) to manage storage-related tasks during switchover and failover operations.

Creating Storage Scripts

Associate credentials with Oracle Site Guard using EMCLI commands or EMCC

After you create named and preferred credentials, ensure that you associate them with the Oracle Site Guard configuration.

Update credential association

After you associate credentials with Oracle Site Guard configuration, you can update them later, as required.

Associating Credentials

Associate custom scripts with Oracle Site Guard using EMCLI commands or EMCC

If you need to execute one or more custom scripts (pre-scripts and post-scripts) as part of a Oracle Site Guard operation workflow, ensure that you associate it with the Oracle Site Guard configuration.

Associating Pre-Scripts and Post-Scripts

Update custom scripts association

After you associate custom scripts with the Oracle Site Guard configuration, you can update them later, as required.

Associate storage script with Oracle Site Guard using EMCLI commands or EMCC

The storage scripts (mount, unmount, switchover, failover) need to be associated with Oracle Site Guard configuration. These scripts are then executed at designated points in the Oracle Site Guard switchover or failover workflow.

Update storage scripts association

After you associate storage scripts with Oracle Site Guard configuration, you can update them later, as required.

Create operation plans using EMCLI commands, to execute Oracle Site Guard operation

An operation plan contains the execution flow for the Oracle Site Guard operation. You can either use the default operation plan or update it to change the order of targets within their corresponding steps.

Creating an Operation Plan

Run operation plans using EMCLI commands to switchover or failover, or to start or stop sites

After an operation plan is created for a particular operation type, you can execute it when required, to perform the corresponding operation.

Monitor the operation plan execution using EMCC console

After executing an operation plan, you can monitor its status using the EMCC console.

Monitoring an Operation Plan


Installing Oracle Site Guard

Oracle Site Guard is included with Enterprise Manager Cloud Control 12c Release 1 (12.1.0.3). You can manage an Oracle Site Guard configuration by using Enterprise Manager command-line interface (EMCLI) or console. To install Oracle Site Guard, complete the following steps:

Note:

For information about Oracle Site Guard licensing, see Oracle Enterprise Manager Licensing Information.

Prerequisites for Configuring Oracle Fusion Middleware Products for Oracle Site Guard

The following are the prerequisites for configuring Oracle Fusion Middleware 11g products for Oracle Site Guard:

Discovering Targets on the Primary Site and the Standby Site

For information about discovering targets on the primary site, see "Adding Targets" in the Oracle Enterprise Manager Cloud Control Administrator's Guide.

Oracle Site Guard supports discovery of the following target types:

  • Oracle Fusion Middleware farm

  • Oracle Fusion Middleware managed system components, such as Oracle HTTP Server and Oracle Internet Directory (part of the Oracle Fusion Middleware farm)

  • Real Application Cluster (RAC) databases

  • Single instance database

For a two-site deployment, the targets in the primary site should be discovered first, followed by the targets in the standby site.

A site should be up for its targets to be discovered. For a two-site deployment, you must first discover the targets in the primary site. Once you discover the targets in the primary site, you must manually perform a switchover operation, so that the standby site takes over the production role, as described in "Performing a Switchover" in Oracle Fusion Middleware Disaster Recovery Guide

After performing a switchover, you can discover the targets for the standby site by completing the steps described in "Adding Targets" in the Oracle Enterprise Manager Cloud Control Administrator's Guide.

Note:

After you discover the targets for the standby site, you must manually perform a switchover operation, so that the primary site takes over the production role, as described in "Performing a Switchover" in Oracle Fusion Middleware Disaster Recovery Guide.

Creating Generic Systems for the Primary and Standby Sites

You must create a generic system for the primary site and the standby site. Each generic system must include all targets, Oracle Fusion Middleware farms and Databases, pertaining to the site that it represents.

Create the generic system using one of the following options:

Using Enterprise Manager Cloud Control Console to Create a Generic System

To create a generic system for the primary site, using an Enterprise Manager Cloud Control console, complete the following steps:

  1. Log in to Enterprise Manager as an EM_CLOUD_ADMINISTRATOR user.

  2. Select Targets and then select Systems.

    The Systems page is displayed.

  3. Select Generic System from the drop-down menu and click Add.

  4. In the General section, enter the name for your primary system.

  5. In the Member section, click Add.

  6. Choose the targets, and click Select. You must associate the following:

    • Oracle Fusion Middleware Farm which includes:

      • Administration Server

      • Managed Servers

      • OPMN-managed system components

    • If you are using Oracle RAC Database then you must associate it with a Cluster Database target. For a single database instance, you must associate it with a Database Instance target.

    Note:

    Ensure that the following target types are not added to the generic system:
    • Database System

    • Individual RAC Database instances

  7. Select the time zone from the drop-down menu.

  8. Click Next.

    The Define Associations page is displayed.

  9. Click Next.

    The Availability Criteria page is displayed.

  10. From Availability Criteria, select the Any Of The Key Members option.

  11. Select AdminServer in the Members pane and double-click.

    The AdminServer is removed from the Members pane and added in the Key Members pane.

  12. Click Next.

    The Charts page is displayed.

  13. Click Next.

    The Review page is displayed.

  14. Review your settings, and click Finish.

Using EMCLI Commands to Create a Generic System

Create a generic system by running the following emcli commands (located at OMS_HOME/bin/emcli) in the command-line interface:

Note:

For information about setting up a new EMCLI client, see the Enterprise Manager Command-Line Interface Download page within the Cloud Control console. To access the page, in Cloud Control, from the Setup menu, click Command Line Interface.
emcli create_system
      -name="name"
      -type=system
      -add_members="name1:type1;name2:type2;..."]...
      -timezone_region="actual_timezone_region"

Note:

To get status and alert information for targets, you can run get_targets command. For more information, see the chapter "Verb Reference" in the Oracle Enterprise Manager Command Line Interface Guide.
Parameter Description
-name Enter a name for the system.
-type Enter generic_system as the type.
-add_members Add existing targets to the system. Each target is specified as a name-value pair target_name:target_type. You can specify this option more than once.
-timezone_region Specify the time zone region. The time zone you specify here is used for scheduling operations such as jobs and blackouts, on the system.

See "create_system" in the Oracle Enterprise Manager Command Line Interface Guide.

Creating Credentials

Create the credentials for the following targets associated with Oracle Site Guard, using Enterprise Manager Cloud Control Console:

  • Host (for normal user)

  • Host (users with root privileges)

  • Oracle WebLogic Server

  • Oracle Database

Oracle Site Guard supports the following credentials:

  • Named Credentials

  • Preferred Credentials

    For more information, see "Preferred Credentials" in the Oracle Enterprise Manager Cloud Control Administrator's Guide.

Notes:

  • The credentials created here are later associated with the Oracle Site Guard configuration. Oracle Site Guard supports specifying the same credentials for all targets of the same target type. For example, all databases in a system can have the same sysdba credentials. Oracle Site Guard also allows the targets of same kind to have different credentials.

  • If the credentials are the same across the nodes (primary and standby site), you need not create credentials for the targets running on the standby site.

Creating Named Credentials Using Enterprise Manager Cloud Control Console

To create a named credentials using Enterprise Manager Cloud Control Console, complete the following steps:

  1. Log in to Enterprise Manager as an EM_CLOUD_ADMINISTRATOR user.

  2. From the Setup menu, select Security, then select Named Credentials.

    The Named Credentials page is displayed.

  3. Click Create.

    The Create Credential page is displayed.

  4. In the General Properties section, specify the following:

    • Credential name: Enter a name for the credential.

    • Credential description: Enter the credential description.

    • Authenticating Target Type/ Credential type/ Scope: Enter the details as specified in the following table:

      Element Host Details Host (root-User Privileges) Details Oracle WebLogic Server Database Instance
      Authenticating Target Type Host Host Oracle WebLogic Server Database Instance
      Credential type Host Credentials Host Credentials Oracle WebLogic Credentials Database Credentials
      Scope Global Global Global Global

  5. In the Credential Properties section, specify the following:

    • UserName: Enter the username.

    • Password: Enter the password.

    • Confirm Password: Enter the password again.

    • Run Privilege/ Role: Enter the details as specified in the following table:

      Element Host Host (Users with root privileges) Oracle WebLogic Server Database Instance
      Run Privilege None Select Sudo and enter values in the Run As fields Oracle WebLogic Server Administration user credentials Oracle Database SYS user credential
      Role None None None SYSDBA

  6. Click Test and Save. To test credentials, select the appropriate Test Target Type from the drop-down menu for which you want to test the credentials, and specify Test Target Name.

Creating Named Credentials Using EMCLI Commands

You can create a named credential by running the following emcli commands in the command-line interface:

emcli create_named_credential
         -cred_name="cred_name"
         -auth_target_type="auth_target_type"
         -cred_type="cred_type"
         -attributes="p1:v1;p2:v2"
Parameter Description
cred_name Sets the name for this credential set.
auth_target_type Set the authenticating target type.
cred_type Set the credential type for the target/credential set.
attributes Enter the following credential column values:
colname:colvalue;colname:colvalue

You can change the value of the separator using -separator=attributes=newvalue. You can also change the value of the sub-separator using -subseparator=attributes=newvalue.


Setting Preferred Credential Using EMCLI Commands

You can set a named credential as a target-preferred credential by running the following emcli commands in the command-line interface:

Note:

Oracle recommends that you to set the preferred credential using the emcli commands.
emcli set_preferred_credential 
        -set_name="set_name"
        -target_name="target_name"
        -target_type="type"
        -credential_name="name"
        [-credential_owner ="owner]"

Note:

[ ] indicates that the parameter is optional.
Parameter Description
set_name Sets the preferred credential for this credential set.
target_name Sets the preferred credential for this target.
target_type Target type for the target/credential set.
credential_name Name of the credential.
credential_owner Owner of the credential. This defaults to the currently logged-in user.

Example:

emcli set_preferred_credential 
        -set_name="HostCredsNormal"
        -target_name="test.example.com"
        -target_type="host"
        -credential_name="MyHostCredentials"
        -credential_owner="Admin"

Configuring the Software Library

Oracle Software Library (Software Library) is a repository that stores scripts required by Oracle Site Guard to execute the operation plan. To configure the storage location for the Oracle Software Library, complete the following steps:

Note:

Configuring Oracle Software Library is a one-time process. Enterprise Manager requires you to configure Oracle Software Library before proceeding with any deployment-procedure related tasks. Perform the steps listed in this section after confirming that Oracle Software Library is not configured.
  1. Log in to Enterprise Manager as an EM_CLOUD_ADMINISTRATOR user.

  2. From the Setup menu, select Provisioning and Patching, then select Software Library.

    The Software Library: Administration page is displayed.

  3. Select OMS Shared Filesystem from the Storage Type drop-down box.

  4. Click Add.

  5. Specify a Name and Location that is accessible to all OMSs and click OK.

    Note:

    As the storage location for the Software Library must be accessible to all OMSs as local directories, in a multi-OMS scenario, you must set up a clustered filesystem using OCFS2 or NFS. For single OMS systems, any local directory is sufficient.

A job is executed to upload all the out-of-box content.

Note:

For more information, see "Configuring Software Library" in the Oracle Enterprise Manager Cloud Control Administrator's Guide.

Configuring Oracle Site Guard

This section describes the setup and configuration of Oracle Site Guard in Enterprise Manager Cloud Control to manage Oracle Fusion Middleware Disaster operations on the primary site and the standby site.

Ensure that you create the scripts that are needed to configure Oracle Site Guard:

Creating Pre-Scripts and Post-Scripts

You can create custom scripts to be executed at the site level for the Oracle Site Guard operation (stop, start, switchover, or failover) workflow. Each script can be associated with more then one host in a site. You can create the following scripts:

Create the required scripts and save them in a location of your choice on each of the hosts from where the script will be executed. After creating and testing the script, ensure that you associate the script with Oracle Site Guard, as described in "Associating Pre-Scripts and Post-Scripts".

Notes:

  • A custom script should be a shell script and it must have clearly defined return codes. The script must return 0 on success, and non-zero values on failure.

  • Ensure that you have the required privilege to run the script.

Creating Storage Scripts

You can create the following storage scripts:

Create the required scripts and save them to the location of your choice on each of the hosts from where the script will be executed. After creating and testing the script, you must associate that with Oracle Site Guard, as described in "Associating Storage Scripts".

Oracle Site Guard provides the following sample scripts for Sun ZFS and NetApp Storage appliances:

The sample scripts are located in the AGENT_HOME/plugins/oracle.sysman.emas.agent.plugin_12.1.0.3.0/scripts directory after completing the Oracle Management Agent (EM Agent) installation.

Notes:

After running the script, verify that the execution return code value is 0. If you get any other value for the return code, then the script is considered to have failed. Ensure that you implement the script with the proper return code.

The following are examples of scripts Sun ZFS and NetApp Storage appliances:

After creating the required scripts, complete the following steps to configure Oracle Site Guard:

Configuring Sites Using Generic Systems

Configure the primary and standby sites using generic systems, and associate them with Oracle Site Guard.

You can add the configuration for the primary and standby sites using one of the following options:

Configuring Sites Using Enterprise Manager Cloud Control Console

To associate the standby system with the primary system, complete the following steps:

  1. Log in to Enterprise Manager as an EM_CLOUD_ADMINISTRATOR user.

  2. From the Targets menu, select Systems.

    The Systems page is displayed.

  3. Select the primary system (created in "Creating Generic Systems for the Primary and Standby Sites").

  4. Click Generic System > Site Guard > Configure.

    The Site Guard Configuration page is displayed.

  5. In the Standby System(s) section, click Add.

    The Search and Select: Standby Systems page is displayed.

  6. Choose the standby system, and click Select.

  7. Click Save.

Configuring Sites Using EMCLI Commands

To add the configuration for the primary and standby sites, you must run the following emcli commands in the command-line interface:

Note:

For information about logging in to emcli, see chapter "Command Line Interface Concepts and Installation" in the Oracle Enterprise Manager Command Line Interface Guide.
emcli create_siteguard_configuration 
      -primary_system_name="system_name"
      -standby_system_name="system_name"
Parameter Description
-primary_system_name Enter the name of your system, which is associated with the primary site.
-standby_system_name Enter the name of your system, which is associated with the standby site.

To display information about the association between existing primary and standby sites, run the following emcli commands in the command-line interface:

emcli get_siteguard_configuration
         -primary_system_name="system_name"
         -standby_system_name="system_name"

Associating Credentials

You must associate credentials created in "Creating Credentials" with the targets in each site.

Associate the credentials for the following targets:

  • Host, where Oracle Fusion Middleware and Oracle Database are installed and configured (for normal user and users with root privileges)

  • Oracle WebLogic Administration Server

  • Oracle Database

You can associate the credentials using one of the following options:

Associating Credentials Using Enterprise Manager Cloud Control Console

To associate the credentials for the primary site, complete the following steps:

  1. Log in to Enterprise Manager as an EM_CLOUD_ADMINISTRATOR user.

  2. Select Targets and then select Systems.

    The Systems page is displayed.

  3. Select the primary system (created in "Creating Generic Systems for the Primary and Standby Sites").

  4. Click Generic System > Site Guard > Configure.

    The Site Guard Configuration page is displayed.

  5. Click the Credentials tab.

  6. In the Normal Host Credentials section, click Add.

    The Add Normal Host Credentials page is displayed.

  7. Enter the following details:

    • Target: Select the target name.

    • Use Preferred Credentials: If you are using preferred credentials, then select the checkbox.

    • Named Credential: If you are using named credentials, then select the credential name.

    Click Save.

  8. In the Privileged Host Credentials section, click Add.

    The Add Privileged Host Credentials page is displayed.

  9. Enter the following details:

    • Target: Select the target name.

    • Use Preferred Credentials: If you are using preferred credentials, then select the checkbox.

    • Named Credential: If you are using named credentials, then select the credential name.

    Click Save.

  10. In the Oracle WebLogic Administration Credentials section, click Add.

    The Add Oracle WebLogic Administration Credentials page is displayed.

  11. Enter the following details:

    • Target: Select the target name.

    • Use Preferred Credentials: If you are using preferred credentials, then select the checkbox.

    • Named Credential: If you are using named credentials, then select the credential name.

    Click Save.

  12. In the Database Credentials section, click Add.

    The Add Database Credentials page is displayed.

  13. Enter the following details:

    • Target: Select the target name.

    • Use Preferred Credentials: If you are using preferred credentials, then select the checkbox.

    • Named Credential: If you are using named credentials, then select the credential name.

    Click Save.

  14. Choose the standby system, and click Select.

  15. Use the above steps to associate the credentials for the standby site.

Associating Credentials Using EMCLI Commands

Associate the credentials for the targets by running the credential framework emcli commands in the command-line interface:

emcli create_siteguard_credential_association 
        -system_name="name"
        -credential_type="type"
        -credential_name="name" 
        -credential_owner="owner"
        –use_preferred_credential="true or false" 
Parameter Description
-system_name Specify the name of the system, which is associated with the site.
-credential_type Specify the credential type depending on the target:
  • Host: HostNormal

  • Host (users with root privileges): HostPrivileged

  • Oracle WebLogic Server: WLSAdmin

  • Oracle Database: DatabaseSysdba

-credential_name Specify a name for the credential.
-credential_owner Specify the owner of the credential.
–use_preferred_credential If you are using Preferred Credentials, then specify true.

Associating Pre-Scripts and Post-Scripts

You can associate pre-scripts or post-scripts (created in "Creating Pre-Scripts and Post-Scripts") for the Oracle Site Guard operation workflow.

Note:

You can specify the script arguments as name-value pairs with the script. For example, test.sh -param1 value1 -param2 value2.

You can associate pre-scripts and post-scripts using one of the following options:

Associating Pre-Scripts and Post-Scripts Using Enterprise Manager Cloud Control Console

To associate pre-scripts and post-scripts for the primary site, complete the following steps:

  1. Log in to Enterprise Manager as an EM_CLOUD_ADMINISTRATOR user.

  2. Select Targets and then select Systems.

    The Systems page is displayed.

  3. Select the primary system (created in "Creating Generic Systems for the Primary and Standby Sites").

  4. Click Generic System > Site Guard > Configure.

    The Site Guard Configuration page is displayed.

  5. Click the Pre/Post Scripts tab.

  6. Click Add.

    The Add Pre/Post Scripts page is displayed.

  7. Enter the following details:

    • Script Path: Enter the path to the script, or click the search icon and specify the path to the script.

    • Target Hosts: Select the target name.

    • Script Type: The type of script, depending on the function you want to perform, select one of the following options:

      • Pre-Script

      • Post-Script

    • Operation Type: The function of the operation. Example: Switchover, Failover, Start, or Stop.

    • Role: Select Primary or Standby based on the system role. By default, the script is configured for both primary and standby roles for a given system.

    • Credential Type: Select Normal Host Credentials or Privileged Host Credentials for users with root privileges.

    Click Save.

  8. Use the above steps to associate the pre-scripts and post-scripts for the standby site.

Associating Pre-Scripts and Post-Scripts Using EMCLI Commands

To associate a pre-script or post-script with Oracle Site Guard, run the following emcli commands in the command-line interface:

emcli create_siteguard_script
        -system_name= "name"
        -operation="operation_name"
        -script_type="script_type"
        -host_name="name of the host"
        -path="path of the script"
        -all_hosts="true"
        –credential_type="type"
        -role="role"
Parameter Description
-system_name Specify the system on which you are performing the operation.
-operation The function of the operation. Example: Switchover, Failover, Start, or Stop.
-script_type The type of script, depending on the function you want to perform select one of the following options:
  • Pre-Script

  • Post-Script

-path Enter the path to the script.
-host_name The name of the host where the script will be run.

Note: Ensure that the hostname is part of the system specified in system_name.

-all_hosts Specify this optional flag to enable the script to run on all the hosts in the system. This parameter overrides the host_name.
–credential_type Specify HostNormal credentials or HostPrivileged credentials for users with root privileges.
-role Specify the role of the system when the script is run.

For example: Primary or Standby.


Associating Storage Scripts

You can associate storage scripts (created in "Creating Storage Scripts") for the Oracle Site Guard operation workflow.

You can associate the storage scripts using one of the following options:

Associating Storage Scripts Using Enterprise Manager Cloud Control Console

To associate storage scripts for the primary site, complete the following steps:

  1. Log in to Enterprise Manager as an EM_CLOUD_ADMINISTRATOR user.

  2. Select Targets and then select Systems.

    The Systems page is displayed.

  3. Select the primary system (created in "Creating Generic Systems for the Primary and Standby Sites").

  4. Click Generic System > Site Guard > Configure.

    The Site Guard Configuration page is displayed.

  5. Click the Storage Scripts tab.

  6. Click Add.

    The Add Storage Scripts page is displayed.

  7. Enter the following details:

    • Script Path: Enter the path to the script or click the search icon, and specify the path to the script.

    • Target Hosts: Select the target name.

    • Script Type: The type of script, depending on the function you want to perform, select one of the following options:

      • Mount

      • UnMount

      • Storage-Switchover

      • Storage-Failover

    • Operation Type: The function of the operation. Example: Switchover or Failover.

    • Credential Type: Select Normal Host Credentials or Privileged Host Credentials for users with root privileges.

    Click Save.

  8. To associate the storage scripts for the standby site, follow steps 1-7.

Associating Storage Scripts Using EMCLI Commands

You must associate the following storage scripts:

Mount Scripts for Primary and Standby Sites

To associate a mount script, run the following emcli commands in the command-line interface:

emcli create_siteguard_script
        -system_name="system_name"
        -operation="operation_name"
        -script_type="Mount"
        -host_name="name of the host"
        -path="path of the script"
        -all_hosts= "true"
        –credential_type="type" 

Unmount Script for Primary and Standby Sites

To associate a pre-script or post-script, run the following emcli commands in the command-line interface:

emcli create_siteguard_script
        -system_name="system_name"
        -operation="operation_name"
        -script_type= "UnMount"
        -host_name="name of the host"
        -path="path of the script"
        -all_hosts="true"
        –credential_type="type"

Switchover Script for Primary and Standby Sites

To associate a pre-script or post-script, run the following emcli commands in the command-line interface:

emcli create_siteguard_script
        -system_name="system_name"
        -operation="operation_name"
        -script_type="Storage-Switchover"
        -host_name="name of the host"
        -path="path of the script"
       -all_hosts="true"
       –credential_type="type"

Failover Script for Primary and Standby Sites

To associate a pre-script or post-script, run the following emcli commands in the command-line interface:

emcli create_siteguard_script
        -system_name="system_name"
        -operation="operation_name"
        -script_type="Storage-Failover"
        -host_name="name of the host"
        -path="path of the script"
        -all_hosts="true"
        –credential_type="type"

Executing Oracle Site Guard Operations

An operation plan contains the execution flow for the Oracle Site Guard operation. You can use it to define the order in which steps of an operation are executed. To execute any Oracle Site Guard operation, you must create an operation. It contains the execution flow for a Oracle Site Guard operation. For example, stopping Oracle HTTP Servers, stopping the Managed Servers and Administration Server in a WebLogic domain, and so on. You can either use the default operation plan or update it to change the order of targets within their corresponding steps.You can save an operation plan to the repository, and execute it as needed.

Ensure that you must complete the following steps before you perform an operation:

Creating an Operation Plan

You can create an operation plan by running the following emcli commands in the command-line interface:

For switchover or failover operations:

emcli create_operation_plan
        -name="name"
        -primary_system_name="primary_system_name"
        -standby_system_name="standby_system_name"
        -operation_plan="operation_name"

For starting or stopping a site:

emcli create_operation_plan
        -name="name"
        -system_name="name"
        -operation_plan="operation_name"
Parameter Description
name Set the name of the operation plan.
primary_system_name Set the name of the primary system. This parameter is set for switchover or failover operation only.
standby_system_name Set the name of the standby system. This parameter is set for switchover or failover operation only.
system_name Enter the name of the system.
operation_plan Enter the name of the operation plan.

For a sample of the emcli command for creating an operation plan using the command-line interface, see Example F-2 in Appendix F, "create_operation_plan".

Updating an Operation Plan

You can update an operation plan as follows:

Changing Execution Orders

You can modify the order in which the steps are executed in an operation plan. For example, you can start the Oracle Identity Manager domain before starting any other Oracle WebLogic Server domain in a site or the order of an individual step in an operation plan, by running the following emcli command in the command-line interface:

emcli update_operation_plan
         -name="plan_name"
         -step_number="7"
         -move="Up"

Updating Execution Modes

The execution mode determines whether the steps pertaining to a target type in the site runs in parallel (executed simultaneously) or in serial mode. The execution mode can be either Serial or Parallel. You can update the execution mode by running the following emcli command in the command-line interface:

emcli update_operation_plan 
         –name=”plan_name” 
         –step_number=”2”  
         –execution_mode=”Parallel”

Disabling a Step

You can disable any step in the operation plan by running the following emcli command in the command-line interface:

emcli update_operation_plan 
         –name=”plan_name” 
         –step_number=”2”  
         –enabled=”false”

Updating Error Modes

For more information, see "Updating Error Modes in an Operation Plan".

Running Precheck Utility

Oracle Site Guard automatically runs the precheck utility before performing any operation. You can also run the precheck utility separately, before executing any Oracle Site Guard operations. Oracle Site Guard performs the following prechecks:

  • Checks whether the Fusion Middleware Farms running on the primary is down before performing a failover operation.

  • 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 whether 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.

  • Asserts the existence of all configured scripts (pre/post/mount/unmount/storage role reversal) on their respective target hosts.

  • Runs Oracle Data Guard Broker prechecks to ascertain whether the Database is ready for role reversal (for switchover/failover operation)

  • Performs Database Role Checks

You must run the following emcli command in the command-line interface:

emcli run_prechecks
       -operation_plan="operation_plan_name"
Parameter Description
-operation_plan Enter the name of your operation plan.

You can also monitor the status of a precheck operation using Enterprise Manager Cloud Control.

Note:

For more information, see Appendix F, "run_prechecks".

Submitting an Operation Plan

You must submit an operation plan by running the following emcli command in the command-line interface:

emcli submit_operation_plan
        -name="operation plan_name" 
       [-run_prechecks={true|false}]
Parameter Description
-name Enter the name of the operation plan.
-run_prechecks Enter false, if you do not want to run precheck. For more information, see "Running Precheck Utility".

Note:

For more information, see Appendix F, "submit_operation_plan".

Monitoring an Operation Plan

To monitor an operation plan submitted for execution, complete the following steps:

  1. Log in to Enterprise Manager Cloud Control Console as an EM_CLOUD_ADMINISTRATOR user.

  2. Click Enterprise > Provisioning and Patching > Procedure Activity.

    The Provisioning page is displayed.

  3. Click the Procedure Activity tab.

Note:

You can also verify the status by running the following emcli command in the command-line interface:
get_instance_status_instance="GUID"

To get the GUID information, run the following command:

emcli get_instances 
       -type="SiteGuard"

Error Management Framework

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 (stop and continue). In a disaster recovery scenario, it is very likely that things may go wrong. For example, some hosts might go down, become unreachable, or some servers might not start. To address such failures, Oracle Site Guard provides an option to define the error mode for individual steps and also lets you enable or disable steps. By default, the error mode is stop, and the run mode is enabled. This section includes the following topics:

Note:

For more information, see "Troubleshooting Oracle Site Guard Issues".

Error Modes

You can define the following error modes for individual targets in a step for any given operation plan:

Stop Error Mode

The execution flow stops if the step fails. The status of the step becomes Action Required. You must manually confirm this failure from Enterprise Manager Cloud Control console to restart the execution. The execution flow continues after the confirmation, but the failed step is not retried. The failed step can be retried at the job level from the console but the status of the retry operation is not reflected at the target level status or at the top-level step status. This is the default error mode. See Figure 30-3 and Figure 30-4.

Figure 30-3 Status Details

Description of Figure 30-3 follows
Description of "Figure 30-3 Status Details"

Figure 30-4 Stop Error Mode

Description of Figure 30-4 follows
Description of "Figure 30-4 Stop Error Mode"

Continue Error Mode

In this error mode, execution flow continues even if the step fails. The status of the step shows Failed, but the operation continues and the top-level step status shows Completed with Errors. Figure 30-5 shows an example of continue error mode.

Figure 30-5 Continue Error Mode

Description of Figure 30-5 follows
Description of "Figure 30-5 Continue Error Mode"

Updating Error Modes in an Operation Plan

You can update the error modes in an operation plan by running the following emcli command in the command-line interface:

emcli update_operation_plan
        -name="plan_name"
        -step_number={step number}
        -target_host={host name}
        -error_mode={error mode}
Parameter Description
-name The name of the operation plan.
-step_number Number of the step which should be updated
-target_host The name of the system. Enter this option for Start or Stop operation.
-error_mode The error mode type. For example, Stop or Enabled.

Figure 30-6 shows an example of a user-defined operation plan.

Figure 30-6 Updating Error Mode

Description of Figure 30-6 follows
Description of "Figure 30-6 Updating Error Mode"

Retrying a Failed Operation

To retry a failed operation, complete the following steps:

  1. Log in to Enterprise Manager Cloud Control Console as an EM_CLOUD_ADMINISTRATOR user.

  2. Click Enterprise > Provisioning and Patching > Procedure Activity.

    The Provisioning page is displayed.

  3. Click the Procedure Activity tab.

  4. Select the failed operation, and click Action Required.

  5. In Embedded Procedure Step, click Action Required.

  6. Select the failed operation, and click Failed.

  7. In Target, select the failed operation, and click Failed.

  8. Switch to Classic View.

  9. Click Enterprise > Provisioning and Patching > Procedure Activity Credentials.

  10. Click Procedure Activity.

  11. Select the failed operation, and click Action Required.

  12. In Embedded Procedure Step, click Action Required.

  13. Select the failed operation, and click Action Required.

  14. Click Confirm.

Managing a Site Using Oracle Site Guard

You can use emcli commands to execute the following Oracle Site Guard operations:

Note:

See Appendix F, "Oracle Site Guard Command-Line Interface Reference" for the list of emcli commands to manage an Oracle Site Guard configuration directly from the command-line interface.

Stopping a Site

To stop a site, run the following emcli command in the command-line interface:

emcli submit_operation_plan 
              -name="stop-site1" 
              -run_prechecks="true"
Parameter Description
-name Specify the name of the site that you want to stop.
-run_prechecks Enter true or false. The value of this parameter is true, by default.

Starting a Site

To start a site, run the following emcli command in the command-line interface:

emcli submit_operation_plan 
             -name="start-site1" 
             -run_prechecks="true"
Parameter Description
-name Specify the name of the site that you want to start.
-run_prechecks Enter true or false. The value of this parameter is true, by default.

Performing Site Switchover

To perform a site switchover, run the following emcli command in the command-line interface:

emcli submit_operation_plan 
        -name="switchover-site1"
        -run_prechecks="true" 
Parameter Description
-name Specify the name of the site for which you want to perform a switchover.
-run_prechecks Enter true or false.

Performing Site Failover

To perform a site failover, run the following emcli command in the command-line interface:

emcli submit_operation_plan 
        -name="failover-site1"
        -run_prechecks="true" 
Parameter Description
-name Specify the name of the site for which you want to perform a failover.
-run_prechecks Enter true or false.

After performing a failover operation, you must manually reinstate the database manually. For more information, see "How to Reinstate a Database" in the Oracle Data Guard Broker.